[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2064] trunk/py/scripts/addons/ game_engine_save_as_runtime.py: Save as Runtime: Some minor changes to bundling Python:

Mitchell Stokes mogurijin at gmail.com
Mon Jun 27 07:43:36 CEST 2011


Revision: 2064
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2064
Author:   moguri
Date:     2011-06-27 05:43:35 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
Save as Runtime: Some minor changes to bundling Python:
  * Now __pycache__ folders are ignored instead of *.pyc files (the only pyc files are in the __pycachce__ folders)
  * Now 2.58/python/lib is copied over instead of just lib. This allows the runtime to take advantage of Blender's "bundled Python" features. Having the 2.58 folder also allows for other potential files that BGE users might eventually want (e.g., components).

Modified Paths:
--------------
    trunk/py/scripts/addons/game_engine_save_as_runtime.py

Modified: trunk/py/scripts/addons/game_engine_save_as_runtime.py
===================================================================
--- trunk/py/scripts/addons/game_engine_save_as_runtime.py	2011-06-25 08:30:16 UTC (rev 2063)
+++ trunk/py/scripts/addons/game_engine_save_as_runtime.py	2011-06-27 05:43:35 UTC (rev 2064)
@@ -19,9 +19,9 @@
 bl_info = {
     'name': 'Save As Runtime',
     'author': 'Mitchell Stokes (Moguri)',
-    'version': (0, 3, 0),
-    "blender": (2, 5, 7),
-    "api": 35622,
+    'version': (0, 3, 1),
+    "blender": (2, 5, 8),
+    "api": 37846,
     'location': 'File > Export',
     'description': 'Bundle a .blend file with the Blenderplayer',
     'warning': '',
@@ -131,15 +131,16 @@
     
     if copy_python:
         print("Copying Python files...", end=" ")
-        src = os.path.join(blender_dir, bpy.app.version_string.split()[0], "python", "lib")
-        dst = os.path.join(runtime_dir, "lib")
+        py_folder = os.path.join(bpy.app.version_string.split()[0], "python", "lib")
+        src = os.path.join(blender_dir, py_folder)
+        dst = os.path.join(runtime_dir, py_folder)
         
         if os.path.exists(dst):
             if overwrite_lib:
                 shutil.rmtree(dst)
-                shutil.copytree(src, dst, ignore=lambda dir, contents: [i for i in contents if i.endswith('.pyc')])
+                shutil.copytree(src, dst, ignore=lambda dir, contents: [i for i in contents if i == '__pycache__'])
         else:
-            shutil.copytree(src, dst, ignore=lambda dir, contents: [i for i in contents if i.endswith('.pyc')])
+            shutil.copytree(src, dst, ignore=lambda dir, contents: [i for i in contents if i == '__pycache__'])
         
         print("done")
 



More information about the Bf-extensions-cvs mailing list