Hello community,
here is the log from the commit of package djvusmooth for openSUSE:Factory checked in at 2013-03-03 21:05:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/djvusmooth (Old)
and /work/SRC/openSUSE:Factory/.djvusmooth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "djvusmooth", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/djvusmooth/djvusmooth.changes 2012-10-12 14:15:49.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.djvusmooth.new/djvusmooth.changes 2013-03-03 21:05:40.000000000 +0100
@@ -1,0 +2,20 @@
+Thu Feb 28 20:17:49 UTC 2013 - lazy.kent@opensuse.org
+
+- Update to 0.2.14.
+ * Add "Open recent" submenu.
+ * Do not abort opening a new file if user chose to save the
+ current one.
+ * Check Python version at runtime.
+ * Improve the manual page, as per man-pages(7) recommendations.
+ * Improve the setup script.
+ * Improve error handling.
+- Verify GPG signature.
+- Add BuildRequires: python-devel (as recommended in
+ openSUSE:Packaging Python).
+- Replace BuildRequires: update-desktop-files with
+ desktop-file-utils.
+- Remove %py_requires macro.
+- Don't use '--record-rpm' in install stage; write files into
+ %files section.
+
+-------------------------------------------------------------------
Old:
----
djvusmooth-0.2.13.tar.gz
New:
----
djvusmooth-0.2.14.tar.gz
djvusmooth-0.2.14.tar.gz.asc
djvusmooth.keyring
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ djvusmooth.spec ++++++
--- /var/tmp/diff_new_pack.5E4m2t/_old 2013-03-03 21:05:43.000000000 +0100
+++ /var/tmp/diff_new_pack.5E4m2t/_new 2013-03-03 21:05:43.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package djvusmooth
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,23 +17,29 @@
Name: djvusmooth
-Version: 0.2.13
+Version: 0.2.14
Release: 0
Summary: Graphical Text Editor for DjVu
License: GPL-2.0
Group: Productivity/Publishing/Other
Url: http://jwilk.net/software/djvusmooth
Source0: http://pypi.python.org/packages/source/d/%{name}/%{name}-%{version}.tar.gz
-Source1: djvusmooth.png
+Source1: http://pypi.python.org/packages/source/d/%{name}/%{name}-%{version}.tar.gz.asc
+Source2: djvusmooth.png
+Source3: %{name}.keyring
+BuildRequires: desktop-file-utils
+%if 0%{?suse_version} >= 1230
+BuildRequires: gpg-offline
+%endif
BuildRequires: hicolor-icon-theme
%if 0%{?suse_version} >= 1210
BuildRequires: python-distribute
%else
BuildRequires: python-setuptools
%endif
-BuildRequires: update-desktop-files
# Not actually needed for build, but in order to make the build fail
# if the runtime dependencies are not available in the repository:
+BuildRequires: python-devel
BuildRequires: python-djvulibre
Requires: djvulibre
Requires: python-djvulibre
@@ -42,7 +48,6 @@
Recommends: %{name}-lang
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
-%py_requires
%description
DjVuSmooth is a graphical text editor for DjVu documents.
@@ -50,6 +55,9 @@
%lang_package
%prep
+%if 0%{?gpg_verify:1}
+%gpg_verify %{SOURCE1}
+%endif
%setup -q
%build
@@ -76,17 +84,11 @@
python setup.py install \
--root=%{buildroot} \
- --prefix=%{_prefix} \
- --record-rpm=INSTALLED_FILES
+ --prefix=%{_prefix}
install -Dm 0644 %{SOURCE1} \
%{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
-# Remove locales, man and standard directory from the list.
-sed -i '/locale/d;/\/man\/man/d;/%dir \/usr\/share\/applications/d' \
- INSTALLED_FILES
-
%find_lang %{name}
-%suse_update_desktop_file %{name}
%post
%desktop_database_post
@@ -96,12 +98,14 @@
%desktop_database_postun
%icon_theme_cache_postun
-%files -f INSTALLED_FILES
+%files
%defattr(-,root,root,-)
%doc COPYING doc/changelog
+%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.png
%doc %{_mandir}/man?/*
+%{python_sitelib}/*
%files lang -f %{name}.lang
++++++ djvusmooth-0.2.13.tar.gz -> djvusmooth-0.2.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/MANIFEST.in new/djvusmooth-0.2.14/MANIFEST.in
--- old/djvusmooth-0.2.13/MANIFEST.in 2012-03-13 21:01:47.000000000 +0100
+++ new/djvusmooth-0.2.14/MANIFEST.in 2013-02-20 20:46:05.000000000 +0100
@@ -8,5 +8,5 @@
include doc/changelog
include extra/*
include po/*.po
-include update-i18n
+include private/*
recursive-include lib *.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/PKG-INFO new/djvusmooth-0.2.14/PKG-INFO
--- old/djvusmooth-0.2.13/PKG-INFO 2012-10-02 12:14:53.000000000 +0200
+++ new/djvusmooth-0.2.14/PKG-INFO 2013-02-21 23:22:43.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: djvusmooth
-Version: 0.2.13
+Version: 0.2.14
Summary: graphical editor for DjVu
Home-page: http://jwilk.net/software/djvusmooth
Author: Jakub Wilk
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/doc/changelog new/djvusmooth-0.2.14/doc/changelog
--- old/djvusmooth-0.2.13/doc/changelog 2012-10-02 12:02:46.000000000 +0200
+++ new/djvusmooth-0.2.14/doc/changelog 2013-02-21 23:18:36.000000000 +0100
@@ -1,3 +1,29 @@
+djvusmooth (0.2.14) unstable; urgency=low
+
+ [ Jakub Wilk ]
+ * Add “Open recent” submenu.
+ https://bitbucket.org/jwilk/djvusmooth/issue/7
+ * Do not abort opening a new file if user chose to save the current one.
+ * Check Python version at runtime.
+ * Improve the manual page, as per man-pages(7) recommendations:
+ - Remove the “AUTHOR” section.
+ - Rename the “ENVIRONMENT VARIABLES” section as “ENVIRONMENT”.
+ - Make “PORTABILITY” and “REPORTING BUGS” subsections of the “BUGS”
+ section.
+ * Improve the setup script:
+ + Make “setup.py clean -a” remove compiled manual page (unless it was built
+ by “setup.py sdist”).
+ + Fix compatiblity with Python 2.5 and 2.6 (broken in 0.2.12).
+ * Improve error handilng.
+
+ [ C. Daniel Sanchez R. ]
+ * Update the Spanish translation.
+
+ [ Kyrill Detinov ]
+ * Update the Russian translation.
+
+ -- Jakub Wilk Thu, 21 Feb 2013 23:18:33 +0100
+
djvusmooth (0.2.13) unstable; urgency=low
* Add keyboard shortcuts for “Zoom in” and “Zoom out”.
@@ -12,13 +38,18 @@
djvusmooth (0.2.12) unstable; urgency=low
+ [ Jakub Wilk ]
* Install desktop file.
- * Update the Russian translation, thanks to Kyrill Detinov.
- * Add Spanish translation, contributed by C. Daniel Sanchez R.
* Rename menu item “Edit → Outline → Remove” to “… → Remove all”.
Thanks to Maxim Leyenson for the bug report.
* Use our own minimal XDG Base Directory implementation instead of PyXDG.
+ [ Kyrill Detinov ]
+ * Update the Russian translation.
+
+ [ C. Daniel Sanchez R. ]
+ * Add Spanish translation.
+
-- Jakub Wilk Wed, 13 Jun 2012 20:53:49 +0200
djvusmooth (0.2.11) unstable; urgency=low
@@ -62,7 +93,10 @@
djvusmooth (0.2.8) unstable; urgency=low
- * Update the Russian translation, thanks to Kyrill Detinov.
+ [ Kyrill Detinov ]
+ * Update the Russian translation.
+
+ [ Jakub Wilk ]
* Handle directories with non-ASCII characters.
http://bugs.debian.org/595002
* Fix editing line/arrow annotations.
@@ -72,7 +106,10 @@
djvusmooth (0.2.7) unstable; urgency=low
- * Add Russian translation, contributed by Kyrill Detinov.
+ [ Kyrill Detinov ]
+ * Add Russian translation.
+
+ [ Jakub Wilk ]
* Handle non-ASCII metadata keys.
Thanks to Aleš Kapica for the bug report.
@@ -133,10 +170,12 @@
djvusmooth (0.2.0) unstable; urgency=low
+ [ Mateusz Turcza ]
* Remember last visited directory.
- Thanks to Mateusz Turcza for providing a patch.
+ * Add Polish translation.
+
+ [ Jakub Wilk ]
* Follow the XDG Base Directory Specification.
- * Add Polish translation, contributed by Mateusz Turcza.
* Fix a typo in variable name that was causing random crashes.
* Provide a manual page.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/doc/djvusmooth.1 new/djvusmooth-0.2.14/doc/djvusmooth.1
--- old/djvusmooth-0.2.13/doc/djvusmooth.1 2012-10-02 12:03:11.000000000 +0200
+++ new/djvusmooth-0.2.14/doc/djvusmooth.1 2013-02-21 23:22:43.000000000 +0100
@@ -1,13 +1,14 @@
+.\" [created by setup.py sdist]
'\" t
.\" Title: djvusmooth
.\" Author: Jakub Wilk
.\" Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\" Date: 10/02/2012
+.\" Date: 02/21/2013
.\" Manual: djvusmooth manual
-.\" Source: djvusmooth 0.2.13
+.\" Source: djvusmooth 0.2.14
.\" Language: English
.\"
-.TH "DJVUSMOOTH" "1" 2012-10-02 "djvusmooth 0\&.2\&.13" "djvusmooth manual"
+.TH "DJVUSMOOTH" "1" 2013-02-21 "djvusmooth 0\&.2\&.14" "djvusmooth manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -69,7 +70,7 @@
correct occasional errors in the hidden text layer\&.
.RE
.sp
-.SH "ENVIRONMENT VARIABLES"
+.SH "ENVIRONMENT"
.PP
\fIXDG_CONFIG_HOME\fR
.RS 4
@@ -86,11 +87,12 @@
.RS 4
djvusmooth configuration file
.RE
-.SH "PORTABILITY"
+.SH "BUGS"
+.SS "Portability issues"
.PP
djvusmooth allows one to create hyperlinks with shadow borders as thin as 1 pixel, as specified by the
\m[blue]\fILizardtech DjVu Reference\fR\m[]\&\s-2\u[2]\d\s+2\&. However, some DjVu browsers do not accept shadow borders thinner than 3 pixels\&.
-.SH "REPORTING BUGS"
+.SS "Reporting bugs"
.PP
Please report bugs at:
\m[blue]\fI\%https://bitbucket.org/jwilk/djvusmooth/issues\fR\m[]
@@ -98,12 +100,6 @@
.PP
\fBdjvu\fR(1)
-.SH "AUTHOR"
-.PP
-\fBJakub Wilk\fR <\&jwilk@jwilk\&.net\&>
-.RS 4
-Author.
-.RE
.SH "NOTES"
.IP " 1." 4
XDG Base Directory Specification
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/doc/djvusmooth.xml new/djvusmooth-0.2.14/doc/djvusmooth.xml
--- old/djvusmooth-0.2.13/doc/djvusmooth.xml 2012-09-05 20:35:35.000000000 +0200
+++ new/djvusmooth-0.2.14/doc/djvusmooth.xml 2013-02-20 17:48:19.000000000 +0100
@@ -2,7 +2,7 @@
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN' 'http://www.docbook.org/xml/4.5/docbookx.dtd'
[
<!ENTITY p 'djvusmooth'>
- <!ENTITY version '0.2.13'>
+ <!ENTITY version '0.2.14'>
]>
<refentry>
@@ -47,7 +47,7 @@
</refsection>
<refsection>
- <title>Environment variables</title>
+ <title>Environment</title>
<variablelist>
<varlistentry>
<term><filename><varname>XDG_CONFIG_HOME</varname></filename></term>
@@ -78,20 +78,23 @@
</refsection>
<refsection>
- <title>Portability</title>
- <para>
- &p; allows one to create hyperlinks with shadow borders as thin as 1 pixel, as specified by the
- <ulink url='http://djvu.org/docs/DjVu3Spec.djvu'>Lizardtech DjVu Reference</ulink>.
- However, some DjVu browsers do not accept shadow borders thinner than 3 pixels.
- </para>
-</refsection>
-
-<refsection>
- <title>Reporting bugs</title>
- <para>
- Please report bugs at:
- <ulink url='https://bitbucket.org/jwilk/djvusmooth/issues'/>
- </para>
+ <title>Bugs</title>
+ <refsection>
+ <title>Portability issues</title>
+ <para>
+ &p; allows one to create hyperlinks with shadow borders as thin as 1 pixel, as specified by the
+ <ulink url='http://djvu.org/docs/DjVu3Spec.djvu'>Lizardtech DjVu Reference</ulink>.
+ However, some DjVu browsers do not accept shadow borders thinner than 3 pixels.
+ </para>
+ </refsection>
+
+ <refsection>
+ <title>Reporting bugs</title>
+ <para>
+ Please report bugs at:
+ <ulink url='https://bitbucket.org/jwilk/djvusmooth/issues'/>
+ </para>
+ </refsection>
</refsection>
<refsection>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/lib/__init__.py new/djvusmooth-0.2.14/lib/__init__.py
--- old/djvusmooth-0.2.13/lib/__init__.py 2012-09-05 20:35:35.000000000 +0200
+++ new/djvusmooth-0.2.14/lib/__init__.py 2013-02-20 17:48:19.000000000 +0100
@@ -1,2 +1,11 @@
-__version__ = '0.2.13'
+__version__ = '0.2.14'
__author__ = 'Jakub Wilk '
+
+import sys
+
+if sys.version_info < (2, 5):
+ raise RuntimeError('Python >= 2.5 is required')
+if sys.version_info >= (3, 0):
+ raise RuntimeError('Python 2.X is required')
+
+# vim:ts=4 sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/lib/config.py new/djvusmooth-0.2.14/lib/config.py
--- old/djvusmooth-0.2.13/lib/config.py 2012-06-27 23:29:54.000000000 +0200
+++ new/djvusmooth-0.2.14/lib/config.py 2012-10-09 21:17:21.000000000 +0200
@@ -76,6 +76,14 @@
self._data[key] = value
self._dirty = True
+ def del_array(self, key):
+ keys_to_delete = frozenset(
+ k for k in self._data
+ if k.startswith(key + '[')
+ )
+ for k in keys_to_delete:
+ del self._data[k]
+
def _load(self, path):
try:
file = open(path, 'r')
@@ -102,7 +110,7 @@
tmp_path = path + '.tmp'
file = open(tmp_path, 'w')
try:
- for key, value in self._data.iteritems():
+ for key, value in sorted(self._data.iteritems()):
if isinstance(value, unicode):
value = value.encode('UTF-8')
file.write('%s=%s\n' % (key, value))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/lib/external_editor.py new/djvusmooth-0.2.14/lib/external_editor.py
--- old/djvusmooth-0.2.13/lib/external_editor.py 2011-06-06 19:55:54.000000000 +0200
+++ new/djvusmooth-0.2.14/lib/external_editor.py 2013-02-21 22:01:45.000000000 +0100
@@ -1,5 +1,5 @@
# encoding=UTF-8
-# Copyright © 2008, 2009, 2011 Jakub Wilk
+# Copyright © 2008, 2009, 2011, 2013 Jakub Wilk
#
# This package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@
def read(self, n=-1):
self._reopen()
- return self.fp.read(s)
+ return self.fp.read(n)
def __iter__(self):
self._reopen()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/lib/gui/history.py new/djvusmooth-0.2.14/lib/gui/history.py
--- old/djvusmooth-0.2.13/lib/gui/history.py 1970-01-01 01:00:00.000000000 +0100
+++ new/djvusmooth-0.2.14/lib/gui/history.py 2012-10-09 20:26:33.000000000 +0200
@@ -0,0 +1,76 @@
+# encoding=UTF-8
+
+# Copyright © 2012 Jakub Wilk
+#
+# This package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 dated June, 1991.
+#
+# This package is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+import itertools
+
+import wx
+
+class FileHistory(object):
+
+ def __init__(self, config):
+ self._wx = wx.FileHistory()
+ self._config = config
+ to_add = []
+ for i in itertools.count(0):
+ key = 'recent[%d]' % i
+ path = config.read(key, None)
+ if path is None:
+ break
+ to_add += [path]
+ for path in reversed(to_add):
+ self._add(path)
+
+ def _add(self, path):
+ self._wx.AddFileToHistory(path)
+
+ def add(self, path):
+ self._add(path)
+ config = self._config
+ config.del_array('recent')
+ for n, path in enumerate(self):
+ config['recent[%d]' % n] = path
+ self._enable_menu_item()
+
+ def set_menu(self, window, menu_item, on_click):
+ menu = menu_item.GetSubMenu()
+ self._wx.UseMenu(menu)
+ self._wx.AddFilesToMenu()
+ self._menu_item = menu_item
+ id1 = wx.ID_FILE1
+ id2 = id1 + self._get_max_length()
+ def on_click_wrapper(event):
+ n = event.GetId() - wx.ID_FILE1
+ path = self[n]
+ return on_click(path)
+ window.Bind(wx.EVT_MENU_RANGE, on_click_wrapper, id=id1, id2=id2)
+ self._enable_menu_item()
+
+ def _enable_menu_item(self):
+ self._menu_item.Enable(enable=bool(self))
+
+ def __len__(self):
+ return self._wx.Count
+
+ def __iter__(self):
+ return (
+ self[n]
+ for n in xrange(len(self))
+ )
+
+ def __getitem__(self, n):
+ return self._wx.GetHistoryFile(n)
+
+ def _get_max_length(self):
+ return self._wx.GetMaxFiles()
+
+# vim:ts=4 sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/lib/gui/main.py new/djvusmooth-0.2.14/lib/gui/main.py
--- old/djvusmooth-0.2.13/lib/gui/main.py 2012-10-01 22:19:49.000000000 +0200
+++ new/djvusmooth-0.2.14/lib/gui/main.py 2013-02-21 22:11:12.000000000 +0100
@@ -1,5 +1,5 @@
# encoding=UTF-8
-# Copyright © 2008, 2009, 2010, 2011, 2012 Jakub Wilk
+# Copyright © 2008, 2009, 2010, 2011, 2012, 2013 Jakub Wilk
# Copyright © 2009 Mateusz Turcza
#
# This package is free software; you can redistribute it and/or modify
@@ -22,7 +22,6 @@
import locale
import os.path
import threading
-import tempfile
from Queue import Queue, Empty as QueueEmpty
import djvusmooth.dependencies as __dependencies
@@ -43,6 +42,7 @@
from djvusmooth.gui.text_browser import TextBrowser
from djvusmooth.gui.outline_browser import OutlineBrowser
from djvusmooth.gui.maparea_browser import MapAreaBrowser
+from djvusmooth.gui.history import FileHistory
from djvusmooth.gui import dialogs
from djvusmooth.text import mangle as text_mangle
import djvusmooth.models.metadata
@@ -57,7 +57,6 @@
from djvusmooth.i18n import _
MENU_ICON_SIZE = (16, 16)
-DJVU_WILDCARD = _('DjVu files (*.djvu, *.djv)|*.djvu;*.djv|All files|*')
WxDjVuMessage, wx.EVT_DJVU_MESSAGE = wx.lib.newevent.NewEvent()
@@ -69,8 +68,17 @@
class OpenDialog(wx.FileDialog):
+ __wildcard = _(
+ 'DjVu files (*.djvu, *.djv)|*.djvu;*.djv|'
+ 'All files|*'
+ )
+
def __init__(self, parent):
- wx.FileDialog.__init__(self, parent, style = wx.OPEN, wildcard=DJVU_WILDCARD, message = _('Open a DjVu document'))
+ wx.FileDialog.__init__(self, parent,
+ style=wx.OPEN,
+ wildcard=self.__wildcard,
+ message=_('Open a DjVu document')
+ )
class TextModel(models.text.Text):
@@ -276,15 +284,6 @@
class MainWindow(wx.Frame):
- def _menu_item(self, menu, caption, help, method, style = wx.ITEM_NORMAL, icon = None, id = wx.ID_ANY):
- item = wx.MenuItem(menu, id, caption, help, style)
- if icon is not None:
- bitmap = wx.ArtProvider_GetBitmap(icon, wx.ART_MENU, MENU_ICON_SIZE)
- item.SetBitmap(bitmap)
- self.Bind(wx.EVT_MENU, method, item)
- menu.AppendItem(item)
- return item
-
@apply
def default_xywh():
def get(self):
@@ -322,6 +321,14 @@
self._config['external_editor'] = value or ''
return property(get, set)
+ @apply
+ def default_open_dir():
+ def get(self):
+ return self._config.read('open_dir', '')
+ def set(self, value):
+ self._config['open_dir'] = value or ''
+ return property(get, set)
+
def save_defaults(self):
self._config.flush()
@@ -334,6 +341,9 @@
def __init__(self):
self._config = wx.GetApp().config
+ # The ._config attribute should not be accessed directly, but only
+ # via .default_* properties.
+ # Use .save_defaults() to save the config file.
x, y, w, h = self.default_xywh
wx.Frame.__init__(self, None, pos=(x, y), size=(w, h))
self.setup_external_editor()
@@ -373,12 +383,13 @@
sizer.Add(self.page_widget, 0, wx.ALL, 0)
self.editable_menu_items = []
self.saveable_menu_items = []
- self._setup_menu()
+ self.file_history = FileHistory(self._config)
+ self.create_menus()
self.dirty = False
self.do_open(None)
self.Bind(wx.EVT_CLOSE, self.on_exit)
- def _setup_menu(self):
+ def create_menus(self):
menu_bar = wx.MenuBar()
menu_bar.Append(self._create_file_menu(), _('&File'))
menu_bar.Append(self._create_edit_menu(), _('&Edit'))
@@ -388,40 +399,58 @@
menu_bar.Append(self._create_help_menu(), _('&Help'));
self.SetMenuBar(menu_bar)
+ def _create_menu_item(self, menu, caption, help, method, style=wx.ITEM_NORMAL, icon=None, id=wx.ID_ANY):
+ item = wx.MenuItem(menu, id, caption, help, style)
+ if icon is not None:
+ bitmap = wx.ArtProvider_GetBitmap(icon, wx.ART_MENU, MENU_ICON_SIZE)
+ item.SetBitmap(bitmap)
+ self.Bind(wx.EVT_MENU, method, item)
+ menu.AppendItem(item)
+ return item
+
def _create_file_menu(self):
menu = wx.Menu()
- self._menu_item(menu, _('&Open') + '\tCtrl+O', _('Open a DjVu document'), self.on_open, icon=wx.ART_FILE_OPEN)
- save_menu_item = self._menu_item(menu, _('&Save') + '\tCtrl+S', _('Save the document'), self.on_save, icon=wx.ART_FILE_SAVE)
- close_menu_item = self._menu_item(menu, _('&Close') + '\tCtrl+W', _('Close the document'), self.on_close, id=wx.ID_CLOSE)
+ menu_item = functools.partial(self._create_menu_item, menu)
+ menu_item(_('&Open') + '\tCtrl+O', _('Open a DjVu document'), self.on_open, icon=wx.ART_FILE_OPEN)
+ recent_menu = wx.Menu()
+ recent_menu_item = menu.AppendMenu(wx.ID_ANY, _('Open &recent'), recent_menu)
+ self.file_history.set_menu(self, recent_menu_item, self.do_open)
+ save_menu_item = menu_item(_('&Save') + '\tCtrl+S', _('Save the document'), self.on_save, icon=wx.ART_FILE_SAVE)
+ close_menu_item = menu_item(_('&Close') + '\tCtrl+W', _('Close the document'), self.on_close, id=wx.ID_CLOSE)
self.editable_menu_items += close_menu_item,
self.saveable_menu_items += save_menu_item,
menu.AppendSeparator()
- self._menu_item(menu, _('&Quit') + '\tCtrl+Q', _('Quit the application'), self.on_exit, icon=wx.ART_QUIT)
+ menu_item(_('&Quit') + '\tCtrl+Q', _('Quit the application'), self.on_exit, icon=wx.ART_QUIT)
return menu
def _create_edit_menu(self):
menu = wx.Menu()
- self._menu_item(menu, _('&Metadata') + '\tCtrl+M', _('Edit the document or page metadata'), self.on_edit_metadata)
+ menu_item = functools.partial(self._create_menu_item, menu)
+ menu_item(_('&Metadata') + '\tCtrl+M', _('Edit the document or page metadata'), self.on_edit_metadata)
submenu = wx.Menu()
- self._menu_item(submenu, _('&External editor') + '\tCtrl+T', _('Edit page text in an external editor'), self.on_external_edit_text)
- self._menu_item(submenu, _('&Flatten'), _('Remove details from page text'), self.on_flatten_text)
+ submenu_item = functools.partial(self._create_menu_item, submenu)
+ submenu_item(_('&External editor') + '\tCtrl+T', _('Edit page text in an external editor'), self.on_external_edit_text)
+ submenu_item(_('&Flatten'), _('Remove details from page text'), self.on_flatten_text)
menu.AppendMenu(wx.ID_ANY, _('&Text'), submenu)
submenu = wx.Menu()
- self._menu_item(submenu, _('&Bookmark this page') + '\tCtrl+B', _('Add the current to document outline'), self.on_bookmark_current_page)
- self._menu_item(submenu, _('&External editor'), _('Edit document outline in an external editor'), self.on_external_edit_outline)
- self._menu_item(submenu, _('&Remove all'), _('Remove whole document outline'), self.on_remove_outline)
+ submenu_item = functools.partial(self._create_menu_item, submenu)
+ submenu_item(_('&Bookmark this page') + '\tCtrl+B', _('Add the current to document outline'), self.on_bookmark_current_page)
+ submenu_item(_('&External editor'), _('Edit document outline in an external editor'), self.on_external_edit_outline)
+ submenu_item(_('&Remove all'), _('Remove whole document outline'), self.on_remove_outline)
menu.AppendMenu(wx.ID_ANY, _('&Outline'), submenu)
return menu
def _create_view_menu(self):
menu = wx.Menu()
+ menu_item = functools.partial(self._create_menu_item, menu)
submenu = wx.Menu()
+ submenu_item = functools.partial(self._create_menu_item, submenu)
for caption, help, method, id in \
[
(_('Zoom &in') + '\tCtrl++', _('Increase the magnification'), self.on_zoom_in, wx.ID_ZOOM_IN),
(_('Zoom &out') + '\tCtrl+-', _('Decrease the magnification'), self.on_zoom_out, wx.ID_ZOOM_OUT),
]:
- self._menu_item(submenu, caption, help, method, id = id or wx.ID_ANY)
+ submenu_item(caption, help, method, id=id)
submenu.AppendSeparator()
for caption, help, zoom, id in \
[
@@ -430,12 +459,12 @@
(_('&Stretch'), _('Stretch the image to the window size'), StretchZoom(), None),
(_('One &to one'), _('Set full resolution magnification.'), OneToOneZoom(), wx.ID_ZOOM_100),
]:
- self._menu_item(submenu, caption, help, self.on_zoom(zoom), style=wx.ITEM_RADIO, id = id or wx.ID_ANY)
+ id = id or wx.ID_ANY
+ submenu_item(caption, help, self.on_zoom(zoom), style=wx.ITEM_RADIO, id=id)
submenu.AppendSeparator()
self.zoom_menu_items = {}
for percent in 300, 200, 150, 100, 75, 50, 25:
- item = self._menu_item(
- submenu,
+ item = submenu_item(
'%d%%' % percent,
_('Magnify %d%%') % percent,
self.on_zoom(PercentZoom(percent)),
@@ -446,6 +475,7 @@
self.zoom_menu_items[percent] = item
menu.AppendMenu(wx.ID_ANY, _('&Zoom'), submenu)
submenu = wx.Menu()
+ submenu_item = functools.partial(self._create_menu_item, submenu)
for caption, help, method in \
[
(_('&Color') + '\tAlt+C', _('Display everything'), self.on_display_everything),
@@ -454,9 +484,10 @@
(_('&Background'), _('Display only the background layer'), self.on_display_background),
(_('&None') + '\tAlt+N', _('Neither display the foreground layer nor the background layer'), self.on_display_none)
]:
- self._menu_item(submenu, caption, help, method, style=wx.ITEM_RADIO)
+ submenu_item(caption, help, method, style=wx.ITEM_RADIO)
menu.AppendMenu(wx.ID_ANY, _('&Image'), submenu)
submenu = wx.Menu()
+ submenu_item = functools.partial(self._create_menu_item, submenu)
_tmp_items = []
for caption, help, method in \
[
@@ -464,16 +495,17 @@
(_('&Hyperlinks') + '\tAlt+H', _('Display overprinted annotations'), self.on_display_maparea),
(_('&Text') + '\tAlt+T', _('Display the text layer'), self.on_display_text),
]:
- _tmp_items += self._menu_item(submenu, caption, help, method, style=wx.ITEM_RADIO),
- self._menu_item_display_no_nonraster, self._menu_item_display_maparea, self._menu_item_display_text = _tmp_items
+ _tmp_items += [submenu_item(caption, help, method, style=wx.ITEM_RADIO)]
+ self.menu_item_display_no_nonraster, self.menu_item_display_maparea, self.menu_item_display_text = _tmp_items
del _tmp_items
- self._menu_item_display_no_nonraster.Check()
+ self.menu_item_display_no_nonraster.Check()
menu.AppendMenu(wx.ID_ANY, _('&Non-raster data'), submenu)
- self._menu_item(menu, _('&Refresh') + '\tCtrl+L', _('Refresh the window'), self.on_refresh)
+ menu_item(_('&Refresh') + '\tCtrl+L', _('Refresh the window'), self.on_refresh)
return menu
def _create_go_menu(self):
menu = wx.Menu()
+ menu_item = functools.partial(self._create_menu_item, menu)
for caption, help, method, icon in \
[
(_('&First page') + '\tCtrl-Home', _('Jump to first document page'), self.on_first_page, None),
@@ -482,20 +514,22 @@
(_('&Last page') + '\tCtrl-End', _('Jump to last document page'), self.on_last_page, None),
(_(u'&Go to page…') + '\tCtrl-G', _(u'Jump to page…'), self.on_goto_page, None)
]:
- self._menu_item(menu, caption, help, method, icon = icon)
+ menu_item(caption, help, method, icon=icon)
return menu
def _create_settings_menu(self):
menu = wx.Menu()
- sidebar_menu_item = self._menu_item(menu, _('Show &sidebar') + '\tF9', _('Show/hide the sidebar'), self.on_show_sidebar, style=wx.ITEM_CHECK)
+ menu_item = functools.partial(self._create_menu_item, menu)
+ sidebar_menu_item = menu_item(_('Show &sidebar') + '\tF9', _('Show/hide the sidebar'), self.on_show_sidebar, style=wx.ITEM_CHECK)
if self.default_sidebar_shown:
sidebar_menu_item.Check()
- self._menu_item(menu, _(u'External editor…'), _('Setup an external editor'), self.on_setup_external_editor)
+ menu_item(_(u'External editor…'), _('Setup an external editor'), self.on_setup_external_editor)
return menu
def _create_help_menu(self):
menu = wx.Menu()
- self._menu_item(menu, _('&About') + '\tF1', _('More information about this program'), self.on_about, id=wx.ID_ABOUT)
+ menu_item = functools.partial(self._create_menu_item, menu)
+ menu_item(_('&About') + '\tF1', _('More information about this program'), self.on_about, id=wx.ID_ABOUT)
return menu
def on_setup_external_editor(self, event):
@@ -560,10 +594,9 @@
def on_open(self, event):
dialog = OpenDialog(self)
- dialog.SetDirectory(self._config.read('open_dir', ''))
+ dialog.SetDirectory(self.default_open_dir)
try:
if dialog.ShowModal() == wx.ID_OK:
- self._config['open_dir'] = os.path.dirname(dialog.GetPath()) or ''
self.do_open(dialog.GetPath())
finally:
dialog.Destroy()
@@ -659,17 +692,17 @@
@skip_if_being_deleted
def on_display_text(self, event):
self.page_widget.render_nonraster = RENDER_NONRASTER_TEXT
- self._menu_item_display_text.Check()
+ self.menu_item_display_text.Check()
@skip_if_being_deleted
def on_display_maparea(self, event):
self.page_widget.render_nonraster = RENDER_NONRASTER_MAPAREA
- self._menu_item_display_maparea.Check()
+ self.menu_item_display_maparea.Check()
@skip_if_being_deleted
def on_display_no_nonraster(self, event):
self.page_widget.render_nonraster = None
- self._menu_item_display_no_nonraster.Check()
+ self.menu_item_display_no_nonraster.Check()
def on_refresh(self, event):
self.Refresh()
@@ -880,7 +913,9 @@
try:
rc = dialog.ShowModal()
if rc == wx.ID_YES:
- return self.do_save()
+ if not self.do_save():
+ return False
+ assert not self.dirty
elif rc == wx.ID_NO:
pass
elif rc == wx.ID_CANCEL:
@@ -897,6 +932,8 @@
if path is None:
clear_models()
else:
+ self.file_history.add(path)
+ self.default_open_dir = os.path.dirname(path)
try:
self.document = self.context.new_document(djvu.decode.FileURI(path))
self.metadata_model = MetadataModel(self.document)
@@ -950,8 +987,17 @@
self.SetTitle(title)
def on_about(self, event):
- message = '%(APPLICATION_NAME)s %(__version__)s\n' + _('Author') + ': %(__author__)s\n' + _('License') + ': %(LICENSE)s'
- message = message % globals()
+ message = (
+ '%(app)s %(version)s\n' +
+ _('Author') + ': %(author)s\n' +
+ _('License') + ': %(license)s'
+ )
+ message = message % dict(
+ app=APPLICATION_NAME,
+ version=__version__,
+ author=__author__,
+ license=LICENSE
+ )
wx.MessageBox(message = message, caption = _(u'About…'))
def handle_message(self, event):
@@ -1012,7 +1058,9 @@
window = MainWindow()
window.Show(True)
if argv:
- window.do_open(argv[0])
+ path = argv[0]
+ path = os.path.abspath(path)
+ window.do_open(path)
return self.MainLoop()
# vim:ts=4 sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/lib/gui/outline_browser.py new/djvusmooth-0.2.14/lib/gui/outline_browser.py
--- old/djvusmooth-0.2.13/lib/gui/outline_browser.py 2011-06-06 19:55:54.000000000 +0200
+++ new/djvusmooth-0.2.14/lib/gui/outline_browser.py 2013-02-21 22:08:12.000000000 +0100
@@ -1,5 +1,5 @@
# encoding=UTF-8
-# Copyright © 2008, 2009 Jakub Wilk
+# Copyright © 2008, 2009, 2010, 2011, 2013 Jakub Wilk
# Copyright © 2009 Mateusz Turcza
#
# This package is free software; you can redistribute it and/or modify
@@ -103,7 +103,10 @@
return # TODO: try to handle non-local URIs
def do_delete_node(self, node):
- node.delete()
+ try:
+ node.delete()
+ except NotImplementedError:
+ return
_WXK_TO_METHOD = {
wx.WXK_RETURN: do_goto_node,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/lib/models/outline.py new/djvusmooth-0.2.14/lib/models/outline.py
--- old/djvusmooth-0.2.13/lib/models/outline.py 2011-06-06 19:55:54.000000000 +0200
+++ new/djvusmooth-0.2.14/lib/models/outline.py 2013-02-20 17:53:38.000000000 +0100
@@ -1,5 +1,5 @@
# encoding=UTF-8
-# Copyright © 2008, 2009 Jakub Wilk
+# Copyright © 2008, 2009, 2012 Jakub Wilk
#
# This package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Files old/djvusmooth-0.2.13/locale/es/LC_MESSAGES/djvusmooth.mo and new/djvusmooth-0.2.14/locale/es/LC_MESSAGES/djvusmooth.mo differ
Files old/djvusmooth-0.2.13/locale/pl/LC_MESSAGES/djvusmooth.mo and new/djvusmooth-0.2.14/locale/pl/LC_MESSAGES/djvusmooth.mo differ
Files old/djvusmooth-0.2.13/locale/ru/LC_MESSAGES/djvusmooth.mo and new/djvusmooth-0.2.14/locale/ru/LC_MESSAGES/djvusmooth.mo differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/po/es.po new/djvusmooth-0.2.14/po/es.po
--- old/djvusmooth-0.2.13/po/es.po 2012-09-05 20:35:35.000000000 +0200
+++ new/djvusmooth-0.2.14/po/es.po 2013-02-21 10:46:31.000000000 +0100
@@ -3,13 +3,13 @@
# This file is distributed under the same license as the djvusmooth package.
msgid ""
msgstr ""
-"Project-Id-Version: djvusmooth 0.2.13\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-23 18:36+0200\n"
+"Project-Id-Version: djvusmooth 0.2.14\n"
+"Report-Msgid-Bugs-To: Jakub Wilk \n"
+"POT-Creation-Date: 2013-02-20 17:57+0100\n"
"PO-Revision-Date: 2012-05-21 00:20-0500\n"
"Last-Translator: C. Daniel Sanchez R. \n"
"Language-Team: \n"
-"Language: Spanish\n"
+"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -319,6 +319,9 @@
msgid "Opacity"
msgstr "Opacidad"
+msgid "Open &recent"
+msgstr "Abrir &reciente"
+
msgid "Open a DjVu document"
msgstr "Abrir un documento DjVu"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/po/pl.po new/djvusmooth-0.2.14/po/pl.po
--- old/djvusmooth-0.2.13/po/pl.po 2012-09-05 20:35:35.000000000 +0200
+++ new/djvusmooth-0.2.14/po/pl.po 2013-02-20 18:00:28.000000000 +0100
@@ -3,10 +3,10 @@
# This file is distributed under the same license as the djvusmooth package.
msgid ""
msgstr ""
-"Project-Id-Version: djvusmooth 0.2.13\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-23 18:36+0200\n"
-"PO-Revision-Date: 2009-05-31 14:45+CEST\n"
+"Project-Id-Version: djvusmooth 0.2.14\n"
+"Report-Msgid-Bugs-To: Jakub Wilk \n"
+"POT-Creation-Date: 2013-02-20 17:57+0100\n"
+"PO-Revision-Date: 2012-10-09 20:41+0200\n"
"Last-Translator: Jakub Wilk \n"
"Language-Team: none\n"
"Language: pl\n"
@@ -319,6 +319,9 @@
msgid "Opacity"
msgstr "Przezroczystość"
+msgid "Open &recent"
+msgstr "Ostatnio otwie&rane"
+
msgid "Open a DjVu document"
msgstr "Otwórz dokument DjVu"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/po/ru.po new/djvusmooth-0.2.14/po/ru.po
--- old/djvusmooth-0.2.13/po/ru.po 2012-09-05 20:35:35.000000000 +0200
+++ new/djvusmooth-0.2.14/po/ru.po 2013-02-21 15:43:17.000000000 +0100
@@ -2,13 +2,14 @@
# Copyright © 2010 Kyrill Detinov
# This file is distributed under the same license as the djvusmooth package.
# Kyrill Detinov , 2010.
+# Kyrill Detinov , 2011, 2012, 2013.
#
msgid ""
msgstr ""
-"Project-Id-Version: djvusmooth 0.2.13\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-23 18:36+0200\n"
-"PO-Revision-Date: 2012-06-13 10:33+0300\n"
+"Project-Id-Version: djvusmooth 0.2.14\n"
+"Report-Msgid-Bugs-To: Jakub Wilk \n"
+"POT-Creation-Date: 2013-02-20 17:57+0100\n"
+"PO-Revision-Date: 2013-02-21 18:33+0300\n"
"Last-Translator: Kyrill Detinov \n"
"Language-Team: openSUSE Translation Team\n"
"Language: ru\n"
@@ -321,6 +322,9 @@
msgid "Opacity"
msgstr "Прозрачность"
+msgid "Open &recent"
+msgstr "&Недавние файлы"
+
msgid "Open a DjVu document"
msgstr "Открыть DjVu документ"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/private/update-i18n new/djvusmooth-0.2.14/private/update-i18n
--- old/djvusmooth-0.2.13/private/update-i18n 1970-01-01 01:00:00.000000000 +0100
+++ new/djvusmooth-0.2.14/private/update-i18n 2013-02-20 20:45:54.000000000 +0100
@@ -0,0 +1,39 @@
+#!/usr/bin/make -f
+
+# Copyright © 2009, 2011, 2012 Jakub Wilk
+#
+# This package is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 dated June, 1991.
+
+project_name = $(shell head -n1 doc/changelog | cut -d' ' -f1)
+project_version = $(shell head -n1 doc/changelog | sed -n -e 's/.*(\([0-9.]\+\)).*/\1/ p')
+bugs_address = $(shell sed -n -e '/ -- \(.*\) .*/ {s//\1/p;q}' doc/changelog)
+
+po_files = $(wildcard po/*.po)
+mo_files = $(patsubst po/%.po,locale/%/LC_MESSAGES/$(project_name).mo,$(po_files))
+source_files = $(shell find -name '*.py' -o -name 'build' -prune -a -false)
+
+xgettext_options = \
+ --language=python \
+ --keyword=_ --keyword=N_ \
+ --package-name=$(project_name) \
+ --package-version=$(project_version) \
+ --msgid-bugs-address='$(bugs_address)' \
+ --no-location \
+ --sort-output
+
+.PHONY: all
+
+all: po/$(project_name).pot $(po_files) $(mo_files)
+
+po/$(project_name).pot: $(source_files)
+ xgettext $(xgettext_options) $(source_files) -o $(@)
+
+%.po: po/$(project_name).pot
+ msgmerge --no-wrap -o $(@) $(@) $(<)
+
+locale/%/LC_MESSAGES/$(project_name).mo: po/%.po
+ python setup.py build_mo
+
+# vim:ts=4 sw=4 noet
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/private/update-version new/djvusmooth-0.2.14/private/update-version
--- old/djvusmooth-0.2.13/private/update-version 1970-01-01 01:00:00.000000000 +0100
+++ new/djvusmooth-0.2.14/private/update-version 2013-02-20 20:46:28.000000000 +0100
@@ -0,0 +1,8 @@
+#!/bin/sh
+version=${1:?"no version number provided"}
+set -e
+set -x
+dch -m -v "$version" -c doc/changelog
+sed -i -r -e "s/^(__version__) = '[0-9.]+'$/\1 = '$version'/" lib/__init__.py
+sed -i -r -e "s/<(!ENTITY version) '[0-9.]+'>/<\1 '$version'>/" doc/*.xml
+sed -i -r -e "s/^(\"Project-Id-Version: djvusmooth) ([0-9.]+)/\1 $version/" po/*.po po/*.pot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/setup.py new/djvusmooth-0.2.14/setup.py
--- old/djvusmooth-0.2.13/setup.py 2012-03-29 22:41:49.000000000 +0200
+++ new/djvusmooth-0.2.14/setup.py 2013-02-21 22:00:47.000000000 +0100
@@ -1,6 +1,6 @@
#!/usr/bin/python
# encoding=UTF-8
-# Copyright © 2008, 2009, 2010, 2011, 2012 Jakub Wilk
+# Copyright © 2008, 2009, 2010, 2011, 2012, 2013 Jakub Wilk
#
# This package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,12 +32,11 @@
import glob
import os
import re
-import subprocess as ipc
import distutils.core
import distutils.errors
from distutils.command.build import build as distutils_build
-from distutils.command.check import check as distutils_check
+from distutils.command.clean import clean as distutils_clean
from distutils.command.sdist import sdist as distutils_sdist
from lib import __version__
@@ -126,6 +125,7 @@
manname = os.path.splitext(xmlname)[0] + '.1'
command = [
'xsltproc', '--nonet',
+ '--param', 'man.authors.section.enabled', '0',
'--param', 'man.charmap.use.subset', '0',
'--param', 'man.font.links', '"I"',
'--output', 'doc/',
@@ -140,14 +140,41 @@
('build_mo', None)
]
+class clean(distutils_clean):
+
+ def run(self):
+ distutils_clean.run(self)
+ if not self.all:
+ return
+ for manname in glob.glob(os.path.join('doc', '*.1')):
+ with open(manname, 'r') as file:
+ stamp = file.readline()
+ if stamp != sdist.manpage_stamp:
+ self.execute(os.unlink, [manname], 'removing %s' % manname)
+
class sdist(distutils_sdist):
+ manpage_stamp = '''.\\" [created by setup.py sdist]\n'''
+
def run(self):
self.run_command('build_doc')
self.run_command('check_po')
self.run_command('build_mo')
return distutils_sdist.run(self)
+ def _rewrite_manpage(self, manname):
+ with open(manname, 'r') as file:
+ contents = file.read()
+ os.unlink(manname)
+ with open(manname, 'w') as file:
+ file.write(self.manpage_stamp)
+ file.write(contents)
+
+ def make_release_tree(self, base_dir, files):
+ distutils_sdist.make_release_tree(self, base_dir, files)
+ for manname in glob.glob(os.path.join(base_dir, 'doc', '*.1')):
+ self.execute(self._rewrite_manpage, [manname], 'rewriting %s' % manname)
+
distutils.core.setup(
name = 'djvusmooth',
version = __version__,
@@ -163,10 +190,11 @@
scripts = ['djvusmooth'],
data_files = data_files,
cmdclass = dict(
- sdist=sdist,
build_doc=build_doc,
build_mo=build_mo,
check_po=check_po,
+ clean=clean,
+ sdist=sdist,
),
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/djvusmooth-0.2.13/update-i18n new/djvusmooth-0.2.14/update-i18n
--- old/djvusmooth-0.2.13/update-i18n 2012-10-01 21:31:36.000000000 +0200
+++ new/djvusmooth-0.2.14/update-i18n 1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-#!/usr/bin/make -f
-
-# Copyright © 2009, 2011, 2012 Jakub Wilk
-#
-# This package is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 dated June, 1991.
-
-PROJECT_NAME = $(shell head -n1 doc/changelog | cut -d' ' -f1)
-PROJECT_VERSION = $(shell head -n1 doc/changelog | sed -n -e 's/.*(\([0-9.]\+\)).*/\1/ p')
-
-PO_FILES = $(wildcard po/*.po)
-MO_FILES = $(patsubst po/%.po,locale/%/LC_MESSAGES/$(PROJECT_NAME).mo,$(PO_FILES))
-SOURCE_FILES = $(shell find -name '*.py' -o -name 'build' -prune -a -false)
-
-XGETTEXT_OPTIONS = \
- --language=python \
- --keyword=_ --keyword=N_ \
- --package-name=$(PROJECT_NAME) \
- --package-version=$(PROJECT_VERSION) \
- --no-location \
- --sort-output
-
-.PHONY: all
-
-all: po/$(PROJECT_NAME).pot $(PO_FILES) $(MO_FILES)
-
-po/$(PROJECT_NAME).pot: $(SOURCE_FILES)
- xgettext $(XGETTEXT_OPTIONS) $(SOURCE_FILES) -o $(@)
-
-%.po: po/$(PROJECT_NAME).pot
- msgmerge --no-wrap -o $(@) $(@) $(<)
-
-locale/%/LC_MESSAGES/$(PROJECT_NAME).mo: po/%.po
- python setup.py build_mo
-
-# vim:ts=4 sw=4 noet
++++++ djvusmooth.keyring ++++++
pub 4096R/015475F5 2009-10-23 [expires: 2014-01-01]
uid Jakub Wilk
uid Jakub Wilk
uid Jakub Wilk
sub 4096R/E5874F63 2009-10-23
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBEriG80BEADRWluqqGiV3JDkqAJvLcd8GpdJ1ILAeVceR0rWENpVP8f8qLp+
d423rMEd2M5IagCngKUhTDt7zylCttRulUzde2VrhFSX+LsVaOhZrDTLjzdxOKZJ
W6sDBUbEhZA9O40sC7wOc60On7SIbAHewOiVlSSzrpuaNOcmeFqxxqXnl03a13ip
Jj8BYlkTGtpWK5eAxcl8Tnu8zuxwlXjJ6CANmYnctA/JOwDVr86Vqx7We46yCt6T
+uE1f/6qdV9yzPG4sCJOcCe2nr52W0drqcm4AV03MRf5Gfyk0q6ZcyoNiZGMbmP0
87pvkC14YQuelPnucUpT29zuZdJDlnl0nxk7MG77S7TafBrJii4cd1UIvbbfti0s
e3S6xuW5VG2VmkN7tIGrVxt4f+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Xmyhk6bMDI1f6q2/FOgSpLlx0oZLdAF84PMY+
Wtm/IZLktEhGNeiXDM7aUBs15g8537vdbHtf2LVqK0IfBlkQyVoE/VGRLX//yHxq
bEoshbm0JmRRsOqceIOn/d3swsA7pFVgXrfX51ruB213BA8O0lj8E3ALntT3vzut
FdkpXG/sZpj2pVDVj5EGtYDrxC03Pz0q0T5SaWeIIkSCgvrfztDBy+354qjZABEB
AAGJAh8EGAEIAAkFAkriG80CGwwACgkQLU6zpgFUdfW31xAAyILZ5+iaI6MBhjrm
MlwwK5msz3Xd8ariPXyzqMOlBW6+ZkzTwrg0v5xct72mNFwMJZ+Fcb8u+dPPL1rj
7MYFWLNTZXMvKbicqQcV7FkwPUev1yb5mQsuxGmpUIGCdUSlVcmATF4BMvwmUI+I
VQwAB590JCgQ85OAh3PY2O+2x0iRpHmpvCWCF9gHlDA67B+Eb60ZqQTp3fWh2zmV
AT2Jf0nT2HJuL35sV/yLOoeK20nkU7D5p9LuzW+YIjqkrf825J3Arjw+B/jfGM9x
Y3+rRlvW9i+AVAMcnS4qp499076Z7hgyMWHXZv+mpkbY4fc5u89DxMZ1zuBops8d
+mor3wfTotaetE664mv5I1UeI46c/2ndLubYIVMiZTSqB6uJXhjI+MaPBA9sLGa+
b6cz29/5WkWj3rc/89vrES5HUqNBbOCXiD1Rbv2B3fv4u+Hf/q2+Ci1giVV2VLaX
OuuWKoE7jQ7fH1Wl5YmFk998CaKaXiVeeo7aTfi3pZqkjsGAMIWCkYzszGFZFm8O
doynJ60razRgyqz9/UJ77+2wn50YVJutP44WiP5NF9ELufGkDo9/r/DfknlIS5py
c55t4YjFjD6M2V8oO8pHuQ2TO14TkX629hChBlVCQQBUSU07toQ3iDw5umCFH7To
bN5AxyPui0i3KQXs09FW/+n9DTw=
=AA/F
-----END PGP PUBLIC KEY BLOCK-----
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org