Package Ganga :: Package Runtime :: Module GPIexport
[hide private]
[frames] | no frames]

Source Code for Module Ganga.Runtime.GPIexport

 1  ################################################################################ 
 2  # Ganga Project. http://cern.ch/ganga 
 3  # 
 4  # $Id: GPIexport.py,v 1.1 2008-07-17 16:41:00 moscicki Exp $ 
 5  ################################################################################ 
 6   
 7  """ Utility for exporting symbols to GPI. 
 8  """ 
 9   
10   
11  # all public GPI names will be exported here 
12  import Ganga.GPI 
13   
14  from gangadoc import adddoc 
15   
16 -def exportToGPI(name,object,doc_section,docstring=None):
17 ''' 18 Make object available publicly as "name" in Ganga.GPI module. Add automatic documentation to gangadoc system. 19 "doc_section" specifies how the object should be documented. 20 If docstring is specified then use it to document the object (only use for "Objects" section). Otherwise use __doc__ (via pydoc utilities). 21 FIXME: if you try to export the object instance, you should import it with fully qualified path, e.g. 22 import X.Y.Z 23 X.Y.Z.object = object 24 exportToGPI("obj",X.Y.Z.object,"Objects") 25 26 It has been observed that doing exportToGPI("obj",object,"Objects") may not work. To be understood. 27 ''' 28 29 setattr(Ganga.GPI,name,object) 30 31 adddoc(name,object,doc_section,docstring)
32 33 #print 'EXPORTED',name,object 34 # 35 # 36 # $Log: not supported by cvs2svn $ 37 # Revision 1.3 2007/07/10 13:08:32 moscicki 38 # docstring updates (ganga devdays) 39 # 40 # Revision 1.2 2006/06/21 11:42:30 moscicki 41 # comments 42 # 43 # Revision 1.1 2005/08/24 15:24:11 moscicki 44 # added docstrings for GPI objects and an interactive ganga help system based on pydoc 45 # 46 # 47 # 48