From 2828399ba5cbb14502b023d4de1ba02f13dd5055 Mon Sep 17 00:00:00 2001 From: Agustin Henze Date: Fri, 28 Feb 2014 08:49:38 -0300 Subject: Imported Upstream version 6.3.0 --- scripts/capty | 8 ++++---- scripts/import_po.py | 17 +++++++++++++++++ scripts/nikola | 4 ++-- scripts/set_version.py | 2 ++ 4 files changed, 25 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/capty b/scripts/capty index 56c424c..a467489 100755 --- a/scripts/capty +++ b/scripts/capty @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 # -*- coding: utf-8 -*- """This tries to do more or less the same thing as CutyCapt, but as a @@ -54,7 +54,7 @@ class Capturer(object): def capture(self): """Captures url as an image to the file specified""" self.wb = QtWebKit.QWebPage() - self.wb.setPreferredContentsSize(QtCore.QSize(900, 700)) + self.wb.setPreferredContentsSize(QtCore.QSize(1024, 768)) self.wb.mainFrame().setScrollBarPolicy( QtCore.Qt.Horizontal, QtCore.Qt.ScrollBarAlwaysOff) self.wb.mainFrame().setScrollBarPolicy( @@ -67,10 +67,10 @@ class Capturer(object): self.wb.mainFrame().load(QtCore.QUrl(self.url)) def doCapture(self): - print "Capturando" + print("Capturing...") self.wb.setViewportSize(self.wb.mainFrame().contentsSize()) img = QtGui.QImage(self.wb.viewportSize(), QtGui.QImage.Format_ARGB32) - print self.wb.viewportSize() + print(self.wb.viewportSize()) painter = QtGui.QPainter(img) self.wb.mainFrame().render(painter) painter.end() diff --git a/scripts/import_po.py b/scripts/import_po.py index 89e1089..224826c 100755 --- a/scripts/import_po.py +++ b/scripts/import_po.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- """Download translations from transifex and regenerate files.""" from __future__ import unicode_literals, print_function @@ -22,6 +23,22 @@ MESSAGES = {""".splitlines() lines2 = [] for entry in po: lines2.append(' "{0}": "{1}",'. format(entry.msgid, entry.msgstr)) + ### BACKWARDS COMPATIBILITY PATCH START + ### TODO: remove in v7 + if entry.msgid in ["Posted:", "Also available in:"]: + fid = entry.msgid + fid = fid.replace(':', '') + fstr = entry.msgstr + fstr = fstr.replace(':', '').replace(':', '') + lines2.append(' "{0}": "{1}",'. format(fid, fstr)) + elif entry.msgid == 'More posts about %s': + fid = entry.msgid + fid = fid.replace(' %s', '') + fstr = entry.msgstr + fstr = fstr.replace(' %s', '').replace('%s', '') + lines2.append(' "{0}": "{1}",'. format(fid, fstr)) + ### BACKWARDS COMPATIBILITY PATCH END + ### TODO: remove in v7 lines.extend(sorted(lines2)) lines.append("}\n") print("Generating:", outf) diff --git a/scripts/nikola b/scripts/nikola index a3e5d72..16ac701 100755 --- a/scripts/nikola +++ b/scripts/nikola @@ -31,7 +31,7 @@ else: # LIBDIR trick end (marker for removal on platforms that don't need it) -from nikola import main +from nikola import __main__ if __name__ == "__main__": - sys.exit(main.main(sys.argv[1:])) + sys.exit(__main__.main(sys.argv[1:])) diff --git a/scripts/set_version.py b/scripts/set_version.py index e34c7ae..289aaef 100755 --- a/scripts/set_version.py +++ b/scripts/set_version.py @@ -31,6 +31,8 @@ if __name__ == "__main__": sed_like_thing(":Version: .*", ":Version: {0}".format(version), doc) sed_like_thing("version='.+'", "version='{0}'".format(version), 'setup.py') + sed_like_thing("version = '.+'", "version = '{0}'".format(version), os.path.join('docs', 'sphinx', 'conf.py')) + sed_like_thing("release = '.+'", "release = '{0}'".format(version), os.path.join('docs', 'sphinx', 'conf.py')) sed_like_thing('__version__ = ".*"', '__version__ = "{0}"'.format(version), os.path.join('nikola', '__init__.py')) sed_like_thing('New in Master', 'New in {0}'.format(version), 'CHANGES.txt') os.system("help2man -h help -N --version-string='{0}' nikola > {1}".format(version, os.path.join('docs', 'man', 'nikola.1'))) -- cgit v1.2.3