diff options
author | Michal Čihař <michal@cihar.com> | 2017-11-08 08:55:32 +0100 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2017-11-08 08:55:32 +0100 |
commit | 07364c9d1d7b3b196bf9f9a9657ebd1444061d28 (patch) | |
tree | 830be3a19e432391340efc46599b9696d7718280 | |
parent | 607f311106f8d7a53026c356d8d594192947e35a (diff) | |
parent | 028e33f8d092c9b93c046db8662693f5205e8576 (diff) |
Update upstream source from tag 'upstream/1.2'
Update to upstream version '1.2'
with Debian dir 072181e53506a0106504751a5063a5acfb60c265
-rw-r--r-- | NEWS.rst | 18 | ||||
-rw-r--r-- | PKG-INFO | 3 | ||||
-rwxr-xr-x | cizislova_tarball.sh | 16 | ||||
-rwxr-xr-x | slovnik_de_tarball.sh | 2 | ||||
-rwxr-xr-x | slovnik_tarball.sh | 2 | ||||
-rw-r--r-- | stardicter.egg-info/PKG-INFO | 3 | ||||
-rw-r--r-- | stardicter/__init__.py | 2 | ||||
-rw-r--r-- | stardicter/base.py | 5 | ||||
-rw-r--r-- | stardicter/czech.py | 4 | ||||
-rw-r--r-- | stardicter/test_base.py | 7 | ||||
-rw-r--r-- | stardicter/test_dictsinfo.py | 3 |
11 files changed, 55 insertions, 10 deletions
@@ -1,6 +1,24 @@ Changes in stardicter ===================== +Version 1.2 +----------- + +* Added option to skip network based tests. +* Build is now reproducible. + +Version 1.1 +----------- + +* Fixed installation on systems with non utf-8 locale. + +Version 1.0 +----------- + +* Various cleanups for first stable release. +* Fixed generating of README for dictionaries. +* Added support for generating source tarballs. + Version 0.11 ------------ @@ -1,12 +1,13 @@ Metadata-Version: 1.1 Name: stardicter -Version: 1.1 +Version: 1.2 Summary: Conversion tools from various formats to StarDict. Home-page: https://cihar.com/software/slovnik/ Author: Michal Čihař Author-email: michal@cihar.com License: GPLv3+ Download-URL: https://pypi.python.org/pypi/stardicter +Description-Content-Type: UNKNOWN Description: Stardicter ========== diff --git a/cizislova_tarball.sh b/cizislova_tarball.sh index eb9380d..97cb2f7 100755 --- a/cizislova_tarball.sh +++ b/cizislova_tarball.sh @@ -20,6 +20,7 @@ set -e NAME=stardict-czech dir="$NAME-`date +%Y%m%d`" +dirs="$dir-source" if [ "x$1" = 'x--wrap' ] ; then WRAP="$2" @@ -29,7 +30,7 @@ fi rm -rf $dir mkdir $dir -$WRAP ./sdgen.py --change --directory $dir "$@" czech +$WRAP ./sdgen.py --change --write-source --directory $dir "$@" czech if [ ! -f $dir/README ] ; then rm -rf $dir @@ -39,6 +40,15 @@ fi # Compress dictzip $dir/*.dict -# Create tarball +# Split to separate dirs +rm -rf $dirs +mkdir $dirs + +cp $dir/README $dirs/ + +mv $dir/czech.txt $dirs/ + +# Create tarballs tar --owner=root --group=root --numeric-owner -czf $dir.tar.gz $dir -rm -rf $dir +tar --owner=root --group=root --numeric-owner -czf $dirs.tar.gz $dirs +rm -rf $dir $dirs diff --git a/slovnik_de_tarball.sh b/slovnik_de_tarball.sh index 8343c83..18ecd5b 100755 --- a/slovnik_de_tarball.sh +++ b/slovnik_de_tarball.sh @@ -65,5 +65,5 @@ tar --owner=root --group=root --numeric-owner -czf $dir.tar.gz $dir tar --owner=root --group=root --numeric-owner -czf $dira.tar.gz $dira tar --owner=root --group=root --numeric-owner -czf $dirn.tar.gz $dirn tar --owner=root --group=root --numeric-owner -czf $diran.tar.gz $diran -tar --owner=root --group=root --numeric-owner -czf $dirs.tar.gz $dirn +tar --owner=root --group=root --numeric-owner -czf $dirs.tar.gz $dirs rm -rf $dir $dira $dirn $diran $dirs diff --git a/slovnik_tarball.sh b/slovnik_tarball.sh index 5e574ff..0ea82b2 100755 --- a/slovnik_tarball.sh +++ b/slovnik_tarball.sh @@ -65,5 +65,5 @@ tar --owner=root --group=root --numeric-owner -czf $dir.tar.gz $dir tar --owner=root --group=root --numeric-owner -czf $dira.tar.gz $dira tar --owner=root --group=root --numeric-owner -czf $dirn.tar.gz $dirn tar --owner=root --group=root --numeric-owner -czf $diran.tar.gz $diran -tar --owner=root --group=root --numeric-owner -czf $dirs.tar.gz $dirn +tar --owner=root --group=root --numeric-owner -czf $dirs.tar.gz $dirs rm -rf $dir $dira $dirn $diran $dirs diff --git a/stardicter.egg-info/PKG-INFO b/stardicter.egg-info/PKG-INFO index 5a2f3bf..12dc31c 100644 --- a/stardicter.egg-info/PKG-INFO +++ b/stardicter.egg-info/PKG-INFO @@ -1,12 +1,13 @@ Metadata-Version: 1.1 Name: stardicter -Version: 1.1 +Version: 1.2 Summary: Conversion tools from various formats to StarDict. Home-page: https://cihar.com/software/slovnik/ Author: Michal Čihař Author-email: michal@cihar.com License: GPLv3+ Download-URL: https://pypi.python.org/pypi/stardicter +Description-Content-Type: UNKNOWN Description: Stardicter ========== diff --git a/stardicter/__init__.py b/stardicter/__init__.py index b02329b..c6d6b7d 100644 --- a/stardicter/__init__.py +++ b/stardicter/__init__.py @@ -38,4 +38,4 @@ DICTIONARIES = { # Register deaccenting codec codecs.register_error('deaccent', deaccent) -__version__ = '1.1' +__version__ = '1.2' diff --git a/stardicter/base.py b/stardicter/base.py index 64dd17f..3d2a8a0 100644 --- a/stardicter/base.py +++ b/stardicter/base.py @@ -30,6 +30,7 @@ from operator import attrgetter import os import re import struct +import time from six.moves.urllib.request import urlopen from six import BytesIO @@ -386,7 +387,9 @@ class StardictWriter(object): handle.write(self.convert('website={0}\n'.format(URL), False)) # we're using pango markup for all entries handle.write('sametypesequence=g\n') - handle.write(datetime.date.today().strftime('date=%Y.%m.%d\n')) + now = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) + today = datetime.datetime.utcfromtimestamp(now) + handle.write(today.strftime('date=%Y.%m.%d\n')) def write_dict(self, directory): ''' diff --git a/stardicter/czech.py b/stardicter/czech.py index 8f07d15..89c5268 100644 --- a/stardicter/czech.py +++ b/stardicter/czech.py @@ -39,3 +39,7 @@ class CzechWriter(StardictWriter): def parse_line(self, line): word, pronunciation, explanation = line.split('|') return [Word(word, explanation, pronunciation=pronunciation)] + + def get_source_name(self): + """Name for source file.""" + return 'czech.txt' diff --git a/stardicter/test_base.py b/stardicter/test_base.py index f44f0b0..69ae1c9 100644 --- a/stardicter/test_base.py +++ b/stardicter/test_base.py @@ -21,7 +21,7 @@ import unittest import tempfile -import os.path +import os import shutil import stardicter.base @@ -29,10 +29,15 @@ import stardicter.base class BaseTest(unittest.TestCase): writer_class = stardicter.base.StardictWriter + def skip_net(self): + if 'SKIP_NET_TESTS' in os.environ: + raise unittest.SkipTest('Network tests disabled') + def get_writer(self): ''' Gets prepared writer class. ''' + self.skip_net() return self.writer_class() def test_write(self): diff --git a/stardicter/test_dictsinfo.py b/stardicter/test_dictsinfo.py index 01cad1f..095f9b1 100644 --- a/stardicter/test_dictsinfo.py +++ b/stardicter/test_dictsinfo.py @@ -30,6 +30,7 @@ class DictsInfoTest(BaseTest): ''' Gets prepared writer class. ''' + self.skip_net() return self.writer_class( source='english', target='czech', @@ -39,6 +40,7 @@ class DictsInfoTest(BaseTest): ''' Test for invalid code. ''' + self.skip_net() writer = self.writer_class( source='english', target='invalid', @@ -53,6 +55,7 @@ class DictsInfoTest(BaseTest): ''' Test for same languages. ''' + self.skip_net() writer = self.writer_class( source='english', target='english', |