diff --git a/NEWS.txt b/NEWS.txt index 357c8e0f5..62df80a23 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -14,6 +14,7 @@ Version 0.9.0alpha7 - 2007-04-XX `$copy(_id3:TXXX:PERFORMERSORTORDER,artistsort)`. * Support for WAV files. (#2537) * Removed GStreamer-based decoder. + * Implemented `python setup.py install_locales`. * Bug Fixes: * Failed PUID submission deactivates the submit button. (#2673) * Unable to specify album art file name mask. (#2655) diff --git a/setup.py b/setup.py index 6d898c1e0..8916ca2a5 100755 --- a/setup.py +++ b/setup.py @@ -123,17 +123,40 @@ Distribution.locales = None class picard_install_locales(Command): - description = 'install locale files' + description = "install locale files" + user_options = [ + ('install-dir=', 'd', "directory to install locale files to"), + ('build-dir=','b', "build directory (where to install from)"), + ('force', 'f', "force installation (overwrite existing files)"), + ('skip-build', None, "skip the build steps"), + ] + boolean_options = ['force', 'skip-build'] def initialize_options(self): - pass + self.install_dir = None + self.build_dir = None + self.force = 0 + self.skip_build = None + self.outfiles = [] - def finalize_options (self): - pass + def finalize_options(self): + self.set_undefined_options('build', ('build_locales', 'build_dir')) + self.set_undefined_options('install', + ('install_locales', 'install_dir'), + ('force', 'force'), + ('skip_build', 'skip_build'), + ) def run(self): - self.run_command('build_locales') - # TODO install them + if not self.skip_build: + self.run_command('build_locales') + self.outfiles = self.copy_tree(self.build_dir, self.install_dir) + + def get_inputs(self): + return self.locales or [] + + def get_outputs(self): + return self.outfiles class picard_install(install):