From 1aab51842c4474073954b95e4759c9d27276b550 Mon Sep 17 00:00:00 2001
From: chema <chema@chema-laptop.(none)>
Date: Thu, 10 Jul 2008 13:37:09 -0600
Subject: [PATCH] bug 7205: bundlebuilder accepts old "dist", doesn't bomb on missing po dir
---
src/sugar/activity/bundlebuilder.py | 8 ++++++++
src/sugar/bundle/bundle.py | 13 ++++++++++++-
2 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py
index 5afd78f..6c04d88 100644
|
a
|
b
|
|
| 81 | 81 | def build_locale(self): |
| 82 | 82 | po_dir = os.path.join(self.config.source_dir, 'po') |
| 83 | 83 | |
| | 84 | if not config.bundle.is_dir(po_dir): |
| | 85 | logging.warn("Missiong po/ dir, cannot build_locale") |
| | 86 | return |
| | 87 | |
| 84 | 88 | for f in os.listdir(po_dir): |
| 85 | 89 | if not f.endswith('.po'): |
| 86 | 90 | continue |
| … |
… |
|
| 214 | 218 | packager = XOPackager(config) |
| 215 | 219 | packager.package() |
| 216 | 220 | |
| | 221 | def cmd_dist(config, options, args): |
| | 222 | logging.warn("dist deprecated, use dist_xo.") |
| | 223 | cmd_dist_xo(config, options, args) |
| | 224 | |
| 217 | 225 | def cmd_dist_source(config, options, args): |
| 218 | 226 | packager = SourcePackager(config) |
| 219 | 227 | packager.package() |
diff --git a/src/sugar/bundle/bundle.py b/src/sugar/bundle/bundle.py
index 9e876c2..eccbe9a 100644
|
a
|
b
|
|
| 132 | 132 | zip_file.close() |
| 133 | 133 | |
| 134 | 134 | return True |
| 135 | | |
| | 135 | |
| | 136 | def is_dir(self, filename): |
| | 137 | if self._unpacked: |
| | 138 | path = os.path.join(self._path, filename) |
| | 139 | return os.path.isdir(path) |
| | 140 | else: |
| | 141 | zip_file = zipfile.ZipFile(self._path) |
| | 142 | path = os.path.join(self._zip_root_dir, filename, "") |
| | 143 | for subfile in zip_file.namelist(): |
| | 144 | if subfile.startswith(path): |
| | 145 | return True |
| | 146 | return False |
| 136 | 147 | |
| 137 | 148 | def get_path(self): |
| 138 | 149 | """Get the bundle path.""" |