7205: bundlebuilder accepts old "dist" cmd, checks for po dir
This commit is contained in:
parent
cc8e682ab0
commit
756b9309e8
@ -81,6 +81,10 @@ class Builder(object):
|
||||
def build_locale(self):
|
||||
po_dir = os.path.join(self.config.source_dir, 'po')
|
||||
|
||||
if not self.config.bundle.is_dir(po_dir):
|
||||
logging.warn("Missing po/ dir, cannot build_locale")
|
||||
return
|
||||
|
||||
for f in os.listdir(po_dir):
|
||||
if not f.endswith('.po'):
|
||||
continue
|
||||
@ -214,6 +218,10 @@ def cmd_dist_xo(config, options, args):
|
||||
packager = XOPackager(config)
|
||||
packager.package()
|
||||
|
||||
def cmd_dist(config, options, args):
|
||||
logging.warn("dist deprecated, use dist_xo.")
|
||||
cmd_dist_xo(config, options, args)
|
||||
|
||||
def cmd_dist_source(config, options, args):
|
||||
packager = SourcePackager(config)
|
||||
packager.package()
|
||||
|
@ -132,7 +132,18 @@ class Bundle:
|
||||
zip_file.close()
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def is_dir(self, filename):
|
||||
if self._unpacked:
|
||||
path = os.path.join(self._path, filename)
|
||||
return os.path.isdir(path)
|
||||
else:
|
||||
zip_file = zipfile.ZipFile(self._path)
|
||||
path = os.path.join(self._zip_root_dir, filename, "")
|
||||
for f in zip_file.namelist():
|
||||
if f.startswith(path):
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_path(self):
|
||||
"""Get the bundle path."""
|
||||
|
Loading…
Reference in New Issue
Block a user