diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2009-05-19 17:34:31 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-05-19 17:34:31 +0800 |
commit | 91d9bbea39b77cc578537adb8423fbcc2ef20b11 (patch) | |
tree | 3cbeb6763b54ef749fc1b1242f4584a6f7fd77d1 | |
parent | 007f92ecb7a09ffc21bd0bfd6764c0f60ba18ddd (diff) | |
download | gsoc2013-empathy-91d9bbea39b77cc578537adb8423fbcc2ef20b11.tar gsoc2013-empathy-91d9bbea39b77cc578537adb8423fbcc2ef20b11.tar.gz gsoc2013-empathy-91d9bbea39b77cc578537adb8423fbcc2ef20b11.tar.bz2 gsoc2013-empathy-91d9bbea39b77cc578537adb8423fbcc2ef20b11.tar.lz gsoc2013-empathy-91d9bbea39b77cc578537adb8423fbcc2ef20b11.tar.xz gsoc2013-empathy-91d9bbea39b77cc578537adb8423fbcc2ef20b11.tar.zst gsoc2013-empathy-91d9bbea39b77cc578537adb8423fbcc2ef20b11.zip |
Add documentation translation to NEWS
-rwxr-xr-x | release.py | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/release.py b/release.py index 32bad1feb..aa9335542 100755 --- a/release.py +++ b/release.py @@ -134,12 +134,13 @@ class Project: t = Template(template) return t.substitute(locals()) - def get_translations(self): - self.translations = '' - files_str = self.exec_cmd("ls po/*.po") + def get_translations(self, cmd, format): + translations = '' + files_str = self.exec_cmd(cmd) files = files_str.splitlines() - for f in files: - lang = f[3:len(f)-3] + for line in files: + f = line[line.rfind(' '):] + lang = f[f.rfind('/')+1:f.rfind('.')] commit_str = self.exec_cmd("git log %s.. %s" % (self.last_tag, f)) if commit_str == '': continue @@ -157,7 +158,8 @@ class Project: authors += ", " authors += author - self.translations += "Updated %s Translation (%s)\n" % (lang, authors) + translations += format % (lang, authors) + return translations def get_bugs(self): commit_str = self.exec_cmd('git show %s' % (self.last_tag)) @@ -190,25 +192,26 @@ class Project: col_description = i i = i + 1 - self.bugs = '' + bugs = '' for row in reader: bug_number = row[col_bug_id] description = row[col_description] - self.bugs += ' - Fixed #%s, %s\n' % (bug_number, description) - - def make_tag(self): - new_tag = self.package_name.upper() + '_' +\ - self.package_version.replace('.', '_') - self.exec_cmd('git tag -m "Tagged for release %s." %s' % ( self.package_version, new_tag)) + bugs += ' - Fixed #%s, %s\n' % (bug_number, description) + return bugs def generate_news(self): - self.get_translations() - self.get_bugs() + translations = self.get_translations("ls -l po/*.po", "Updated %s Translation (%s)\n") + help_translations = self.get_translations("ls -l help/*/*.po", "Updated %s Documentation translation (%s)\n") + bugs = self.get_bugs() + news = 'NEW in '+ self.package_version + '\n==============\n' - if self.bugs != '': - news += 'Bugs fixed:\n' + self.bugs + '\n' - if self.translations != '': - news += 'Translations:\n' + self.translations + '\n' + if bugs != '': + news += 'Bugs fixed:\n' + bugs + '\n' + if translations != '': + news += 'Translations:\n' + translations + '\n' + if help_translations != '': + news += 'Documentation translations:\n' + \ + help_translations + '\n' return news @@ -222,6 +225,11 @@ class Project: self.exec_cmd('cat NEWS >> /tmp/NEWS') self.exec_cmd('mv /tmp/NEWS .') + def make_tag(self): + new_tag = self.package_name.upper() + '_' +\ + self.package_version.replace('.', '_') + self.exec_cmd('git tag -m "Tagged for release %s." %s' % ( self.package_version, new_tag)) + def upload_tarball(self): tarball = '%s-%s.tar.gz' % (self.package_name.lower(), self.package_version) |