Commits

Anonymous committed 4c6ecfd

see ChangeLog

Comments (0)

Files changed (5)

 6-03-2006 Martin Woudstra
-	Renamed package from PyJobTransforms to PyJobTransformsCore
+	Imported everything from PyJobTransforms
 	Moved examples to the respective domain packages
 	cmt/requirements: 
 	      - Installing jobtransforms in dedicated area (InstallArea/trfs)
 	      -	Adding trfs installarea path to PYTHONPATH,PATH & JOBOPTSEARCHPATH
+	test/*.py: adapted to use of PyJobTransformsCore
+	python/*.py: adapted to use of PyJobTransformsCore
+	python/trf.py: add default name for skeleton joboptions file
 3-03-2006 Martin Woudstra
 	cmt/expand_files.py: new! Utility to expand filenames from source & destination dir
 	cmt/requirements: using new utility expand_files.py to gather all transforms

example/ratxml.py

-#!/usr/bin/env python
-import os,sys
-from PyJobTransforms.trfutil import load_transforms
-
-indent = "   "
-
-def opentag(tag,**nargs):
-    otag = '<' + tag
-    for key in nargs.keys(): otag += ' %s=\"%s\"' % (key,nargs[key])
-    otag += '>'
-    return otag
-
-
-def closetag(tag):
-    return '</%s>' % tag
-
-
-def simplefield(tag,value,**nargs):
-    return opentag(tag,**nargs) + str(value) + closetag(tag)
-
-
-def compositefield(tag,fields,**nargs):
-    sep = os.linesep + indent
-    field = opentag(tag,**nargs) + sep
-    field += sep.join( [ f.replace(os.linesep, sep) for f in fields ] )
-    return field + os.linesep + closetag(tag)
-
-
-
-def arg_xml( arg ):
-    fields = [ simplefield( 'name', arg.name()) ,
-               simplefield( 'position', arg.position() ) ,
-               simplefield( 'level', arg.jobOrTask() ) ,
-               simplefield( 'type', arg.type() ) ,
-               simplefield( 'metatype', arg.metaType() ) ,
-               simplefield( 'doc', arg.help() ) ]
-
-    return compositefield('jobtransformalpar', fields)
-        
-
-def trf_xml(trf):
-    sig = [ arg_xml(arg) for arg in trf.argumentList() ] 
-    return compositefield( 'jobtransform', sig, name=trf.name(), version=trf.version() )
-
-
-def do_ratxml( trf_py ):
-    for trf in load_transforms( trf_py ): print trf_xml(trf)
-
-
-# print usage when no arguments are given
-if len(sys.argv) == 1:
-    print 'usage: %s <python_file> [python_file]' % sys.argv[0]
-    print 'Prints on screen an xml signature of the arguments for all JobTransform instantiations found in all python files on the command line'
-    sys.exit()
-
-# execute it!
-for arg in sys.argv[1:]: do_ratxml( arg )
-    

test/argstest_trf.py

 #!/usr/bin/env python
-from PyJobTransforms.trf import *
-from PyJobTransforms.full_trfarg import *
+from PyJobTransformsCore.trf import *
+from PyJobTransformsCore.full_trfarg import *
 
 class TestArgsJobTransform( JobTransform ):
       def __init__(self):
         self.add( JobOptionsArg() )
         self.add( InputEvgenFileArg() )
         self.add( OutputEvgenFileArg() )
+        self.add( InputHitsFileArg() )
+        self.add( OutputHitsFileArg() )
         self.add( OutputHistogramFileArg() )
         self.add( OutputNtupleFileArg() )
                   

test/basic_trfarg_test.py

 import os,sys
 
 import myunittest
-from PyJobTransforms.basic_trfarg import *
+from PyJobTransformsCore.basic_trfarg import *
 
 
 class TestInputFileListArg(myunittest.TestCase):

test/trfutil_test.py

 import unittest
 import os
 
-from PyJobTransforms.trfutil import *
+from PyJobTransformsCore.trfutil import *
 
 class MyTest(unittest.TestCase):
     def shortDescription(self):