diff options
Diffstat (limited to 'Tools/freeze/freeze.py')
-rwxr-xr-x | Tools/freeze/freeze.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py index eea8134..dfd0369 100755 --- a/Tools/freeze/freeze.py +++ b/Tools/freeze/freeze.py @@ -57,6 +57,10 @@ Options: (For debugging only -- on a win32 platform, win32 behavior is automatic.) +-r prefix=f: Replace path prefix. + Replace prefix with f in the source path references + contained in the resulting binary. + Arguments: script: The Python script to be executed by the resulting binary. @@ -109,6 +113,7 @@ def main(): debug = 1 odir = '' win = sys.platform[:3] == 'win' + replace_paths = [] # settable with -r option # default the exclude list for each platform if win: exclude = exclude + [ @@ -139,7 +144,7 @@ def main(): # Now parse the command line with the extras inserted. try: - opts, args = getopt.getopt(sys.argv[1:], 'a:de:hmo:p:P:qs:wx:l:') + opts, args = getopt.getopt(sys.argv[1:], 'r:a:de:hmo:p:P:qs:wx:l:') except getopt.error, msg: usage('getopt error: ' + str(msg)) @@ -174,6 +179,9 @@ def main(): addn_link.append(a) if o == '-a': apply(modulefinder.AddPackagePath, tuple(string.split(a,"=", 2))) + if o == '-r': + f,r = string.split(a,"=", 2) + replace_paths.append( (f,r) ) # default prefix and exec_prefix if not exec_prefix: @@ -310,7 +318,7 @@ def main(): # collect all modules of the program dir = os.path.dirname(scriptfile) path[0] = dir - mf = modulefinder.ModuleFinder(path, debug, exclude) + mf = modulefinder.ModuleFinder(path, debug, exclude, replace_paths) if win and subsystem=='service': # If a Windows service, then add the "built-in" module. |