diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2011-04-08 15:18:27 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2011-04-08 15:18:27 +0200 |
commit | 7e5473cfdf80ffb05852caee3d6ab16452c561de (patch) | |
tree | 6037516c5f685eca896b281492eed9ce5c5a5ff0 | |
parent | e8f8fade855aec3afc875d7a1c8d646d95b3a467 (diff) | |
parent | 361ca31f9f45b844cdeb4032adb39927147cd33b (diff) | |
download | logilab-common-7e5473cfdf80ffb05852caee3d6ab16452c561de.tar.gz |
backport stable
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | __pkginfo__.py | 2 | ||||
-rw-r--r-- | date.py | 14 | ||||
-rw-r--r-- | debian/changelog | 6 |
4 files changed, 37 insertions, 1 deletions
@@ -1,6 +1,22 @@ ChangeLog for logilab.common ============================ + -- +* date: new datetime/delta <-> seconds/days conversion function + +2011-04-01 -- 0.55.2 + * new function for password generation in shellutils + + * pyro_ext: allow to create a server without registering with a pyrons + +2011-03-28 -- 0.55.1 + + * fix date.ustrftime break if year <= 1900 + + * fix graph.py incorrectly builds command lines using %s to call dot + + * new functions to get UTC datetime / time + 2011-02-18 -- 0.55.0 * new urllib2ext module providing a GSSAPI authentication handler, based on python-kerberos diff --git a/__pkginfo__.py b/__pkginfo__.py index 1f250fd..b4234fc 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -23,7 +23,7 @@ modname = 'common' subpackage_of = 'logilab' subpackage_master = True -numversion = (0, 55, 1) +numversion = (0, 55, 2) version = '.'.join([str(num) for num in numversion]) license = 'LGPL' # 2.1 or later @@ -16,6 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with logilab-common. If not, see <http://www.gnu.org/licenses/>. """Date manipulation helper functions.""" +from __future__ import division __docformat__ = "restructuredtext en" @@ -307,3 +308,16 @@ def utcdatetime(dt): def utctime(dt): return (dt + dt.utcoffset() + dt.dst()).replace(tzinfo=None) + +def datetime_to_seconds(date): + """return the number of seconds since the begining of the day for that date + """ + return date.second+60*date.minute + 3600*date.hour + +def timedelta_to_days(delta): + """return the time delta as a number of seconds""" + return delta.days + delta.seconds / (3600*24) + +def timedelta_to_seconds(delta): + """return the time delta as a fraction of days""" + return delta.days*(3600*24) + delta.seconds diff --git a/debian/changelog b/debian/changelog index 2bfac61..e0e9a1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +logilab-common (0.55.2-1) unstable; urgency=low + + * new upstream release + + -- Alexandre Fayolle <alexandre.fayolle@logilab.fr> Fri, 01 Apr 2011 15:01:25 +0200 + logilab-common (0.55.1-1) unstable; urgency=low * new upstream release |