Package moap :: Package configure :: Module configure
[hide private]
[frames] | no frames]

Source Code for Module moap.configure.configure

 1  # -*- Mode: Python -*- 
 2  # vi:si:et:sw=4:sts=4:ts=4 
 3   
 4  ''' 
 5  configure-time variables for installed or uninstalled operation 
 6   
 7  Code should run 
 8      >>> from moap.configure import configure 
 9   
10  and then access the variables from the configure module.  For example: 
11      >>> print configure.version 
12   
13  @var  isinstalled: whether an installed version is being run 
14  @type isinstalled: boolean 
15   
16  @var  version:     moap version number 
17  @type version:     string 
18  ''' 
19   
20  import os 
21   
22  # where am I on the disk ? 
23  __thisdir = os.path.dirname(os.path.abspath(__file__)) 
24   
25  if os.path.exists(os.path.join(__thisdir, 'uninstalled.py')): 
26      from moap.configure import uninstalled 
27      config_dict = uninstalled.get() 
28  else: 
29      from moap.configure import installed 
30      config_dict = installed.get() 
31   
32  for key, value in config_dict.items(): 
33      dictionary = locals() 
34      dictionary[key] = value 
35