Difference between revisions of "MakeStaticPackage.py"

From dftwiki3
Jump to: navigation, search
 
Line 5: Line 5:
  
 
<source lang="python">
 
<source lang="python">
 +
 +
 
#! /usr/bin/env python
 
#! /usr/bin/env python
 
# makeStaticPackage.py
 
# makeStaticPackage.py
 
# (C) D. Thiebaut
 
# (C) D. Thiebaut
 +
# Version 6/7/10
 
#
 
#
 
# This program runs under Mac OS X.
 
# This program runs under Mac OS X.
 
+
#
 
# This program takes the executable generated by Qt3 (but would work
 
# This program takes the executable generated by Qt3 (but would work
 
# very likely with other compiled output) that relies on Qt3 specific
 
# very likely with other compiled output) that relies on Qt3 specific
Line 24: Line 27:
 
# but NOT IN THE CURRENT DIRECTORY:
 
# but NOT IN THE CURRENT DIRECTORY:
 
#
 
#
#        makeStaticPackage.py  ~/bin/filterwiki9
+
#        makeStaticPackage.py  ~/bin/filterwiki9 [-datafile file1] [-datafile file2]...
 
#
 
#
 
# The algorithm is the following:
 
# The algorithm is the following:
Line 207: Line 210:
  
 
                  
 
                  
def generateXGridBatchFile( executable ):
+
def generateXGridBatchFile( executable, dataFiles ):
 
     """Creates a simple text file with the names of the libs organized right to
 
     """Creates a simple text file with the names of the libs organized right to
 
     feed to makeBatchMulti.py to create an XGrid batch file"""
 
     feed to makeBatchMulti.py to create an XGrid batch file"""
Line 218: Line 221:
 
         baseName = baseNameOf( lib )
 
         baseName = baseNameOf( lib )
 
         file.write( baseName + "\n" )
 
         file.write( baseName + "\n" )
     file.write( "\n\n" )
+
     file.write( "\n" )
 +
    for datafile in dataFiles:
 +
        file.write( datafile + "\n" )
 +
    file.write( "\n" )
 
     file.write( "./" + baseNameExecutable )
 
     file.write( "./" + baseNameExecutable )
 
     file.write( "\n\n\n" )
 
     file.write( "\n\n\n" )
Line 239: Line 245:
 
     args = sys.argv
 
     args = sys.argv
 
     if len( args ) < 2:
 
     if len( args ) < 2:
         print "syntax: %s MacExecutableFile" % args[0]
+
         print "syntax: %s MacExecutableFile [-datafile file [-datafile file]...]" % args[0]
 
         return
 
         return
  
 
     #--- get executable ---
 
     #--- get executable ---
 +
    dataFiles = []
 
     executable = args[1]
 
     executable = args[1]
 +
    for i in range( len( args ) ):
 +
        if args[i].lower()=="-datafile" and i+1 < len( args ):
 +
            dataFiles.append( args[i+1] )
  
 
     #--- remove all the current *.dylib in directory ---
 
     #--- remove all the current *.dylib in directory ---
Line 265: Line 275:
 
      
 
      
 
     #--- generate an XGrid batch file ---
 
     #--- generate an XGrid batch file ---
     generateXGridBatchFile( executable )
+
     generateXGridBatchFile( executable, dataFiles )
  
  
 
main( False ) #True )
 
main( False ) #True )
 +
 +
 +
  
  

Latest revision as of 11:34, 7 June 2010

--D. Thiebaut 15:43, 3 June 2010 (UTC)



This section is only visible to computers located at Smith College