OpenQuizz
Une application de gestion des contenus pédagogiques
|
Data Structures | |
class | ProcessStreamAdapter |
class | Serializable |
class | Traversable |
class | tzoffset |
Functions | |
def | mode_str_to_int (modestr) |
def | get_object_type_by_name (object_type_name) |
def | utctz_to_altz (utctz) |
def | altz_to_utctz_str (altz) |
def | verify_utctz (offset) |
def | from_timestamp (timestamp, tz_offset) |
def | parse_date (string_date) |
def | parse_actor_and_date (line) |
Variables | |
ZERO | |
utc | |
def git.objects.util.altz_to_utctz_str | ( | altz | ) |
As above, but inverses the operation, returning a string that can be used in commit objects
def git.objects.util.from_timestamp | ( | timestamp, | |
tz_offset | |||
) |
Converts a timestamp + tz_offset into an aware datetime instance.
def git.objects.util.get_object_type_by_name | ( | object_type_name | ) |
:return: type suitable to handle the given object type name. Use the type to create new instances. :param object_type_name: Member of TYPES :raise ValueError: In case object_type_name is unknown
def git.objects.util.mode_str_to_int | ( | modestr | ) |
:param modestr: string like 755 or 644 or 100644 - only the last 6 chars will be used :return: String identifying a mode compatible to the mode methods ids of the stat module regarding the rwx permissions for user, group and other, special flags and file system flags, i.e. whether it is a symlink for example.
def git.objects.util.parse_actor_and_date | ( | line | ) |
Parse out the actor (author or committer) info from a line like:: author Tom Preston-Werner <tom@mojombo.com> 1191999972 -0700 :return: [Actor, int_seconds_since_epoch, int_timezone_offset]
def git.objects.util.parse_date | ( | string_date | ) |
Parse the given date as one of the following * aware datetime instance * Git internal format: timestamp offset * RFC 2822: Thu, 07 Apr 2005 22:13:13 +0200. * ISO 8601 2005-04-07T22:13:13 The T can be a space as well :return: Tuple(int(timestamp_UTC), int(offset)), both in seconds since epoch :raise ValueError: If the format could not be understood :note: Date can also be YYYY.MM.DD, MM/DD/YYYY and DD.MM.YYYY.
def git.objects.util.utctz_to_altz | ( | utctz | ) |
we convert utctz to the timezone in seconds, it is the format time.altzone returns. Git stores it as UTC timezone which has the opposite sign as well, which explains the -1 * ( that was made explicit here ) :param utctz: git utc timezone string, i.e. +0200
def git.objects.util.verify_utctz | ( | offset | ) |
:raise ValueError: if offset is incorrect :return: offset
utc |
ZERO |