David Rose 16 년 전
부모
커밋
2995f65b17
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      direct/src/p3d/packp3d.py

+ 12 - 1
direct/src/p3d/packp3d.py

@@ -37,6 +37,12 @@ Options:
      all be combined in the first file.  If the private key is
      all be combined in the first file.  If the private key is
      encrypted, the password will be required to decrypt it.
      encrypted, the password will be required to decrypt it.
 
 
+  -A
+     Sets the auto-start flag in the application, so that the user
+     will not need to click the green play button before it starts,
+     when embedded in a web page.  This can also be set on the HTML
+     page.
+
   -r package
   -r package
      Names an additional package that this application requires at
      Names an additional package that this application requires at
      startup time.  The default package is 'panda3d'; you may repeat
      startup time.  The default package is 'panda3d'; you may repeat
@@ -72,13 +78,14 @@ class ArgumentError(StandardError):
     pass
     pass
 
 
 def makePackedApp(args):
 def makePackedApp(args):
-    opts, args = getopt.getopt(args, 'd:m:S:r:s:Dh')
+    opts, args = getopt.getopt(args, 'd:m:S:Ar:s:Dh')
 
 
     packager = Packager.Packager()
     packager = Packager.Packager()
 
 
     root = Filename('.')
     root = Filename('.')
     main = None
     main = None
     signParams = []
     signParams = []
+    autoStart = False
     requires = []
     requires = []
     allowPythonDev = False
     allowPythonDev = False
     
     
@@ -89,6 +96,8 @@ def makePackedApp(args):
             main = value
             main = value
         elif option == '-S':
         elif option == '-S':
             signParams.append(value)
             signParams.append(value)
+        elif option == '-A':
+            autoStart = True
         elif option == '-r':
         elif option == '-r':
             requires.append(value)
             requires.append(value)
         elif option == '-s':
         elif option == '-s':
@@ -141,6 +150,8 @@ def makePackedApp(args):
         for requireName in requires:
         for requireName in requires:
             packager.do_require(requireName)
             packager.do_require(requireName)
 
 
+        if autoStart:
+            packager.do_config(auto_start = True)
         if allowPythonDev:
         if allowPythonDev:
             packager.do_config(allow_python_dev = True)
             packager.do_config(allow_python_dev = True)