diff --git a/src/octoprint_setuptools/__init__.py b/src/octoprint_setuptools/__init__.py index 3c4039ea..3dfe7832 100644 --- a/src/octoprint_setuptools/__init__.py +++ b/src/octoprint_setuptools/__init__.py @@ -338,10 +338,11 @@ class BundleTranslation(Command): class PackTranslation(Command): - description = "bundles translations" + description = "creates language packs for translations" user_options = [ - ('locale=', 'l', 'locale for the translation to bundle'), - ('author=', 'a', 'author of the translation') + ('locale=', 'l', 'locale for the translation to pack'), + ('author=', 'a', 'author of the translation'), + ('target=', 't', 'target folder for the pack') ] boolean_options = [] @@ -367,6 +368,7 @@ class PackTranslation(Command): def initialize_options(self): self.locale = None self.author = None + self.target = None def finalize_options(self): if self.locale is None: @@ -383,7 +385,10 @@ class PackTranslation(Command): now = datetime.datetime.utcnow().replace(microsecond=0) - zip_path = os.path.join(self.__class__.source_dir, "{prefix}{locale}_{date}.zip".format(prefix=self.__class__.pack_name_prefix, locale=locale, date=now.strftime("%Y%m%d%H%M%S"))) + if self.target is None: + self.target = self.__class__.source_dir + + zip_path = os.path.join(self.target, "{prefix}{locale}_{date}.zip".format(prefix=self.__class__.pack_name_prefix, locale=locale, date=now.strftime("%Y%m%d%H%M%S"))) print("Packing translation to {zip_path}".format(**locals())) def add_recursively(zip, path, prefix):