[Python-modules-commits] [parsedatetime] 01/01: Revert all changes since debian/2.1-3

Brian May bam at moszumanska.debian.org
Sat Mar 11 06:25:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

bam pushed a commit to branch master
in repository parsedatetime.

commit a09528fde7f66bcd069c89e14a809a101def525d
Author: Brian May <bam at debian.org>
Date:   Sat Mar 11 17:17:57 2017 +1100

    Revert all changes since debian/2.1-3
    
    These changes were made it error:
    
    * We are not ready to move master to the latest upstream version yet,
      during the Debian freeze.
    
    * The merge from upstream become lost in a rebase, which in turn made
      git-dpm unhappy (TM).
    
    Which isn't to say I am against uprading to the latest upstream, just
    not in master branch so soon to freeze, and it needs to be git-dpm
    compliant (until we move to gbp pq - in which case preserving the merge
    commit is still a good idea).
---
 CHANGES.txt                                        |   1 -
 Makefile                                           |  51 +----
 PKG-INFO                                           |  41 +---
 README.rst                                         |  37 +--
 debian/changelog                                   |  16 +-
 debian/control                                     |   9 +-
 ...-delta-test-by-using-a-static-source-time.patch |  33 +++
 debian/patches/0001-add-pytest-ini.patch           |  22 --
 debian/patches/series                              |   2 +-
 debian/rules                                       |   5 -
 parsedatetime.egg-info/PKG-INFO                    |  41 +---
 parsedatetime.egg-info/SOURCES.txt                 |   4 -
 parsedatetime.egg-info/pbr.json                    |   1 -
 parsedatetime.egg-info/requires.txt                |   1 -
 parsedatetime/__init__.py                          |  65 +++---
 parsedatetime/parsedatetime.py                     |   2 +-
 parsedatetime/pdt_locales/__init__.py              |   2 +-
 parsedatetime/pdt_locales/base.py                  |   4 +-
 parsedatetime/pdt_locales/en_AU.py                 |   4 +-
 parsedatetime/pdt_locales/fr_FR.py                 | 248 ---------------------
 requirements.testing.txt                           |  12 -
 setup.cfg                                          |  23 +-
 setup.py                                           |   7 +-
 tests/TestAlternativeAbbreviations.py              |   8 +-
 tests/TestAustralianLocale.py                      |   8 +-
 tests/TestComplexDateTimes.py                      |  16 +-
 tests/TestContext.py                               |   7 +-
 tests/TestConvertUnitAsWords.py                    |  12 +-
 tests/TestDelta.py                                 |  19 +-
 tests/TestErrors.py                                |   8 +-
 tests/TestFrenchLocale.py                          | 193 +++++++++-------
 tests/TestGermanLocale.py                          |   8 +-
 tests/TestInc.py                                   |   7 +-
 tests/TestLocaleBase.py                            |  29 ++-
 tests/TestMultiple.py                              |   8 +-
 tests/TestNlp.py                                   |   9 +-
 tests/TestPhrases.py                               |   8 +-
 tests/TestRanges.py                                |   8 +-
 tests/TestRussianLocale.py                         |   8 +-
 tests/TestSimpleDateTimes.py                       |  13 +-
 tests/TestSimpleOffsets.py                         |  40 +---
 tests/TestSimpleOffsetsHours.py                    |   7 +-
 tests/TestSimpleOffsetsNoon.py                     |  31 +--
 tests/TestStartTimeFromSourceTime.py               |   7 +-
 tests/TestUnits.py                                 |   7 +-
 tests/__init__.py                                  |   5 +-
 violations.flake8.txt                              |   2 +
 47 files changed, 314 insertions(+), 785 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 7311c23..6334ce5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,5 @@
 02 Mar 2016 - bear
     v2.1 released
-    v2.2 bump
 
     Issue #156 parsedatetime 2.0 doesn't work on py26
 
diff --git a/Makefile b/Makefile
index b0c9ee2..a24d628 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,7 @@
 .PHONY: docs test
 
-UNAME_S := $(shell uname -s)
-ifeq ($(UNAME_S),Darwin)
-    BREWPATH = $(shell brew --prefix)
-    PYICU_LD = -L${BREWPATH}/opt/icu4c/lib
-    PYICU_CPP = -I${BREWPATH}/opt/icu4c/include
-else
-    PYICU_LD =
-    PYICU_CPP =
-endif
-
 help:
-	@echo "  env         install all production dependencies"
-	@echo "  dev         install all dev and production dependencies (virtualenv is assumed)"
+	@echo "  env         create a development environment using virtualenv"
 	@echo "  clean       remove unwanted stuff"
 	@echo "  lint        check style with flake8"
 	@echo "  test        run tests"
@@ -20,23 +9,11 @@ help:
 	@echo "  upload      generate source and wheel dist files and upload them"
 
 env:
-	pip install -Ur requirements.txt
-
-dev: env
-	pip install -Uqr requirements.testing.txt | tee
-	@echo "on OS X use homebrew to install icu4c"
-	LDFLAGS=${PYICU_LD} CPPFLAGS=${PYICU_CPP} \
-    pip install -U pyicu
-	pyenv install -s 2.7.11
-	pyenv install -s 3.5.2
-	pyenv install -s 2.6.9
-	pyenv install -s pypy-5.3
-	pyenv local 2.7.11 3.5.2 2.6.9 pypy-5.3
-
-info:
-	@python --version
-	@pyenv --version
-	@pip --version
+	sudo easy_install pip && \
+	pip install virtualenv && \
+	virtualenv env && \
+	. env/bin/activate && \
+	pip install .
 
 clean:
 	rm -fr build
@@ -51,22 +28,10 @@ docs:
 lint:
 	flake8 parsedatetime > violations.flake8.txt
 
-test: lint
-	python setup.py test
-
-tox: clean
-	tox
-
-coverage: clean
-	@coverage run --source=parsedatetime setup.py test
-	@coverage html
-	@coverage report
-
-ci: tox coverage
-	CODECOV_TOKEN=`cat .codecov-token` codecov
+test:
+	nosetests
 
 build: clean
-	python setup.py check
 	python setup.py sdist
 	python setup.py bdist_wheel
 
diff --git a/PKG-INFO b/PKG-INFO
index 57dbd3e..b49e75f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
 Name: parsedatetime
-Version: 2.3
+Version: 2.1
 Summary: Parse human-readable date/time text.
 Home-page: https://github.com/bear/parsedatetime
 Author: Mike Taylor
@@ -11,9 +11,7 @@ Description: parsedatetime
         
         Parse human-readable date/time strings.
         
-        Python 2.6 or greater is required for parsedatetime version 1.0 or greater.
-        
-        While we still test with Python 2.6 we cannot guarantee that future changes will not break under 2.6
+        Python 2.7 or greater is required for parsedatetime version 1.0 or greater.
         
         .. image:: https://img.shields.io/pypi/v/parsedatetime.svg
             :target: https://pypi.python.org/pypi/parsedatetime/
@@ -31,10 +29,6 @@ Description: parsedatetime
              :target: https://requires.io/github/bear/parsedatetime/requirements/?branch=master
              :alt: Requirements Status
         
-        .. image:: https://dependencyci.com/github/bear/parsedatetime/badge
-             :target: https://dependencyci.com/github/bear/parsedatetime
-             :alt: Dependency Status
-        
         ==========
         Installing
         ==========
@@ -51,32 +45,14 @@ Description: parsedatetime
         
             make test
         
-        To run tests on several python versions, type ``make tox``::
+        To run tests on several python versions, type ``tox``::
         
-          $ make tox
+          $ tox
           [... tox creates a virtualenv for every python version and runs tests inside of each]
           py27: commands succeeded
           py35: commands succeeded
         
-        This assumes that you have the versions you want to test under installed as part of your
-        PyEnv environment::
-        
-            pyenv install -s 2.6.9
-            pyenv install -s 2.7.11
-            pyenv install -s 3.5.2
-            pyenv install -s pypy-5.3
-            pyenv global 2.7.11 3.5.2 2.6.9 pypy-5.3
-        
-        The tests depend on PyICU being installed. PyICU depends on icu4c which on OS X requires homebrew::
-        
-            brew install icu4c
-        
-        *and* then will require that you pass in the ``LDFLAGS`` and ``CPPFLAGS`` that homebrew will display after the install::
-        
-            LDFLAGS:  -L/usr/local/opt/icu4c/lib
-            CPPFLAGS: -I/usr/local/opt/icu4c/include
-        
-        The Makefile contains the OS X default values for them so you may need to tweak them.
+        This assumes that you have ``python2.7``, ``python3.5``, etc in ``PATH``.
         
         ===================
         Using parsedatetime
@@ -93,9 +69,10 @@ Description: parsedatetime
         To get it to a Python ``datetime`` object::
         
             from datetime import datetime
+            from time import mktime
         
             time_struct, parse_status = cal.parse("tomorrow")
-            datetime(*time_struct[:6])
+            datetime.fromtimestamp(mktime(time_struct))
         
         Parse datetime with timezone support (using pytz package)::
         
@@ -134,7 +111,7 @@ Description: parsedatetime
         
         When I went to work for Open Source Applications Foundation and realized that the Chandler project could benefit from my experience with parsing of date/time text I decided to start from scratch and implement the code using Python and make it truly open.
         
-        After working on the initial concept and creating something that could be shown to the Chandler folks, the code has now evolved to its current state with the help of the Chandler folks, most especially Darshana.
+        After working on the initial concept and creating something that could be shown to the Chandler folks the code has now evolved to it's current state with the help the Chandler folks, most especially Darshana.
         
 Platform: Any
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/README.rst b/README.rst
index 226bbeb..a006717 100644
--- a/README.rst
+++ b/README.rst
@@ -2,9 +2,7 @@ parsedatetime
 
 Parse human-readable date/time strings.
 
-Python 2.6 or greater is required for parsedatetime version 1.0 or greater.
-
-While we still test with Python 2.6 we cannot guarantee that future changes will not break under 2.6
+Python 2.7 or greater is required for parsedatetime version 1.0 or greater.
 
 .. image:: https://img.shields.io/pypi/v/parsedatetime.svg
     :target: https://pypi.python.org/pypi/parsedatetime/
@@ -22,10 +20,6 @@ While we still test with Python 2.6 we cannot guarantee that future changes will
      :target: https://requires.io/github/bear/parsedatetime/requirements/?branch=master
      :alt: Requirements Status
 
-.. image:: https://dependencyci.com/github/bear/parsedatetime/badge
-     :target: https://dependencyci.com/github/bear/parsedatetime
-     :alt: Dependency Status
-
 ==========
 Installing
 ==========
@@ -42,32 +36,14 @@ From the source directory::
 
     make test
 
-To run tests on several python versions, type ``make tox``::
+To run tests on several python versions, type ``tox``::
 
-  $ make tox
+  $ tox
   [... tox creates a virtualenv for every python version and runs tests inside of each]
   py27: commands succeeded
   py35: commands succeeded
 
-This assumes that you have the versions you want to test under installed as part of your
-PyEnv environment::
-
-    pyenv install -s 2.6.9
-    pyenv install -s 2.7.11
-    pyenv install -s 3.5.2
-    pyenv install -s pypy-5.3
-    pyenv global 2.7.11 3.5.2 2.6.9 pypy-5.3
-
-The tests depend on PyICU being installed. PyICU depends on icu4c which on OS X requires homebrew::
-
-    brew install icu4c
-
-*and* then will require that you pass in the ``LDFLAGS`` and ``CPPFLAGS`` that homebrew will display after the install::
-
-    LDFLAGS:  -L/usr/local/opt/icu4c/lib
-    CPPFLAGS: -I/usr/local/opt/icu4c/include
-
-The Makefile contains the OS X default values for them so you may need to tweak them.
+This assumes that you have ``python2.7``, ``python3.5``, etc in ``PATH``.
 
 ===================
 Using parsedatetime
@@ -84,9 +60,10 @@ An example of how to use parsedatetime::
 To get it to a Python ``datetime`` object::
 
     from datetime import datetime
+    from time import mktime
 
     time_struct, parse_status = cal.parse("tomorrow")
-    datetime(*time_struct[:6])
+    datetime.fromtimestamp(mktime(time_struct))
 
 Parse datetime with timezone support (using pytz package)::
 
@@ -125,4 +102,4 @@ The code in parsedatetime has been implemented over the years in many different
 
 When I went to work for Open Source Applications Foundation and realized that the Chandler project could benefit from my experience with parsing of date/time text I decided to start from scratch and implement the code using Python and make it truly open.
 
-After working on the initial concept and creating something that could be shown to the Chandler folks, the code has now evolved to its current state with the help of the Chandler folks, most especially Darshana.
+After working on the initial concept and creating something that could be shown to the Chandler folks the code has now evolved to it's current state with the help the Chandler folks, most especially Darshana.
diff --git a/debian/changelog b/debian/changelog
index 8595477..80ca801 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,14 +1,3 @@
-parsedatetime (2.3-1) UNRELEASED; urgency=medium
-
-  * Team upload.
-  * New upstream version 2.3. (Closes: #717991)
-  * Remove patches applied upstream.
-  * Restore pytest.ini removed from upstream tarballs
-  * Update package to use pytest
-  * Ensure make clean doesn't require pytest installed
-
- -- Harlan Lieberman-Berg <hlieberman at debian.org>  Fri, 10 Mar 2017 22:38:51 -0500
-
 parsedatetime (2.1-3) unstable; urgency=medium
 
   * Add patch to fix FTBFS error after February. Closes: #856625.
@@ -45,7 +34,7 @@ parsedatetime (2.1-1) unstable; urgency=medium
 
 parsedatetime (1.4-1) unstable; urgency=medium
 
-  * New upstream version
+  * New upstream version 
   * Add python-setuptools as build-dependency
   * Use README.rst instead of README.md
 
@@ -112,7 +101,7 @@ parsedatetime (0.8.7-1) unstable; urgency=low
   * debian/README.source: Adding file as required by policy.
   * debian/rules: Remove MacOS ressource files from documentation directory.
   * debian/copyright: Updating file, removing embedded Apache 2.0 license,
-    link to common-licenses.
+    link to common-licenses. 
   * debian/control:
     - Depends on base-files >= 4.0.4 to have the Apache
       License copy installed.
@@ -157,3 +146,4 @@ parsedatetime (0.8.4-1) unstable; urgency=low
   * Initial release (Closes: #449034).
 
  -- Bernd Zeimetz <bernd at bzed.de>  Sun, 18 Nov 2007 23:43:16 +0100
+
diff --git a/debian/control b/debian/control
index e0f09ce..c000f01 100644
--- a/debian/control
+++ b/debian/control
@@ -3,14 +3,7 @@ Section: python
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
 Uploaders: Bernd Zeimetz <bzed at debian.org>
-Build-Depends:
-	debhelper (>= 9),
-	python-all (>= 2.6.6-3~),
-	python-setuptools,
-	python-nose,
-	dh-python,
-	python-pytest,
-	python-pytest-runner
+Build-Depends: debhelper (>= 9), python-all (>= 2.6.6-3~), python-setuptools, python-nose, dh-python
 Standards-Version: 3.9.5
 Homepage: https://pypi.python.org/pypi/parsedatetime/
 Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/parsedatetime.git
diff --git a/debian/patches/0001-Fix-delta-test-by-using-a-static-source-time.patch b/debian/patches/0001-Fix-delta-test-by-using-a-static-source-time.patch
new file mode 100644
index 0000000..a407166
--- /dev/null
+++ b/debian/patches/0001-Fix-delta-test-by-using-a-static-source-time.patch
@@ -0,0 +1,33 @@
+From 56980ebc6028b129adfa8b359b03247de82c9a3c Mon Sep 17 00:00:00 2001
+From: Brian May <bam at debian.org>
+Date: Sat, 11 Mar 2017 11:44:54 +1100
+Subject: Fix delta test by using a static source time
+
+Apply patch from upstream:
+https://github.com/bear/parsedatetime/commit/76a97697e3611356b848f0aa7c759ff80fd7bd4c
+
+Without this patch, the tests would fail immediately after February, as
+February only has 28 days, and the tests currently assume months have 30
+days.
+
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856625
+https://github.com/bear/parsedatetime/issues/215
+---
+ tests/TestDelta.py | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/tests/TestDelta.py b/tests/TestDelta.py
+index c628d5e..a54aee1 100644
+--- a/tests/TestDelta.py
++++ b/tests/TestDelta.py
+@@ -13,9 +13,7 @@ class test(unittest.TestCase):
+ 
+     def setUp(self):
+         self.cal = pdt.Calendar(version=pdt.VERSION_CONTEXT_STYLE)
+-        self.source = (self.yr, self.mth, self.dy,
+-                       self.hr, self.mn, self.sec,
+-                       self.wd, self.yd, self.isdst) = time.localtime()
++        self.source = (2017, 1, 1, 7, 1, 2, 6, 1, 1)
+ 
+     def assertDelta(self, ts, years=None, months=None, **deltakw):
+         ts = ts[0]
diff --git a/debian/patches/0001-add-pytest-ini.patch b/debian/patches/0001-add-pytest-ini.patch
deleted file mode 100644
index 84df9c5..0000000
--- a/debian/patches/0001-add-pytest-ini.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Description: pull pytest.ini from upstream scm
- It seems upstream strips the pytest.ini when it ships tarballs
- out to pypi.  Without this pytest.ini, though, the pytest-runner
- will not find the tests correctly.
-Forwarded: not-needed
-Origin: https://raw.githubusercontent.com/bear/parsedatetime/master/pytest.ini
---- /dev/null
-+++ b/pytest.ini
-@@ -0,0 +1,13 @@
-+[pytest]
-+norecursedirs = venv .tox
-+verbosity = 2
-+python_files=Test*.py
-+
-+with-coverage = true
-+cover-min-percentage = 72
-+cover-package = parsedatetime
-+cover-html = true
-+cover-html-dir = htmlcov
-+cover-erase = true
-+cover-inclusive = true
-+cover-branches = true
diff --git a/debian/patches/series b/debian/patches/series
index 537214a..4d50e46 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-0001-add-pytest-ini.patch
+0001-Fix-delta-test-by-using-a-static-source-time.patch
diff --git a/debian/rules b/debian/rules
index d269e52..53cb3ca 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,8 +2,3 @@
 
 %:
 	dh $@ --with python2 --buildsystem pybuild
-
-override_dh_auto_clean:
-	make clean
-	rm -rfv $(CURDIR)/.eggs
-	rm -rfv $(CURDIR)/.pybuild
diff --git a/parsedatetime.egg-info/PKG-INFO b/parsedatetime.egg-info/PKG-INFO
index 57dbd3e..b49e75f 100644
--- a/parsedatetime.egg-info/PKG-INFO
+++ b/parsedatetime.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
 Name: parsedatetime
-Version: 2.3
+Version: 2.1
 Summary: Parse human-readable date/time text.
 Home-page: https://github.com/bear/parsedatetime
 Author: Mike Taylor
@@ -11,9 +11,7 @@ Description: parsedatetime
         
         Parse human-readable date/time strings.
         
-        Python 2.6 or greater is required for parsedatetime version 1.0 or greater.
-        
-        While we still test with Python 2.6 we cannot guarantee that future changes will not break under 2.6
+        Python 2.7 or greater is required for parsedatetime version 1.0 or greater.
         
         .. image:: https://img.shields.io/pypi/v/parsedatetime.svg
             :target: https://pypi.python.org/pypi/parsedatetime/
@@ -31,10 +29,6 @@ Description: parsedatetime
              :target: https://requires.io/github/bear/parsedatetime/requirements/?branch=master
              :alt: Requirements Status
         
-        .. image:: https://dependencyci.com/github/bear/parsedatetime/badge
-             :target: https://dependencyci.com/github/bear/parsedatetime
-             :alt: Dependency Status
-        
         ==========
         Installing
         ==========
@@ -51,32 +45,14 @@ Description: parsedatetime
         
             make test
         
-        To run tests on several python versions, type ``make tox``::
+        To run tests on several python versions, type ``tox``::
         
-          $ make tox
+          $ tox
           [... tox creates a virtualenv for every python version and runs tests inside of each]
           py27: commands succeeded
           py35: commands succeeded
         
-        This assumes that you have the versions you want to test under installed as part of your
-        PyEnv environment::
-        
-            pyenv install -s 2.6.9
-            pyenv install -s 2.7.11
-            pyenv install -s 3.5.2
-            pyenv install -s pypy-5.3
-            pyenv global 2.7.11 3.5.2 2.6.9 pypy-5.3
-        
-        The tests depend on PyICU being installed. PyICU depends on icu4c which on OS X requires homebrew::
-        
-            brew install icu4c
-        
-        *and* then will require that you pass in the ``LDFLAGS`` and ``CPPFLAGS`` that homebrew will display after the install::
-        
-            LDFLAGS:  -L/usr/local/opt/icu4c/lib
-            CPPFLAGS: -I/usr/local/opt/icu4c/include
-        
-        The Makefile contains the OS X default values for them so you may need to tweak them.
+        This assumes that you have ``python2.7``, ``python3.5``, etc in ``PATH``.
         
         ===================
         Using parsedatetime
@@ -93,9 +69,10 @@ Description: parsedatetime
         To get it to a Python ``datetime`` object::
         
             from datetime import datetime
+            from time import mktime
         
             time_struct, parse_status = cal.parse("tomorrow")
-            datetime(*time_struct[:6])
+            datetime.fromtimestamp(mktime(time_struct))
         
         Parse datetime with timezone support (using pytz package)::
         
@@ -134,7 +111,7 @@ Description: parsedatetime
         
         When I went to work for Open Source Applications Foundation and realized that the Chandler project could benefit from my experience with parsing of date/time text I decided to start from scratch and implement the code using Python and make it truly open.
         
-        After working on the initial concept and creating something that could be shown to the Chandler folks, the code has now evolved to its current state with the help of the Chandler folks, most especially Darshana.
+        After working on the initial concept and creating something that could be shown to the Chandler folks the code has now evolved to it's current state with the help the Chandler folks, most especially Darshana.
         
 Platform: Any
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/parsedatetime.egg-info/SOURCES.txt b/parsedatetime.egg-info/SOURCES.txt
index e563b6d..5c1f872 100644
--- a/parsedatetime.egg-info/SOURCES.txt
+++ b/parsedatetime.egg-info/SOURCES.txt
@@ -4,7 +4,6 @@ LICENSE.txt
 MANIFEST.in
 Makefile
 README.rst
-requirements.testing.txt
 requirements.txt
 setup.cfg
 setup.py
@@ -19,8 +18,6 @@ parsedatetime/warns.py
 parsedatetime.egg-info/PKG-INFO
 parsedatetime.egg-info/SOURCES.txt
 parsedatetime.egg-info/dependency_links.txt
-parsedatetime.egg-info/pbr.json
-parsedatetime.egg-info/requires.txt
 parsedatetime.egg-info/top_level.txt
 parsedatetime/pdt_locales/__init__.py
 parsedatetime/pdt_locales/base.py
@@ -28,7 +25,6 @@ parsedatetime/pdt_locales/de_DE.py
 parsedatetime/pdt_locales/en_AU.py
 parsedatetime/pdt_locales/en_US.py
 parsedatetime/pdt_locales/es.py
-parsedatetime/pdt_locales/fr_FR.py
 parsedatetime/pdt_locales/icu.py
 parsedatetime/pdt_locales/nl_NL.py
 parsedatetime/pdt_locales/pt_BR.py
diff --git a/parsedatetime.egg-info/pbr.json b/parsedatetime.egg-info/pbr.json
deleted file mode 100644
index 1be2325..0000000
--- a/parsedatetime.egg-info/pbr.json
+++ /dev/null
@@ -1 +0,0 @@
-{"is_release": false, "git_version": "e3cf2a1"}
\ No newline at end of file
diff --git a/parsedatetime.egg-info/requires.txt b/parsedatetime.egg-info/requires.txt
deleted file mode 100644
index 2c6edea..0000000
--- a/parsedatetime.egg-info/requires.txt
+++ /dev/null
@@ -1 +0,0 @@
-future
diff --git a/parsedatetime/__init__.py b/parsedatetime/__init__.py
index c724d76..07be367 100644
--- a/parsedatetime/__init__.py
+++ b/parsedatetime/__init__.py
@@ -44,7 +44,7 @@ __author__ = 'Mike Taylor'
 __email__ = 'bear at bear.im'
 __copyright__ = 'Copyright (c) 2016 Mike Taylor'
 __license__ = 'Apache License 2.0'
-__version__ = '2.3'
+__version__ = '2.1'
 __url__ = 'https://github.com/bear/parsedatetime'
 __download_url__ = 'https://pypi.python.org/pypi/parsedatetime'
 __description__ = 'Parse human-readable date/time text.'
@@ -915,8 +915,7 @@ class Calendar(object):
                 # day-of-week, we want to start with target as the day
                 # in the current week.
                 dowOffset = offset
-                relativeModifier = modifier not in ['this', 'next', 'last', 'prior', 'previous']
-                if relativeModifier:
+                if modifier not in ['next', 'last', 'prior', 'previous']:
                     dowOffset = 0
 
                 wkdy = self.ptc.WeekdayOffsets[wkdy]
@@ -927,7 +926,7 @@ class Calendar(object):
                                           startMinute, startSecond)
                 target = start + datetime.timedelta(days=diff)
 
-                if chunk1 != '' and relativeModifier:
+                if chunk1 != '':
                     # consider "one day before thursday": we need to parse chunk1 ("one day")
                     # and apply according to the offset ("before"), rather than allowing the
                     # remaining parse step to apply "one day" without the offset direction.
@@ -940,7 +939,7 @@ class Calendar(object):
                 sourceTime = target.timetuple()
             ctx.updateAccuracy(ctx.ACU_DAY)
 
-        elif chunk1 == '' and chunk2 == '' and self.ptc.CRE_TIME.match(unit):
+        elif self.ptc.CRE_TIME.match(unit):
             m = self.ptc.CRE_TIME.match(unit)
             debug and log.debug('CRE_TIME matched')
             (yr, mth, dy, hr, mn, sec, wd, yd, isdst), subctx = \
@@ -1577,9 +1576,6 @@ class Calendar(object):
         parseStr = None
         chunk1 = chunk2 = ''
 
-        ctx = self.currentContext
-        log.debug('eval %s with context - %s, %s', s, ctx.hasDate, ctx.hasTime)
-
         # Weekday
         m = self.ptc.CRE_WEEKDAY.search(s)
         if m is not None:
@@ -1596,7 +1592,7 @@ class Calendar(object):
                     parseStr = s
                     s = ''
 
-        if parseStr and not ctx.hasDate:
+        if parseStr:
             debug and log.debug(
                 'found (weekday) [%s][%s][%s]', parseStr, chunk1, chunk2)
             sourceTime = self._evalWeekday(parseStr, sourceTime)
@@ -2406,14 +2402,13 @@ class Constants(object):
                         adjusted.append(d)
                 return adjusted
 
-            def re_join(g):
-                return '|'.join(re.escape(i) for i in g)
-
             mths = _getLocaleDataAdjusted(self.locale.Months)
             smths = _getLocaleDataAdjusted(self.locale.shortMonths)
             swds = _getLocaleDataAdjusted(self.locale.shortWeekdays)
             wds = _getLocaleDataAdjusted(self.locale.Weekdays)
 
+            re_join = lambda g: '|'.join(re.escape(i) for i in g)
+
             # escape any regex special characters that may be found
             self.locale.re_values['months'] = re_join(mths)
             self.locale.re_values['shortmonths'] = re_join(smths)
@@ -2476,11 +2471,11 @@ class Constants(object):
                                         (?P<day>\d\d?)
                                         (?P<suffix>{daysuffix})?
                                         (,)?
-                                        (\s)*
+                                        (\s)?
                                     )
                                     (?P<mthname>
                                         \b({months}|{shortmonths})\b
-                                    )\s*
+                                    )\s?
                                     (?P<year>\d\d
                                         (\d\d)?
                                     )?
@@ -2496,17 +2491,17 @@ class Constants(object):
         # when the day is absent from the string
         self.RE_DATE3 = r'''(?P<date>
                                 (?:
-                                    (?:^|\s+)
+                                    (?:^|\s)
                                     (?P<mthname>
                                         {months}|{shortmonths}
                                     )\b
                                     |
-                                    (?:^|\s+)
+                                    (?:^|\s)
                                     (?P<day>[1-9]|[012]\d|3[01])
                                     (?P<suffix>{daysuffix}|)\b
                                     (?!\s*(?:{timecomponents}))
                                     |
-                                    ,?\s+
+                                    ,?\s
                                     (?P<year>\d\d(?:\d\d|))\b
                                     (?!\s*(?:{timecomponents}))
                                 ){{1,3}}
@@ -2515,18 +2510,18 @@ class Constants(object):
 
         # not being used in code, but kept in case others are manually
         # utilizing this regex for their own purposes
-        self.RE_MONTH = r'''(\s+|^)
+        self.RE_MONTH = r'''(\s|^)
                             (?P<month>
                                 (
                                     (?P<mthname>
                                         \b({months}|{shortmonths})\b
                                     )
-                                    (\s*
+                                    (\s?
                                         (?P<year>(\d{{4}}))
                                     )?
                                 )
                             )
-                            (?=\s+|$|[^\w])'''.format(**self.locale.re_values)
+                            (?=\s|$|[^\w])'''.format(**self.locale.re_values)
 
         self.RE_WEEKDAY = r'''\b
                               (?:
@@ -2551,7 +2546,7 @@ class Constants(object):
 
         self.RE_QUNITS = r'''\b(?P<qty>
                                  -?
-                                 (?:\d+(?:{decimal_mark}\d+|)|(?:{numbers})\s+)\s*
+                                 (?:\d+(?:{decimal_mark}\d+|)|(?:{numbers})s)\s?
                                  (?P<qunits>{qunits})
                              )\b'''.format(**self.locale.re_values)
 
@@ -2594,7 +2589,7 @@ class Constants(object):
                                  )'''
 
         if 'meridian' in self.locale.re_values:
-            self.RE_TIMEHMS2 += (r'\s*(?P<meridian>{meridian})\b'
+            self.RE_TIMEHMS2 += (r'\s?(?P<meridian>{meridian})\b'
                                  .format(**self.locale.re_values))
         else:
             self.RE_TIMEHMS2 += r'\b'
@@ -2634,20 +2629,20 @@ class Constants(object):
         self.RE_REMAINING = r'\s+'
 
         # Regex for date/time ranges
-        self.RE_RTIMEHMS = r'''(\s*|^)
+        self.RE_RTIMEHMS = r'''(\s?|^)
                                (\d\d?){timeseparator}
                                (\d\d)
                                ({timeseparator}(\d\d))?
-                               (\s*|$)'''.format(**self.locale.re_values)
+                               (\s?|$)'''.format(**self.locale.re_values)
 
-        self.RE_RTIMEHMS2 = (r'''(\s*|^)
+        self.RE_RTIMEHMS2 = (r'''(\s?|^)
                                  (\d\d?)
                                  ({timeseparator}(\d\d?))?
                                  ({timeseparator}(\d\d?))?'''
                              .format(**self.locale.re_values))
 
         if 'meridian' in self.locale.re_values:
-            self.RE_RTIMEHMS2 += (r'\s*({meridian})'
+            self.RE_RTIMEHMS2 += (r'\s?({meridian})'
                                   .format(**self.locale.re_values))
 
         self.RE_RDATE = r'(\d+([%s]\d+)+)' % dateSeps
@@ -2655,40 +2650,40 @@ class Constants(object):
                                 (
                                     (
                                         \b({months})\b
-                                    )\s*
+                                    )\s?
                                     (
                                         (\d\d?)
                                         (\s?|{daysuffix}|$)+
                                     )?
-                                    (,\s*\d{{4}})?
+                                    (,\s?\d{{4}})?
                                 )
                             )'''.format(**self.locale.re_values)
 
         # "06/07/06 - 08/09/06"
-        self.DATERNG1 = (r'{0}\s*{rangeseparator}\s*{0}'
+        self.DATERNG1 = (r'{0}\s?{rangeseparator}\s?{0}'
                          .format(self.RE_RDATE, **self.locale.re_values))
 
         # "march 31 - june 1st, 2006"
-        self.DATERNG2 = (r'{0}\s*{rangeseparator}\s*{0}'
+        self.DATERNG2 = (r'{0}\s?{rangeseparator}\s?{0}'
                          .format(self.RE_RDATE3, **self.locale.re_values))
 
         # "march 1rd -13th"
-        self.DATERNG3 = (r'{0}\s*{rangeseparator}\s*(\d\d?)\s*(rd|st|nd|th)?'
+        self.DATERNG3 = (r'{0}\s?{rangeseparator}\s?(\d\d?)\s?(rd|st|nd|th)?'
                          .format(self.RE_RDATE3, **self.locale.re_values))
 
         # "4:00:55 pm - 5:90:44 am", '4p-5p'
-        self.TIMERNG1 = (r'{0}\s*{rangeseparator}\s*{0}'
+        self.TIMERNG1 = (r'{0}\s?{rangeseparator}\s?{0}'
                          .format(self.RE_RTIMEHMS2, **self.locale.re_values))
 
-        self.TIMERNG2 = (r'{0}\s*{rangeseparator}\s*{0}'
+        self.TIMERNG2 = (r'{0}\s?{rangeseparator}\s?{0}'
                          .format(self.RE_RTIMEHMS, **self.locale.re_values))
 
         # "4-5pm "
-        self.TIMERNG3 = (r'\d\d?\s*{rangeseparator}\s*{0}'
+        self.TIMERNG3 = (r'\d\d?\s?{rangeseparator}\s?{0}'
                          .format(self.RE_RTIMEHMS2, **self.locale.re_values))
 
         # "4:30-5pm "
-        self.TIMERNG4 = (r'{0}\s*{rangeseparator}\s*{1}'
+        self.TIMERNG4 = (r'{0}\s?{rangeseparator}\s?{1}'
                          .format(self.RE_RTIMEHMS, self.RE_RTIMEHMS2,
                                  **self.locale.re_values))
 
diff --git a/parsedatetime/parsedatetime.py b/parsedatetime/parsedatetime.py
index 647eb06..5a50a14 100644
--- a/parsedatetime/parsedatetime.py
+++ b/parsedatetime/parsedatetime.py
@@ -1,2 +1,2 @@
 # Backward compatibility fix.
-from . import *         # noqa
+from . import *
diff --git a/parsedatetime/pdt_locales/__init__.py b/parsedatetime/pdt_locales/__init__.py
index cb05718..b1edf2c 100644
--- a/parsedatetime/pdt_locales/__init__.py
+++ b/parsedatetime/pdt_locales/__init__.py
@@ -9,7 +9,7 @@ All of the included locale classes shipped with pdt.
 from __future__ import absolute_import
 from .icu import get_icu
 
-locales = ['de_DE', 'en_AU', 'en_US', 'es', 'nl_NL', 'pt_BR', 'ru_RU', 'fr_FR']
+locales = ['de_DE', 'en_AU', 'en_US', 'es', 'nl_NL', 'pt_BR', 'ru_RU']
 
 __locale_caches = {}
 
diff --git a/parsedatetime/pdt_locales/base.py b/parsedatetime/pdt_locales/base.py
index 0191629..8a10dfe 100644
--- a/parsedatetime/pdt_locales/base.py
+++ b/parsedatetime/pdt_locales/base.py
@@ -102,9 +102,9 @@ re_values = {
     'timeseparator': ':',
     'rangeseparator': '-',
     'daysuffix': 'rd|st|nd|th',
-    'meridian': r'am|pm|a\.m\.|p\.m\.|a|p',
+    'meridian': 'am|pm|a.m.|p.m.|a|p',
     'qunits': 'h|m|s|d|w|y',
-    'now': ['now', 'right now'],
+    'now': ['now'],
 }
 
 # Used to adjust the returned date before/after the source
diff --git a/parsedatetime/pdt_locales/en_AU.py b/parsedatetime/pdt_locales/en_AU.py
index bff3d3f..e4e4b54 100644
--- a/parsedatetime/pdt_locales/en_AU.py
+++ b/parsedatetime/pdt_locales/en_AU.py
@@ -14,6 +14,8 @@ dateFormats = {
     'short': 'd/MM/yy',
 }
 
-timeFormats['long'] = timeFormats['full']
+timeFormats = {
+    'long': timeFormats['full'],
+}
 
 dp_order = ['d', 'm', 'y']
diff --git a/parsedatetime/pdt_locales/fr_FR.py b/parsedatetime/pdt_locales/fr_FR.py
deleted file mode 100644
index 0e5d3ef..0000000
--- a/parsedatetime/pdt_locales/fr_FR.py
+++ /dev/null
@@ -1,248 +0,0 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-from .base import *  # noqa
-
-# don't use an unicode string
-localeID = 'fr_FR'
-dateSep = ['\/']
-timeSep = [':', 'h']
-meridian = ['du matin', 'du soir']
-usesMeridian = True
-uses24 = True
-WeekdayOffsets = {}
-MonthOffsets = {}
-
-# always lowercase any lookup values - helper code expects that
-Weekdays = [
-    'lundi', 'mardi', 'mercredi', 'jeudi',
-    'vendredi', 'samedi', 'dimanche',
-]
-
-shortWeekdays = [
-    'lun', 'mar', 'mer', 'jeu', 'ven', 'sam', 'dim',
-]
-
-Months = [
-    'janvier', 'février|fevrier', 'mars', 'avril', 'mai', 'juin', 'juillet',
-    'août|aout', 'septembre', 'octobre', 'novembre', 'décembre|decembre',
-]
-
-# We do not list 'mar' as a short name for 'mars' as it conflicts with
-# the 'mar' of 'mardi'
-shortMonths = [
-    'jan', 'fév|fev', 'mars', 'avr', 'mai', 'jui',
-    'juil', 'aoû|aou', 'sep', 'oct', 'nov', 'déc|dec',
-]
-
-# use the same formats as ICU by default
-dateFormats = {
-    'full': 'EEEE d MMMM yyyy',
-    'long': 'd MMMM yyyy',
-    'medium': 'd MMM yyyy',
-    'short': 'd/M/yy'
-}
-
-timeFormats = {
-    'full': 'h:mm:ss a z',
-    'long': 'h:mm:ss a z',
-    'medium': 'h:mm:ss a',
-    'short': 'h:mm a',
-}
-
-dp_order = ['d', 'm', 'y']
-
-# Used to parse expressions like "in 5 hours"
-numbers = {
-    'zéro': 0,
-    'zero': 0,
-    'un': 1,
-    'une': 1,
-    'deux': 2,
-    'trois': 3,
-    'quatre': 4,
-    'cinq': 5,
-    'six': 6,
-    'sept': 7,
-    'huit': 8,
-    'neuf': 9,
-    'dix': 10,
-    'onze': 11,
-    'douze': 12,
-    'treize': 13,
-    'quatorze': 14,
-    'quinze': 15,
-    'seize': 16,
-    'dix-sept': 17,
-    'dix sept': 17,
-    'dix-huit': 18,
-    'dix huit': 18,
-    'dix-neuf': 19,
-    'dix neuf': 19,
-    'vingt': 20,
-    'vingt-et-un': 21,
-    'vingt et un': 21,
-    'vingt-deux': 22,
-    'vingt deux': 22,
-    'vingt-trois': 23,
-    'vingt trois': 23,
-    'vingt-quatre': 24,
-    'vingt quatre': 24,
-}
-
-decimal_mark = ','
-
-# this will be added to re_values later
-units = {
-    'seconds': ['seconde', 'secondes', 'sec', 's'],
-    'minutes': ['minute', 'minutes', 'min', 'mn'],
-    'hours': ['heure', 'heures', 'h'],
-    'days': ['jour', 'jours', 'journée', 'journee', 'journées', 'journees', 'j'],
-    'weeks': ['semaine', 'semaines', 'sem'],
-    'months': ['mois', 'm'],
-    'years': ['année', 'annee', 'an', 'années', 'annees', 'ans'],
... 1223 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/parsedatetime.git



More information about the Python-modules-commits mailing list