[wingide-users] global imports

Mclam, GeorgeX georgex.mclam at intel.com
Mon Jun 6 18:15:27 MDT 2011


Simple version:

Import (or from) statements reside at the top of each module.  I'd like the files being imported to be a variable, rather than hard coded in the file.  I see no way to easily do this.  ???


Long version:

I have a common module of subroutines that is used by many projects.  However, each project will have at least 4 main files (the main module and 3 "parameter" files).  The main module will call one of the many functions in the subroutines module, but the subroutines module needs to import the parameters for the specific project.  It is impractical to pass the parameters being imported but quite practical to pass the names of the modules for a project (3 files).  Importing in each function of the subroutines module makes no sense and creating separate copy of the subroutines module just so the import statements at the top have the proper hard-coded project module names makes no sense either.

I could write one "initialization" function to handle the imports, but then it seems I'd have to handle each and every value being imported to make it global in the module.  I note that this subroutines module does NOT change any values in the imported modules, it just needs to access them.  This shouldn't be this difficult to do.


Suggestions?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20110606/90da84cc/attachment.html


More information about the wingide-users mailing list