[Python-modules-commits] r3996 - in packages/parsedatetime/trunk/debian (3 files)
bzed at users.alioth.debian.org
bzed at users.alioth.debian.org
Wed Dec 19 14:12:13 UTC 2007
Date: Wednesday, December 19, 2007 @ 14:12:12
Author: bzed
Revision: 3996
* debian/patches:
- Adding locale-de.dpatch to add de_DE locale constants to
parsedatetime_consts.py.
Added:
packages/parsedatetime/trunk/debian/patches/locale-de.dpatch
Modified:
packages/parsedatetime/trunk/debian/changelog
packages/parsedatetime/trunk/debian/patches/00list
Modified: packages/parsedatetime/trunk/debian/changelog
===================================================================
--- packages/parsedatetime/trunk/debian/changelog 2007-12-19 09:36:46 UTC (rev 3995)
+++ packages/parsedatetime/trunk/debian/changelog 2007-12-19 14:12:12 UTC (rev 3996)
@@ -1,3 +1,11 @@
+parsedatetime (0.8.5-2) unstable; urgency=low
+
+ * debian/patches:
+ - Adding locale-de.dpatch to add de_DE locale constants to
+ parsedatetime_consts.py.
+
+ -- Bernd Zeimetz <bzed at debian.org> Wed, 19 Dec 2007 15:06:33 +0100
+
parsedatetime (0.8.5-1) unstable; urgency=low
* New upstream version.
Modified: packages/parsedatetime/trunk/debian/patches/00list
===================================================================
--- packages/parsedatetime/trunk/debian/patches/00list 2007-12-19 09:36:46 UTC (rev 3995)
+++ packages/parsedatetime/trunk/debian/patches/00list 2007-12-19 14:12:12 UTC (rev 3996)
@@ -1,2 +1,3 @@
remove-shebang
no-setuptools-please
+locale-de
Added: packages/parsedatetime/trunk/debian/patches/locale-de.dpatch
===================================================================
--- packages/parsedatetime/trunk/debian/patches/locale-de.dpatch (rev 0)
+++ packages/parsedatetime/trunk/debian/patches/locale-de.dpatch 2007-12-19 14:12:12 UTC (rev 3996)
@@ -0,0 +1,156 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## locale-de.dpatch by Bernd Zeimetz <bzed at debian.org>
+##
+## DP: de_DE locale constants
+
+ at DPATCH@
+diff -urNad parsedatetime~/parsedatetime/parsedatetime_consts.py parsedatetime/parsedatetime/parsedatetime_consts.py
+--- parsedatetime~/parsedatetime/parsedatetime_consts.py 2007-12-19 15:10:16.000000000 +0100
++++ parsedatetime/parsedatetime/parsedatetime_consts.py 2007-12-19 15:11:44.000000000 +0100
+@@ -1,4 +1,4 @@
+-
++# -*- coding: utf-8 -*-
+ """
+ parsedatetime constants and helper functions to determine
+ regex values from Locale information if present.
+@@ -10,6 +10,7 @@
+ __license__ = """
+ Copyright (c) 2004-2007 Mike Taylor
+ Copyright (c) 2006-2007 Darshana Chhajed
++Copyright (c) 2007 Bernd Zeimetz <bzed at debian.org>
+ All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+@@ -352,12 +353,132 @@
+ }
+
+
++class pdtLocale_de:
++ """
++ de_DE Locale constants
++
++ This class will be used to initialize L{Constants} if PyICU is not located.
++
++ Defined as class variables are the lists and strings needed by parsedatetime
++ to evaluate strings for German
++
++ """
++
++ localeID = 'de_DE' # don't use a unicode string
++ dateSep = [ u'.' ]
++ timeSep = [ u':' ]
++ meridian = [ ]
++ usesMeridian = False
++ uses24 = True
++
++ Weekdays = [ u'montag', u'dienstag', u'mittwoch',
++ u'donnerstag', u'freitag', u'samstag', u'sonntag',
++ ]
++ shortWeekdays = [ u'mo', u'di', u'mi',
++ u'do', u'fr', u'sa', u'so',
++ ]
++ Months = [ u'januar', u'februar', u'märz',
++ u'april', u'mai', u'juni',
++ u'juli', u'august', u'september',
++ u'oktober', u'november', u'dezember',
++ ]
++ shortMonths = [ u'jan', u'feb', u'mrz',
++ u'apr', u'mai', u'jun',
++ u'jul', u'aug', u'sep',
++ u'okt', u'nov', u'dez',
++ ]
++ dateFormats = { 'full': u'EEEE, d. MMMM yyyy',
++ 'long': u'd. MMMM yyyy',
++ 'medium': u'dd.MM.yyyy',
++ 'short': u'dd.MM.yy'
++ }
++
++ timeFormats = { 'full': u'HH:mm:ss v',
++ 'long': u'HH:mm:ss z',
++ 'medium': u'HH:mm:ss',
++ 'short': u'HH:mm'
++ }
++
++
++ dp_order = [ u'd', u'm', u'y' ]
++
++ # this will be added to re_consts later
++ units = { 'seconds': [ 'sekunden', 'sek', 's' ],
++ 'minutes': [ 'minuten', 'min' , 'm' ],
++ 'hours': [ 'stunden', 'std', 'h' ],
++ 'days': [ 'tage', 't' ],
++ 'weeks': [ 'wochen', 'w' ],
++ 'months': [ 'monate' ], #the short version would be a capital M,
++ #as I understand it we can't distinguis
++ #between m for minutes and M for months.
++ 'years': [ 'jahre', 'j' ],
++ }
++
++ # text constants to be used by regex's later
++ re_consts = { 'specials': 'am|dem|der|im|in|den|zum',
++ 'timeseperator': ':',
++ 'rangeseperator': '-',
++ 'daysuffix': '',
++ 'meridian': '',
++ 'qunits': 'h|m|s|t|w|m|j',
++ 'now': [ 'jetzt' ],
++ }
++
++ # Used to adjust the returned date before/after the source
++ #still looking for insight on how to translate all of them to german.
++ modifiers = { 'from': 1,
++ 'before': -1,
++ 'after': 1,
++ 'vergangener': -1,
++ 'vorheriger': -1,
++ 'prev': -1,
++ 'letzter': -1,
++ u'nächster': 1,
++ 'dieser': 0,
++ 'previous': -1,
++ 'in a': 2,
++ 'end of': 0,
++ 'eod': 0,
++ 'eo': 0
++ }
++
++ #morgen/übermorgen does not work, see http://code.google.com/p/parsedatetime/issues/detail?id=19
++ dayoffsets = { 'morgen': 1,
++ 'heute': 0,
++ 'gestern': -1,
++ 'vorgestern': -2,
++ u'übermorgen': 2
++ }
++
++ # special day and/or times, i.e. lunch, noon, evening
++ # each element in the dictionary is a dictionary that is used
++ # to fill in any value to be replace - the current date/time will
++ # already have been populated by the method buildSources
++ re_sources = { 'mittag': { 'hr': 12, 'mn': 0, 'sec': 0 },
++ 'mittags': { 'hr': 12, 'mn': 0, 'sec': 0 },
++ 'mittagessen': { 'hr': 12, 'mn': 0, 'sec': 0 },
++ 'morgen': { 'hr': 6, 'mn': 0, 'sec': 0 },
++ 'morgens': { 'hr': 6, 'mn': 0, 'sec': 0 },
++ u'frühstück': { 'hr': 8, 'mn': 0, 'sec': 0 },
++ 'abendessen': { 'hr': 19, 'mn': 0, 'sec': 0 },
++ 'abend': { 'hr': 18, 'mn': 0, 'sec': 0 },
++ 'abends': { 'hr': 18, 'mn': 0, 'sec': 0 },
++ 'mitternacht': { 'hr': 0, 'mn': 0, 'sec': 0 },
++ 'nacht': { 'hr': 21, 'mn': 0, 'sec': 0 },
++ 'nachts': { 'hr': 21, 'mn': 0, 'sec': 0 },
++ 'heute abend': { 'hr': 21, 'mn': 0, 'sec': 0 },
++ 'heute nacht': { 'hr': 21, 'mn': 0, 'sec': 0 },
++ 'feierabend': { 'hr': 17, 'mn': 0, 'sec': 0 },
++ }
++
+ pdtLocales = { 'en_US': pdtLocale_en,
+ 'en_AU': pdtLocale_au,
+ 'es': pdtLocale_es,
++ 'de_DE': pdtLocale_de
+ }
+
+
++
+ def _initLocale(ptc):
+ """
+ Helper function to initialize the different lists and strings
Property changes on: packages/parsedatetime/trunk/debian/patches/locale-de.dpatch
___________________________________________________________________
Name: svn:executable
+ *
More information about the Python-modules-commits
mailing list