Anonymous avatar Anonymous committed 0bd52b2

Allow expandStringToList() to accept non-existent files.

Comments (0)

Files changed (3)

       + Tags for PyJobTransformsCore are ordered in inverse chronological order.  
 ================================================================================ 
 
+2010-06-23 Alvin Tan <clat@hep.ph.bham.ac.uk>
+    * Allow newly modified expandStringToList() function to accept non-existent files.
+
 2010-06-18 Alvin Tan <clat@hep.ph.bham.ac.uk>
     * Added retry functionality for event counting.
     * LFN look-up (in PFC) performed if input file not local. 'LFN:' filename prefix

python/full_trfarg.py

             if valIn == 'NONE': return []
             # split the comma separated list (outside brackets)
             try:
-                return expandStringToList( valIn )
+                return expandStringToList( valIn, False )
             except Exception, msg:
                 raise TransformDefinitionError( '%s=%s: %s' % ( self.name(), valIn, msg ) )
         else:

python/trfutil.py

         ver = ''
     return 'LFN:' + PFNPatResult.group('url') + PFNPatResult.group('lfn') + ver
 
-def expandStringToList(valIn):
+def expandStringToList( valIn, ensureExistence = None ):
     """Comma separated list of filenames. Each filename in the list can be coded
     with the following syntax:
     
 
     '#','##' are used to highlight the dataset so as to reflect it in the job report and metadata.xml files."""
     listSep = ','
+    if ensureExistence is None:
+        ensureExistence = True
     def globExpand( valIn ):
         ds = ''
         if '#' in valIn:
             add = globExpand( val )
         if not add:
             add = expandParallelVectorNotation( val )
-        add = [ getCorrectedFilename( x, forceLFN ) for x in add ]
+        if ensureExistence:
+            add = [ getCorrectedFilename( x, forceLFN ) for x in add ]
         all += add
     return all
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.