Commit e2b13b2c authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 0.2.19

parent 3e2547c4
include COPYING
include MANIFEST.in
include djvusmooth edit-text
include djvusmooth.py
......
Metadata-Version: 1.1
Name: djvusmooth
Version: 0.2.18
Version: 0.2.19
Summary: graphical editor for DjVu
Home-page: http://jwilk.net/software/djvusmooth
Author: Jakub Wilk
......
djvusmooth (0.2.19) unstable; urgency=low
* Create temporary files in a subdirectory of /tmp.
This is necessary, because some editors can't securely open files
directly in /tmp.
-- Jakub Wilk <jwilk@jwilk.net> Sat, 16 Sep 2017 17:05:51 +0200
djvusmooth (0.2.18) unstable; urgency=low
* Improve the setup script:
......
......@@ -3,12 +3,12 @@
.\" Title: djvusmooth
.\" Author: Jakub Wilk <jwilk@jwilk.net>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 11/20/2016
.\" Date: 09/16/2017
.\" Manual: djvusmooth manual
.\" Source: djvusmooth 0.2.18
.\" Source: djvusmooth 0.2.19
.\" Language: English
.\"
.TH "DJVUSMOOTH" "1" 2016\-11\-20 "djvusmooth 0\&.2\&.18" "djvusmooth manual"
.TH "DJVUSMOOTH" "1" 2017\-09\-16 "djvusmooth 0\&.2\&.19" "djvusmooth manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
......
......@@ -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.18'>
<!ENTITY version '0.2.19'>
]>
<refentry>
......
__version__ = '0.2.18'
__author__ = 'Jakub Wilk <jwilk@jwilk.net>'
import sys
if sys.version_info < (2, 6):
......@@ -8,4 +5,7 @@ if sys.version_info < (2, 6):
if sys.version_info >= (3, 0):
raise RuntimeError('Python 2.X is required')
__version__ = '0.2.19'
__author__ = 'Jakub Wilk <jwilk@jwilk.net>'
# vim:ts=4 sts=4 sw=4 et
# encoding=UTF-8
# Copyright © 2008-2015 Jakub Wilk <jwilk@jwilk.net>
# Copyright © 2008-2017 Jakub Wilk <jwilk@jwilk.net>
#
# This file is part of djvusmooth.
#
......@@ -14,19 +14,21 @@
# more details.
import os.path
import shutil
import subprocess
import tempfile
class temporary_file(object):
def __init__(self, suffix='', prefix='tmp', dir=None, text=False):
fd, self.name = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir, text=text)
self.mode = 'r+' + 'bt'[bool(text)]
self.fp = os.fdopen(fd, self.mode)
def __init__(self, name):
self.dir = self.fp = None
self.dir = tempfile.mkdtemp(prefix='djvusmooth.')
self.name = os.path.join(self.dir, name)
self.fp = open(self.name, 'w+')
def _reopen(self):
if self.fp is None:
self.fp = open(self.name, self.mode)
self.fp = open(self.name, 'r+')
def flush(self):
if self.fp is None:
......@@ -35,11 +37,11 @@ class temporary_file(object):
self.fp = None
def close(self):
if self.name is None:
if self.dir is None:
return
self.flush()
os.remove(self.name)
self.name = None
shutil.rmtree(self.dir)
self.dir = None
def seek(self, offset, whence=0):
self._reopen()
......
......@@ -14,9 +14,6 @@
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
APPLICATION_NAME = 'djvusmooth'
LICENSE = 'GPL-2'
import sys
import itertools
import functools
......@@ -57,6 +54,9 @@ from djvusmooth import __version__, __author__
from djvusmooth.i18n import _
APPLICATION_NAME = 'djvusmooth'
LICENSE = 'GPL-2'
MENU_ICON_SIZE = (16, 16)
WxDjVuMessage, wx.EVT_DJVU_MESSAGE = wx.lib.newevent.NewEvent()
......@@ -800,7 +800,7 @@ class MainWindow(wx.Frame):
def job(disabler):
new_repr = None
try:
with external_editor.temporary_file(suffix='.txt') as tmp_file:
with external_editor.temporary_file('outline.txt') as tmp_file:
model.export_as_plaintext(tmp_file)
tmp_file.flush()
self.external_editor(tmp_file.name)
......@@ -836,7 +836,7 @@ class MainWindow(wx.Frame):
def job(disabler):
new_sexpr = None
try:
with external_editor.temporary_file(suffix='.txt') as tmp_file:
with external_editor.temporary_file('text.txt') as tmp_file:
text_mangle.export(sexpr, tmp_file)
tmp_file.flush()
self.external_editor(tmp_file.name)
......
......@@ -124,7 +124,7 @@ def fix_uri(s):
s = s.encode('UTF-8')
return quote(s, safe=URI_SPECIAL_CHARACTERS)
replace_control_characters = re.compile('[\0-\x1f]+').sub
replace_control_characters = re.compile('[\0-\x1F]+').sub
_is_html_color = re.compile('^[#][0-9a-fA-F]{6}$').match
......
......@@ -3,7 +3,7 @@
# This file is distributed under the same license as the djvusmooth package.
msgid ""
msgstr ""
"Project-Id-Version: djvusmooth 0.2.18\n"
"Project-Id-Version: djvusmooth 0.2.19\n"
"Report-Msgid-Bugs-To: Jakub Wilk <jwilk@jwilk.net>\n"
"POT-Creation-Date: 2015-09-15 10:51+0200\n"
"PO-Revision-Date: 2012-05-21 00:20-0500\n"
......
......@@ -3,7 +3,7 @@
# This file is distributed under the same license as the djvusmooth package.
msgid ""
msgstr ""
"Project-Id-Version: djvusmooth 0.2.18\n"
"Project-Id-Version: djvusmooth 0.2.19\n"
"Report-Msgid-Bugs-To: Jakub Wilk <jwilk@jwilk.net>\n"
"POT-Creation-Date: 2015-09-15 10:51+0200\n"
"PO-Revision-Date: 2012-10-09 20:41+0200\n"
......
......@@ -6,7 +6,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: djvusmooth 0.2.18\n"
"Project-Id-Version: djvusmooth 0.2.19\n"
"Report-Msgid-Bugs-To: Jakub Wilk <jwilk@jwilk.net>\n"
"POT-Creation-Date: 2015-09-15 10:51+0200\n"
"PO-Revision-Date: 2013-02-21 18:33+0300\n"
......
......@@ -19,7 +19,7 @@ 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)
source_files = $(shell find . -name '*.py' -o -name 'build' -prune -a -false)
gettext_common_options = \
--add-location=file \
......
......@@ -3,6 +3,6 @@ version=${1:?"no version number provided"}
set -e
set -x
dch -m -v "$version" -u low -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
sed -i -E -e "s/^(__version__) = '[0-9.]+'$/\1 = '$version'/" lib/__init__.py
sed -i -E -e "s/<(!ENTITY version) '[0-9.]+'>/<\1 '$version'>/" doc/*.xml
sed -i -E -e "s/^(\"Project-Id-Version: djvusmooth) ([0-9.]+)/\1 $version/" po/*.po po/*.pot
......@@ -22,20 +22,6 @@ from __future__ import with_statement
# supported, so that people running setup.py against the unsupported version
# get a nice error message instead of SyntaxError.
classifiers = '''
Development Status :: 4 - Beta
Environment :: X11 Applications :: GTK
Intended Audience :: End Users/Desktop
License :: OSI Approved :: GNU General Public License (GPL)
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Topic :: Text Processing
Topic :: Multimedia :: Graphics
'''.strip().splitlines()
import glob
import os
import re
......@@ -46,6 +32,13 @@ from distutils.command.build import build as distutils_build
from distutils.command.clean import clean as distutils_clean
from distutils.command.sdist import sdist as distutils_sdist
try:
import distutils644
except ImportError:
pass
else:
distutils644.install()
from lib import __version__
data_files = []
......@@ -177,10 +170,31 @@ class sdist(distutils_sdist):
file.write(self.manpage_stamp)
file.write(contents)
def _maybe_move_file(self, base_dir, src, dst):
src = os.path.join(base_dir, src)
dst = os.path.join(base_dir, dst)
if os.path.exists(src):
self.move_file(src, dst)
def make_release_tree(self, base_dir, files):
distutils_sdist.make_release_tree(self, base_dir, files)
for manname in glob.iglob(os.path.join(base_dir, 'doc', '*.1')):
self.execute(self._rewrite_manpage, [manname], 'rewriting {0}'.format(manname))
self._maybe_move_file(base_dir, 'COPYING', 'doc/COPYING')
classifiers = '''
Development Status :: 4 - Beta
Environment :: X11 Applications :: GTK
Intended Audience :: End Users/Desktop
License :: OSI Approved :: GNU General Public License (GPL)
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Topic :: Text Processing
Topic :: Multimedia :: Graphics
'''.strip().splitlines()
distutils.core.setup(
name='djvusmooth',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment