summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2006-08-07 08:34:14 +0200
committerAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2006-08-07 08:34:14 +0200
commit6a582f9220a995fc6223771a042c149254b0ab0c (patch)
tree5c4b826cce98574a3bb3288bc536ef97e0c1fe47
parent3d7cf5240258c1d3ae126d6d19a20a1f07bca2c6 (diff)
parentc01872ee4e43d7ca73f4126037b5ebe59db0bb76 (diff)
downloadlogilab-common-6a582f9220a995fc6223771a042c149254b0ab0c.tar.gz
merge with Nicolas' command parser
-rw-r--r--DEPENDS2
-rw-r--r--__pkginfo__.py2
-rw-r--r--date.py41
-rw-r--r--fileutils.py2
4 files changed, 44 insertions, 3 deletions
diff --git a/DEPENDS b/DEPENDS
index 5fe2924..a4efcdb 100644
--- a/DEPENDS
+++ b/DEPENDS
@@ -1 +1 @@
-python-xml
+python-egenix-mxdatetime \ No newline at end of file
diff --git a/__pkginfo__.py b/__pkginfo__.py
index ba6581f..4c96f9b 100644
--- a/__pkginfo__.py
+++ b/__pkginfo__.py
@@ -54,6 +54,6 @@ subpackage_master = True
from os.path import join
include_dirs = [join('test', 'data')]
-pyversions = ['2.2', '2.3', '2.4']
+pyversions = ['all']
debian_maintainer = 'Alexandre Fayolle'
debian_maintainer_email = 'afayolle@debian.org'
diff --git a/date.py b/date.py
index c1c475e..32474cb 100644
--- a/date.py
+++ b/date.py
@@ -36,3 +36,44 @@ def date_range(begin, end, step=1):
# yield date
# date = RelativeDateTime(months=+1)
+FRENCH_FIXED_HOLIDAYS = {
+ 'jour_an' : '%s-01-01',
+ 'fete_travail' : '%s-05-01',
+ 'armistice1945' : '%s-05-08',
+ 'fete_nat' : '%s-07-14',
+ 'assomption' : '%s-08-15',
+ 'toussaint' : '%s-11-01',
+ 'armistice1918' : '%s-11-11',
+ 'noel' : '%s-12-25',
+ }
+
+
+FRENCH_MOBILE_HOLIDAYS = {
+ 'paques2004' : '2004-04-12',
+ 'ascension2004' : '2004-05-20',
+ 'pentecote2004' : '2004-05-31',
+
+ 'paques2005' : '2005-03-28',
+ 'ascension2005' : '2005-05-05',
+ 'pentecote2005' : '2005-05-16',
+
+ 'paques2006' : '2006-04-17',
+ 'ascension2006' : '2006-05-25',
+ 'pentecote2006' : '2006-06-05',
+
+ 'paques2007' : '2007-04-09',
+ 'ascension2007' : '2007-05-17',
+ 'pentecote2007' : '2007-05-28',
+ }
+
+
+def get_national_holidays(begin, end):
+ """return french national days off between begin and end"""
+ holidays = [strptime(datestr, '%Y-%m-%d')
+ for datestr in FRENCH_MOBILE_HOLIDAYS.values()]
+ for year in xrange(begin.year, end.year+1):
+ holidays += [strptime(datestr % year, '%Y-%m-%d')
+ for datestr in FRENCH_FIXED_HOLIDAYS.values()]
+ return [day for day in holidays if begin <= day < end]
+
+
diff --git a/fileutils.py b/fileutils.py
index 6513c7d..3e05385 100644
--- a/fileutils.py
+++ b/fileutils.py
@@ -339,7 +339,7 @@ def stream_lines(stream, comments=None):
-BASE_BLACKLIST = ('CVS', '.svn', 'debian', 'dist', 'build', '__buildlog')
+BASE_BLACKLIST = ('CVS', '.svn', 'debian', 'dist', 'build', '__buildlog', '.hg')
IGNORED_EXTENSIONS = ('.pyc', '.pyo', '.elc', '~')
def export(from_dir, to_dir,