]> granicus.if.org Git - python/commitdiff
Added a -c (--copyfile) option with argument src:dst which copies file src
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 24 Feb 2003 16:27:08 +0000 (16:27 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 24 Feb 2003 16:27:08 +0000 (16:27 +0000)
into dst in the bundle. The Python API already had this functionality

Lib/plat-mac/buildtools.py
Lib/plat-mac/bundlebuilder.py

index c6430b0211588fee4df7efc4364e26332a4a8140..470f016981188b0f30facfe684c58d7e76472692 100644 (file)
@@ -301,7 +301,10 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
        if rsrcname:
                builder.resources.append(rsrcname)
        for o in others:
-               builder.resources.append(o)
+               if type(o) == str:
+                       builder.resources.append(o)
+               else:
+                       builder.files.append(o)
        if plistname:
                import plistlib
                builder.plist = plistlib.Plist.fromFile(plistname)
index 50320f402e3e239ae7845bd1ade77675846b8672..fd19cbb0ed6de496ed5d55d813498218e24d7b4f 100755 (executable)
@@ -648,6 +648,7 @@ Options:
   -b, --builddir=DIR     the build directory; defaults to "build"
   -n, --name=NAME        application name
   -r, --resource=FILE    extra file or folder to be copied to Resources
+  -f, --copyfile=SRC:DST extra file or folder to be copied into the bundle
   -e, --executable=FILE  the executable to be used
   -m, --mainprogram=FILE the Python main program
   -a, --argv             add a wrapper main program to create sys.argv
@@ -679,8 +680,8 @@ def main(builder=None):
        if builder is None:
                builder = AppBuilder(verbosity=1)
 
-       shortopts = "b:n:r:e:m:c:p:lx:i:hvqa"
-       longopts = ("builddir=", "name=", "resource=", "executable=",
+       shortopts = "b:n:r:f:e:m:c:p:lx:i:hvqa"
+       longopts = ("builddir=", "name=", "resource=", "copyfile=", "executable=",
                "mainprogram=", "creator=", "nib=", "plist=", "link",
                "link-exec", "help", "verbose", "quiet", "argv", "standalone",
                "exclude=", "include=", "package=", "strip", "iconfile=")
@@ -697,6 +698,11 @@ def main(builder=None):
                        builder.name = arg
                elif opt in ('-r', '--resource'):
                        builder.resources.append(arg)
+               elif opt in ('-f', '--copyfile'):
+                       srcdst = arg.split(':')
+                       if len(srcdst) != 2:
+                               usage()
+                       builder.files.append(srcdst)
                elif opt in ('-e', '--executable'):
                        builder.executable = arg
                elif opt in ('-m', '--mainprogram'):