Remove unused code
authorTomas Touceda <chiiph@leap.se>
Wed, 16 Jul 2014 20:19:19 +0000 (16:19 -0400)
committerTomás Touceda <chiiph@leap.se>
Tue, 2 Sep 2014 18:36:47 +0000 (15:36 -0300)
bundler/actions.py
bundler/depcollector.py
bundler/main.py

index df96c92..9b6b12a 100644 (file)
@@ -689,3 +689,21 @@ class SignIt(Action):
                                 "Bitmask.app")
         print codesign("-s", identity, "--force", "--deep", "--verbose", main_app)
         print "Done"
+
+
+
+class RemoveUnused(Action):
+    def __init__(self, basedir, skip, do):
+        Action.__init__(self, "rmunused", basedir, skip, do)
+
+    @skippable
+    def run(self):
+        print "Removing unused python code..."
+        test_dirs = find(self._basedir, "-name", "*test*").strip().splitlines()
+       for td in test_dirs:
+            rm("-rf", os.path.join(self._basedir, td))
+
+        twisted_used = ["aplication", "conch", "cred", "version", "internet", "mail"]
+        # twisted_files = find(self._basedir, "-name", "t
+        print "Done"
+
index 091b440..88a1646 100644 (file)
@@ -35,6 +35,8 @@ def collect_deps(root, dest_lib_dir, path_file):
     mg.import_hook("pkg_resources")
     mg.import_hook("_sre")
     mg.import_hook("zope.proxy")
+    mg.import_hook("tuf")
+    mg.import_hook("timeit")
     mg.run_script(root)
 
     packages = [mg.findNode(i) for i in ["leap.common", "leap.keymanager", "leap.mail", "leap.soledad.client", "leap.soledad.common", "jsonschema"]]
index e26537a..715225f 100644 (file)
@@ -14,6 +14,7 @@ from actions import GitCloneAll, PythonSetupAll, CreateDirStructure
 from actions import CollectAllDeps, CopyBinaries, PLister, SeededConfig
 from actions import DarwinLauncher, CopyAssets, CopyMisc, FixDylibs
 from actions import DmgIt, PycRemover, TarballIt, MtEmAll, ZipIt, SignIt
+from actions import RemoveUnused
 
 from utils import IS_MAC, IS_WIN
 
@@ -124,6 +125,8 @@ def main():
             zi = init(ZipIt)
             zi.run(sorted_repos, args.nightly)
         else:
+            ru = init(RemoveUnused)
+            ru.run()
             ti = init(TarballIt)
             ti.run(sorted_repos, args.nightly)