backend.globaleaks.utils.utility

Module Contents

Functions

get_distribution_codename()
fix_file_permissions(path, uid, gid, dchmod, fchmod) Recursively fix file permissions on a given path
uuid4() This function returns a uuid4.
sum_dicts(*dicts)
deferred_sleep(timeout)
msdos_encode(s) This functions returns a new string with all occurrences of newlines
iso_strf_time(d)
datetime_null()
return:a utc datetime object representing a null date
datetime_now()
return:a utc datetime object for the current time
datetime_never()
return:a utc datetime object representing the 1st January 3000
get_expiration(days)
return:a utc datetime object representing an expiration time calculated as the current date + N days
is_expired(check_date, seconds=0, minutes=0, hours=0, days=0)
datetime_to_ISO8601(date) Convert a datetime into ISO8601 date
datetime_to_pretty_str(date) Print a datetime in pretty formatted str format
datetime_to_day_str(date, tz=0) Print a ISO8601 in DD/MM/YYYY formatted str
ISO8601_to_pretty_str(isodate, tz=0) convert a ISO8601 in pretty formatted str format
iso_year_start(iso_year) Returns the gregorian calendar date of the first day of the given ISO year
iso_to_gregorian(iso_year, iso_week, iso_day) Returns gregorian calendar date for the given ISO year, week and day
bytes_to_pretty_str(b)
backend.globaleaks.utils.utility.get_distribution_codename()[source]
backend.globaleaks.utils.utility.fix_file_permissions(path, uid, gid, dchmod, fchmod)[source]

Recursively fix file permissions on a given path

backend.globaleaks.utils.utility.uuid4()[source]

This function returns a uuid4.

backend.globaleaks.utils.utility.sum_dicts(*dicts)[source]
backend.globaleaks.utils.utility.deferred_sleep(timeout)[source]
backend.globaleaks.utils.utility.msdos_encode(s)[source]

This functions returns a new string with all occurrences of newlines prepended with a carriage return.

backend.globaleaks.utils.utility.iso_strf_time(d)[source]
backend.globaleaks.utils.utility.datetime_null()[source]
Returns:a utc datetime object representing a null date
backend.globaleaks.utils.utility.datetime_now()[source]
Returns:a utc datetime object for the current time
backend.globaleaks.utils.utility.datetime_never()[source]
Returns:a utc datetime object representing the 1st January 3000
backend.globaleaks.utils.utility.get_expiration(days)[source]
Returns:a utc datetime object representing an expiration time calculated as the current date + N days
backend.globaleaks.utils.utility.is_expired(check_date, seconds=0, minutes=0, hours=0, days=0)[source]
backend.globaleaks.utils.utility.datetime_to_ISO8601(date)[source]

Convert a datetime into ISO8601 date

backend.globaleaks.utils.utility.datetime_to_pretty_str(date)[source]

Print a datetime in pretty formatted str format

backend.globaleaks.utils.utility.datetime_to_day_str(date, tz=0)[source]

Print a ISO8601 in DD/MM/YYYY formatted str

backend.globaleaks.utils.utility.ISO8601_to_pretty_str(isodate, tz=0)[source]

convert a ISO8601 in pretty formatted str format

backend.globaleaks.utils.utility.iso_year_start(iso_year)[source]

Returns the gregorian calendar date of the first day of the given ISO year

backend.globaleaks.utils.utility.iso_to_gregorian(iso_year, iso_week, iso_day)[source]

Returns gregorian calendar date for the given ISO year, week and day

backend.globaleaks.utils.utility.bytes_to_pretty_str(b)[source]