[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] hacks

From: David Grant
Subject: [Gnumed-devel] hacks
Date: Fri, 20 Feb 2004 16:20:21 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.6) Gecko/20040207

I was bored today so I started looking into some gnumed code.  In

    appPath = get_base_dir()
    if appPath is None:
               sys.exit("CRITICAL ERROR: Cannot determine base path.")

    # manually extend our module search path
    sys.path.append(os.path.join(appPath, 'wxpython'))
    sys.path.append(os.path.join(appPath, 'python-common'))
    sys.path.append(os.path.join(appPath, 'business'))

This seems like a hack.  The way I would have done it would be:

This should only be done for CVS gnumed:
-append it to PYTHONPATH

In a Linux distribution or Windows installation:
-do nothing, modules should all be found because they should somewhere within sys.path already

-each directory should have an __init__ file to make it a module
-import modules by doing import wxpython.gmMacro, or import python-common.gmDrugView, etc... -Each time you create new modules within the client/ directory, you should have to go into the file and add some sys.path.append thing. It should become a module because of the __init__ file and you just import it when you want.

Please any comments if you have time?


David J. Grant
M.A.Sc. Candidate in Electrical Engineering
a-Si and Integrated Circuits Lab
University of Waterloo
Room DC3707
519-888-4567 x2872

reply via email to

[Prev in Thread] Current Thread [Next in Thread]