-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/timestamp.pyc

ó
¦îNc@@sddlmZddlZddlZddlZddlmZdd„Zd„Zdd„Z	ej
dƒZej
dƒZd	„Z
dS(
i(tabsolute_importN(tosutilscC@s•t|tƒst|ƒ‚n|d	kr3d}ntj||ƒ}tj|dtjd|ƒd|t	|ƒdd|d|ddfS(
sFormat a date, such that it includes higher precision in the
    seconds field.

    :param t:   The local time in fractional seconds since the epoch
    :type t: float
    :param offset:  The timezone offset in integer seconds
    :type offset: int

    Example: format_highres_date(time.time(), -time.timezone)
    this will return a date stamp for right now,
    formatted for the local timezone.

    >>> from bzrlib.osutils import format_date
    >>> format_date(1120153132.350850105, 0)
    'Thu 2005-06-30 17:38:52 +0000'
    >>> format_highres_date(1120153132.350850105, 0)
    'Thu 2005-06-30 17:38:52.350850105 +0000'
    >>> format_date(1120153132.350850105, -5*3600)
    'Thu 2005-06-30 12:38:52 -0500'
    >>> format_highres_date(1120153132.350850105, -5*3600)
    'Thu 2005-06-30 12:38:52.350850105 -0500'
    >>> format_highres_date(1120153132.350850105, 7200)
    'Thu 2005-06-30 19:38:52.350850105 +0200'
    >>> format_highres_date(1152428738.867522, 19800)
    'Sun 2006-07-09 12:35:38.867522001 +0530'
    iis %Y-%m-%d %H:%M:%Ss%.9fis
 %+03d%02dii<N(
t
isinstancetfloatt
ValueErrortNonettimetgmtimeRtweekdayststrftimetint(tttoffsetttt((s4/usr/lib/python2.7/dist-packages/bzrlib/timestamp.pytformat_highres_dates	c
C@s|jdƒ}|dks.|| tjkrAtd|ƒ‚n|jdƒ}|dkrotd|ƒ‚ntj|||!dƒ}||jƒ\}}t|ƒ}t|ƒ}t|dƒ}|d}|d|d	}t	j
|ƒ}	|	|8}	|	|7}	|	|fS(
s/This takes the high-resolution date stamp, and
    converts it back into the tuple (timestamp, timezone)
    Where timestamp is in real UTC since epoch seconds, and timezone is an
    integer number of seconds offset.

    :param date: A date formated by format_highres_date
    :type date: string

    t iÿÿÿÿs.Date string does not contain a day of week: %rt.s7Date string does not contain high-precision seconds: %rs %Y-%m-%d %H:%M:%Sidii<(tfindRRRRtstrptimetsplitRR
tcalendarttimegm(
tdatet	space_loctdot_loct	base_timet
fract_secondsRthourstminutestseconds_offsett	timestamp((s4/usr/lib/python2.7/dist-packages/bzrlib/timestamp.pytunpack_highres_dateEs&


cC@sˆ|ddkr#td|ƒ‚n|dkr8d}n||dkroddlm}|d||fƒntj|d|ddƒS(	sjFormat a POSIX timestamp and optional offset as a patch-style date.

    Inverse of parse_patch_date.
    i<is8can't represent timezone %s offset by fractional minutes(twarns8gmtime of negative time (%s, %s) may not work on WindowsRtdate_fmts%Y-%m-%d %H:%M:%S(RtwarningsR Rtformat_date(tsecsRR ((s4/usr/lib/python2.7/dist-packages/bzrlib/timestamp.pytformat_patch_datems	s/(\d+-\d+-\d+\s+\d+:\d+:\d+)\s*([+-]\d\d)(\d\d)$s\d+-\d+-\d+\s+\d+:\d+:\d+$cC@s9tj|ƒ}|dkrZtj|ƒdk	rCtd|ƒ‚qZtd|dƒ‚n|jdƒ}t|jdƒƒt|jdƒƒ}}t|ƒdks²|dkrÛtd	|jdƒ|jdƒƒ‚n|d
|d}tj	|dƒ}|d |d|f|d
}t
j|ƒ}||fS(scParse a patch-style date into a POSIX timestamp and offset.

    Inverse of format_patch_date.
    s)time data %r is missing a timezone offsets#time data %r does not match format s'%Y-%m-%d %H:%M:%S %z'iiiii<sinvalid timezone %ris%Y-%m-%d %H:%M:%SiiN(tRE_PATCHDATEtmatchRtRE_PATCHDATE_NOOFFSETRtgroupR
tabsRRRR(tdate_strR'tsecs_strtoffset_hourstoffset_minsRttm_timeR$((s4/usr/lib/python2.7/dist-packages/bzrlib/timestamp.pytparse_patch_date‡s"


+#!(t
__future__RRRtretbzrlibRRRR%tcompileR&R(R0(((s4/usr/lib/python2.7/dist-packages/bzrlib/timestamp.pyt<module>s+	(

Copyright © 2017 || Recoded By Mr.Bumblebee