Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/activity/bundlebuilder.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2008-05-25 19:47:32 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-05-25 19:47:32 (GMT)
commit3313d78429dea74c81fef707b12b144414643e90 (patch)
tree6703014bcf2a2734d0a965da53154cd7a65d3afa /src/sugar/activity/bundlebuilder.py
parent9eaa51edbb14c2d2b96ad722b7240f4d23a626c9 (diff)
Simplify install a bit, remove uninstall.
Diffstat (limited to 'src/sugar/activity/bundlebuilder.py')
-rw-r--r--src/sugar/activity/bundlebuilder.py42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py
index 9619ef1..487110b 100644
--- a/src/sugar/activity/bundlebuilder.py
+++ b/src/sugar/activity/bundlebuilder.py
@@ -92,22 +92,6 @@ class _AllFileList(list):
f != '.gitignore':
self.append(os.path.join(root, f))
-def _extract_bundle(source_file, dest_dir):
- if not os.path.exists(dest_dir):
- os.mkdir(dest_dir)
-
- zf = zipfile.ZipFile(source_file)
-
- for name in zf.namelist():
- path = os.path.join(dest_dir, name)
- if not os.path.exists(os.path.dirname(path)):
- os.makedirs(os.path.dirname(path))
-
- outfile = open(path, 'wb')
- outfile.write(zf.read(name))
- outfile.flush()
- outfile.close()
-
def cmd_help(config, options, args):
print 'Usage: \n\
setup.py dev - setup for development \n\
@@ -185,14 +169,25 @@ def cmd_install(config, options, args):
path = args[0]
cmd_dist(config, options, args)
- cmd_uninstall(config, options, args)
- _extract_bundle(config.xo_name, path)
+ root_path = os.path.join(args[0], config.bundle_root_dir)
+ if os.path.isdir(root_path):
+ shutil.rmtree(root_path)
-def cmd_uninstall(config, options, args):
- path = os.path.join(args[0], config.bundle_top_dir)
- if os.path.isdir(path):
- shutil.rmtree(path)
+ if not os.path.exists(path):
+ os.mkdir(path)
+
+ zf = zipfile.ZipFile(config.xo_name)
+
+ for name in zf.namelist():
+ full_path = os.path.join(path, name)
+ if not os.path.exists(os.path.dirname(full_path)):
+ os.makedirs(os.path.dirname(full_path))
+
+ outfile = open(full_path, 'wb')
+ outfile.write(zf.read(name))
+ outfile.flush()
+ outfile.close()
def cmd_genpot(config, options, args):
po_path = os.path.join(config.source_dir, 'po')
@@ -331,6 +326,9 @@ def cmd_release(config, options, args):
print 'Done.'
+def cmd_build(config, options, args):
+ pass
+
def start(bundle_name, manifest='MANIFEST'):
parser = OptionParser()
(options, args) = parser.parse_args()