File: __init__.py

package info (click to toggle)
mobyle 1.5.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,284 kB
  • ctags: 2,783
  • sloc: python: 22,709; sh: 33; makefile: 31; ansic: 10; xml: 6
file content (28 lines) | stat: -rw-r--r-- 1,393 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
########################################################################################
#                                                                                      #
#   Author: Bertrand Neron,                                                            #
#   Organization:'Biological Software and Databases' Group, Institut Pasteur, Paris.   #  
#   Distributed under GPLv2 Licence. Please refer to the COPYING.LIB document.         #
#                                                                                      #
########################################################################################

import glob 
import os 

MOBYLEHOME = None
if os.environ.has_key('MOBYLEHOME'):
    MOBYLEHOME = os.environ['MOBYLEHOME']
if not MOBYLEHOME:
    import sys
    sys.exit('MOBYLEHOME must be defined in your environment')

for _file in glob.glob( os.path.join( MOBYLEHOME , 'Local' , 'Config' , 'Execution' , '*Config.py' ) ):
    module_name = os.path.splitext( os.path.basename( _file ) )[0]
    if module_name != '__init__':
        try: 
            module = __import__( module_name , globals(), locals(), [ module_name ])
            klass = getattr( module , module_name)
            locals()[ module_name ] = klass
        except Exception , err :
            print >> sys.stderr , "the module %s cannot be loaded : %s" %( module_name , err )
            continue