Package entropy :: Module tools

Module tools

source code


Author: Fabio Erculiani <lxnay@sabayonlinux.org>

Contact: lxnay@sabayonlinux.org

Copyright: Fabio Erculiani

License: GPL-2

Entropy miscellaneous tools module. In this module are enclosed all the miscellaneous functions used arount the Entropy codebase.

Functions
bool
is_root()
Return whether running process has root priviledges.
source code
bool
is_user_in_entropy_group(uid=None)
Return whether UID or given UID (through uid keyword argument) is in the "entropy" group (see entropy.const.etpConst['sysgroup']).
source code
int
get_uid_from_user(username)
Return UID for given username or -1 if not available.
source code
int
get_gid_from_group(groupname)
Return GID value for given system group name if exists, otherwise return -1.
source code
string or None
get_user_from_uid(uid)
Return username belonging to given system UID.
source code
string or None
get_group_from_gid(gid)
Return group name belonging to given system GID
source code
 
kill_threads()
Call entropy.const's const_kill_threads() method.
source code
 
print_traceback(f=None)
Function called by Entropy when an exception occurs with the aim to give user a clue of what went wrong.
source code
string
get_traceback()
Return last available Python traceback.
source code
string
print_exception(returndata=False)
Print last Python exception and frame variables values (if available) to stdout.
source code
string or bool
get_remote_data(url, timeout=5)
Fetch data at given URL (all the ones supported by Python urllib) and return it.
source code
bool
is_supported_image_file(path)
Return whether passed image file path "path" references a valid image file.
source code
bool
is_april_first()
Return whether today is April, 1st.
source code
 
add_proxy_opener(module, data)
Add proxy opener to urllib module.
source code
bool
is_valid_ascii(string)
Return whether passed string only contains valid ASCII characters.
source code
 
is_valid_unicode(string)
Return whether passed string is unicode.
source code
bool
is_valid_email(email)
Return whether passed string is contains a valid email address.
source code
bool
islive()
Return whether System is running in Live mode (off a CD/DVD).
source code
int
get_file_size(file_path)
Return size of given path passed in "file_path".
source code
int
sum_file_sizes(file_list)
Return file size sum of given list of paths.
source code
bool
check_required_space(mountpoint, bytes_required)
Check available space in mount point and if it satisfies the amount of required bytes given.
source code
 
getstatusoutput(cmd)
Return (status, output) of executing cmd in a shell.
source code
bool
movefile(src, dest, src_basedir=None)
Move a file from source to destination in an atomic way.
source code
 
ebeep(count=5)
docstring_title
source code
 
application_lock_check(gentle=False)
docstring_title
source code
 
get_random_number()
docstring_title
source code
 
split_indexable_into_chunks(mystr, chunk_len)
docstring_title
source code
 
countdown(secs=5, what='Counting...', back=False)
docstring_title
source code
 
md5sum(filepath)
docstring_title
source code
 
sha512(filepath)
docstring_title
source code
 
sha256(filepath)
docstring_title
source code
 
sha1(filepath)
docstring_title
source code
 
md5sum_directory(directory)
docstring_title
source code
 
md5obj_directory(directory)
docstring_title
source code
 
uncompress_file(file_path, destination_path, opener)
docstring_title
source code
 
compress_file(file_path, destination_path, opener, compress_level=None)
docstring_title
source code
 
compress_files(dest_file, files_to_compress, compressor='bz2')
docstring_title
source code
 
universal_uncompress(compressed_file, dest_path, catch_empty=False)
docstring_title
source code
 
unpack_gzip(gzipfilepath)
docstring_title
source code
 
unpack_bzip2(bzip2filepath)
docstring_title
source code
 
backup_client_repository()
docstring_title
source code
 
aggregate_edb(tbz2file, dbfile)
docstring_title
source code
 
extract_edb(tbz2file, dbpath=None)
docstring_title
source code
 
locate_edb(fileobj)
docstring_title
source code
 
remove_edb(tbz2file, savedir)
docstring_title
source code
 
create_md5_file(filepath)
docstring_title
source code
 
create_sha512_file(filepath)
docstring_title
source code
 
create_sha256_file(filepath)
docstring_title
source code
 
create_sha1_file(filepath)
docstring_title
source code
 
compare_md5(filepath, checksum)
docstring_title
source code
 
compare_sha512(filepath, checksum)
docstring_title
source code
 
compare_sha256(filepath, checksum)
docstring_title
source code
 
compare_sha1(filepath, checksum)
docstring_title
source code
 
md5string(string)
docstring_title
source code
 
generic_file_content_parser(filepath)
docstring_title
source code
 
allocate_masked_file(maskfile, fromfile)
docstring_title
source code
 
isjustpkgname(mypkg)
docstring_title
source code
 
ververify(myverx, silent=1)
docstring_title
source code
Integer
isvalidatom(myatom, allow_blockers=True)
Check to see if a depend atom is valid
source code
 
catsplit(mydep)
docstring_title
source code
String
get_operator(mydep)
Return the operator used in a depstring.
source code
Integer
isjustname(mypkg)
Checks to see if the depstring is only the package name (no version parts)
source code
Integer
isspecific(mypkg)
Checks to see if a package is in category/package-version or package-version format, possibly returning a cached result.
source code
 
catpkgsplit(mydata, silent=1)
Takes a Category/Package-Version-Rev and returns a list of each.
source code
 
pkgsplit(mypkg, silent=1)
docstring_title
source code
String
dep_getkey(mydepx)
Return the category/package-name of a depstring.
source code
String
dep_getcpv(mydep)
Return the category-package-version with any operators/slot specifications stripped off
source code
String
dep_getslot(mydep)
# Imported from portage.dep # $Id: dep.py 11281 2008-07-30 06:12:19Z zmedico $
source code
List
dep_getusedeps(depend)
# Imported from portage.dep # $Id: dep.py 11281 2008-07-30 06:12:19Z zmedico $
source code
 
remove_usedeps(depend)
docstring_title
source code
 
remove_slot(mydep)
# Imported from portage.dep # $Id: dep.py 11281 2008-07-30 06:12:19Z zmedico $
source code
 
remove_revision(ver)
docstring_title
source code
 
remove_tag(mydep)
docstring_title
source code
 
remove_entropy_revision(mydep)
docstring_title
source code
 
dep_get_entropy_revision(mydep)
docstring_title
source code
 
dep_get_spm_revision(mydep)
docstring_title
source code
 
dep_get_match_in_repos(mydep)
docstring_title
source code
 
dep_gettag(mydep)
Retrieve the slot on a depend.
source code
 
remove_package_operators(atom)
docstring_title
source code
 
compare_versions(ver1, ver2)
docstring_title
source code
 
entropy_compare_versions(listA, listB) source code
 
g_n_w_cmp(a, b) source code
list
get_newer_version(versions)
Return a sorted list of versions
source code
list
get_entropy_newer_version(versions)
Sort a list of entropy package versions.
source code
 
isnumber(x)
docstring_title
source code
 
istextfile(filename, blocksize=512)
docstring_title
source code
 
istext(mystring)
docstring_title
source code
 
filter_duplicated_entries(alist)
docstring_title
source code
 
escape(*args)
docstring_title
source code
 
escape_single(x)
docstring_title
source code
 
unescape(val)
docstring_title
source code
 
unescape_list(*args)
docstring_title
source code
 
spliturl(url)
docstring_title
source code
 
compress_tar_bz2(storepath, pathtocompress)
docstring_title
source code
 
spawn_function(f, *args, **kwds)
docstring_title
source code
 
uncompress_tar_bz2(filepath, extractPath=None, catchEmpty=False)
docstring_title # FIXME: rename this and make bz2 independent
source code
 
bytes_into_human(xbytes)
docstring_title
source code
 
get_file_unix_mtime(path)
docstring_title
source code
 
get_random_temp_file()
docstring_title
source code
 
get_file_timestamp(path)
docstring_title
source code
 
convert_unix_time_to_human_time(unixtime)
docstring_title
source code
 
convert_unix_time_to_datetime(unixtime)
docstring_title
source code
 
get_current_unix_time()
docstring_title
source code
 
get_year()
docstring_title
source code
 
convert_seconds_to_fancy_output(seconds)
docstring_title
source code
 
cleanup(toCleanDirs=None)
docstring_title
source code
 
flatten(l, ltypes=(<type 'list'>, <type 'tuple'>))
docstring_title
source code
 
read_repositories_conf()
docstring_title
source code
 
write_ordered_repositories_entries(ordered_repository_list)
docstring_title
source code
 
save_repository_settings(repodata, remove=False, disable=False, enable=False)
docstring_title
source code
 
write_parameter_to_file(config_file, name, data)
docstring_title
source code
 
write_new_branch(branch)
docstring_title
source code
 
is_entropy_package_file(tbz2file)
docstring_title
source code
 
is_valid_string(string)
docstring_title
source code
 
is_valid_path(path)
docstring_title
source code
 
is_valid_md5(myhash)
docstring_title
source code
 
open_buffer()
docstring_title
source code
 
seek_till_newline(f)
docstring_title
source code
 
read_elf_class(elf_file)
docstring_title
source code
 
is_elf_file(elf_file)
docstring_title
source code
string
resolve_dynamic_library(library, requiring_executable)
Resolve given library name (as contained into ELF metadata) to a library path.
source code
 
read_elf_dynamic_libraries(elf_file)
docstring_title
source code
 
read_elf_broken_symbols(elf_file)
docstring_title
source code
 
read_elf_linker_paths(elf_file)
docstring_title
source code
 
xml_from_dict_extended(dictionary)
docstring_title
source code
 
dict_from_xml_extended(xml_string)
docstring_title
source code
 
xml_from_dict(dictionary)
docstring_title
source code
 
dict_from_xml(xml_string)
docstring_title
source code
 
create_package_filename(category, name, version, package_tag)
docstring_title
source code
 
create_package_atom_string(category, name, version, package_tag)
docstring_title
source code
 
extract_packages_from_set_file(filepath)
docstring_title
source code
 
collect_linker_paths()
docstring_title
source code
 
collect_paths()
docstring_title
source code
Variables
  ver_regexp = re.compile(r'^(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(...
  suffix_regexp = re.compile(r'^(alpha|beta|rc|pre|p)(\d*)$')
  suffix_value = {'alpha': -4, 'beta': -3, 'p': 0, 'pre': -2, 'r...
  endversion_keys = ['pre', 'p', 'alpha', 'beta', 'rc']
  valid_category = re.compile(r'^\w[\w-]*')
  invalid_atom_chars_regexp = re.compile(r'[\(\)\|@]')
  dep_revmatch = re.compile(r'^r[0-9]')
  mappings = {' ': '+', '"': '""', '\'': '\'\''}
  readelf_avail_check = False
  ldd_avail_check = False
  __package__ = 'entropy'
Function Details

is_root()

source code 

Return whether running process has root priviledges.

Returns: bool
root priviledges

is_user_in_entropy_group(uid=None)

source code 

Return whether UID or given UID (through uid keyword argument) is in the "entropy" group (see entropy.const.etpConst['sysgroup']).

Parameters:
  • uid (int) - valid system uid
Returns: bool
True, if UID is in the "entropy" group

get_uid_from_user(username)

source code 

Return UID for given username or -1 if not available.

Parameters:
  • username (string) - valid system username
Returns: int
UID if username is valid, otherwise -1

get_gid_from_group(groupname)

source code 

Return GID value for given system group name if exists, otherwise return -1.

Parameters:
  • groupname (string) - valid system group
Returns: int
resolved GID or -1 if not available

get_user_from_uid(uid)

source code 

Return username belonging to given system UID.

Parameters:
  • uid (int) - valid system UID
Returns: string or None
username

get_group_from_gid(gid)

source code 

Return group name belonging to given system GID

Parameters:
  • gid (int) - valid system GID
Returns: string or None
group name

kill_threads()

source code 

Call entropy.const's const_kill_threads() method. Service function available also here.

print_traceback(f=None)

source code 

Function called by Entropy when an exception occurs with the aim to give user a clue of what went wrong.

Parameters:
  • f (valid file handle) - write to f (file) object instead of stdout

get_traceback()

source code 

Return last available Python traceback.

Returns: string
traceback data

print_exception(returndata=False)

source code 

Print last Python exception and frame variables values (if available) to stdout.

Parameters:
  • returndata (bool) - do not print data but return
Returns: string
exception data

get_remote_data(url, timeout=5)

source code 

Fetch data at given URL (all the ones supported by Python urllib) and return it.

Parameters:
  • url (string) - URL string
  • timeout (int) - fetch timeout in seconds
Returns: string or bool
fetched data or False (when error occured)

is_supported_image_file(path)

source code 

Return whether passed image file path "path" references a valid image file. Currently supported image file types are: PNG, JPEG, BMP, GIF.

Parameters:
  • path (string) - path pointing to a possibly valid image file
Returns: bool
True if path references a valid image file

is_april_first()

source code 

Return whether today is April, 1st. Please keep the joke.

Returns: bool
True if April 1st

add_proxy_opener(module, data)

source code 

Add proxy opener to urllib module.

Parameters:
  • module (Python module) - urllib module
  • data (dict) - proxy settings

is_valid_ascii(string)

source code 

Return whether passed string only contains valid ASCII characters.

Parameters:
  • string (string) - string to test
Returns: bool
True if string contains pure ASCII

is_valid_unicode(string)

source code 

Return whether passed string is unicode.

Parameters:
  • string (string) - string to test
Returns:
True if string is unicode

is_valid_email(email)

source code 

Return whether passed string is contains a valid email address.

Parameters:
  • email (string) - string to test
Returns: bool
True if string is a valid email

islive()

source code 

Return whether System is running in Live mode (off a CD/DVD). See entropy.const.const_islive() for more information.

Returns: bool
True if System is running in Live mode

get_file_size(file_path)

source code 

Return size of given path passed in "file_path".

Parameters:
  • file_path (string) - path to an existing file
Returns: int
file size in bytes
Raises:
  • OSError - if file referenced in file_path is not available

sum_file_sizes(file_list)

source code 

Return file size sum of given list of paths.

Parameters:
  • file_list (list) - list of file paths
Returns: int
summed size in bytes

check_required_space(mountpoint, bytes_required)

source code 

Check available space in mount point and if it satisfies the amount of required bytes given.

Parameters:
  • mountpoint (string) - mount point
  • bytes_required (bool) - amount of bytes required to make function return True
Returns: bool
if True, required space is available

movefile(src, dest, src_basedir=None)

source code 

Move a file from source to destination in an atomic way.

Parameters:
  • src (string) - source path
  • dest (string) - destination path
  • src_basedir (string) - source path base directory, used to properly handle symlink under certain circumstances
Returns: bool
True, if file was moved successfully

ebeep(count=5)

source code 

docstring_title

Parameters:
  • count ()

application_lock_check(gentle=False)

source code 

docstring_title

Parameters:
  • gentle ()

get_random_number()

source code 

docstring_title

split_indexable_into_chunks(mystr, chunk_len)

source code 

docstring_title

Parameters:
  • mystr ()
  • chunk_len ()

countdown(secs=5, what='Counting...', back=False)

source code 

docstring_title

Parameters:
  • secs ()
  • what ()
  • back ()

md5sum(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

sha512(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

sha256(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

sha1(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

md5sum_directory(directory)

source code 

docstring_title

Parameters:
  • directory ()

md5obj_directory(directory)

source code 

docstring_title

Parameters:
  • directory ()

uncompress_file(file_path, destination_path, opener)

source code 

docstring_title

Parameters:
  • file_path ()
  • destination_path ()
  • opener ()

compress_file(file_path, destination_path, opener, compress_level=None)

source code 

docstring_title

Parameters:
  • file_path ()
  • destination_path ()
  • opener ()
  • compress_level ()

compress_files(dest_file, files_to_compress, compressor='bz2')

source code 

docstring_title

Parameters:
  • dest_file ()
  • files_to_compress ()
  • compressor ()

universal_uncompress(compressed_file, dest_path, catch_empty=False)

source code 

docstring_title

Parameters:
  • compressed_file ()
  • dest_path ()
  • catch_empty ()

unpack_gzip(gzipfilepath)

source code 

docstring_title

Parameters:
  • gzipfilepath ()

unpack_bzip2(bzip2filepath)

source code 

docstring_title

Parameters:
  • bzip2filepath ()

backup_client_repository()

source code 

docstring_title

aggregate_edb(tbz2file, dbfile)

source code 

docstring_title

Parameters:
  • tbz2file ()
  • dbfile ()

extract_edb(tbz2file, dbpath=None)

source code 

docstring_title

Parameters:
  • tbz2file ()
  • dbpath ()

locate_edb(fileobj)

source code 

docstring_title

Parameters:
  • fileobj ()

remove_edb(tbz2file, savedir)

source code 

docstring_title

Parameters:
  • tbz2file ()
  • savedir ()

create_md5_file(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

create_sha512_file(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

create_sha256_file(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

create_sha1_file(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

compare_md5(filepath, checksum)

source code 

docstring_title

Parameters:
  • filepath ()
  • checksum ()

compare_sha512(filepath, checksum)

source code 

docstring_title

Parameters:
  • filepath ()
  • checksum ()

compare_sha256(filepath, checksum)

source code 

docstring_title

Parameters:
  • filepath ()
  • checksum ()

compare_sha1(filepath, checksum)

source code 

docstring_title

Parameters:
  • filepath ()
  • checksum ()

md5string(string)

source code 

docstring_title

Parameters:
  • string ()

generic_file_content_parser(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

allocate_masked_file(maskfile, fromfile)

source code 

docstring_title

Parameters:
  • maskfile ()
  • fromfile ()

isjustpkgname(mypkg)

source code 

docstring_title

Parameters:
  • mypkg ()

ververify(myverx, silent=1)

source code 

docstring_title

Parameters:
  • myverx ()
  • silent ()

isvalidatom(myatom, allow_blockers=True)

source code 

Check to see if a depend atom is valid

Example usage:

>>> isvalidatom('media-libs/test-3.0')
0
>>> isvalidatom('>=media-libs/test-3.0')
1
Parameters:
  • atom (String) - The depend atom to check against
Returns: Integer
One of the following: 1) 0 if the atom is invalid 2) 1 if the atom is valid

catsplit(mydep)

source code 

docstring_title

Parameters:
  • mydep ()

get_operator(mydep)

source code 

Return the operator used in a depstring.

Example usage:

>>> from portage.dep import *
>>> get_operator(">=test-1.0")
'>='
Parameters:
  • mydep (String) - The dep string to check
Returns: String
The operator. One of: '~', '=', '>', '<', '=*', '>=', or '<='

isjustname(mypkg)

source code 

Checks to see if the depstring is only the package name (no version parts)

Example usage:

>>> isjustname('media-libs/test-3.0')
0
>>> isjustname('test')
1
>>> isjustname('media-libs/test')
1
Parameters:
  • mypkg - The package atom to check
  • mypkg - String
Returns: Integer
One of the following: 1) 0 if the package string is not just the package name 2) 1 if it is

isspecific(mypkg)

source code 

Checks to see if a package is in category/package-version or package-version format, possibly returning a cached result.

Example usage:

>>> isspecific('media-libs/test')
0
>>> isspecific('media-libs/test-3.0')
1
Parameters:
  • mypkg (String) - The package depstring to check against
Returns: Integer
One of the following: 1) 0 if the package string is not specific 2) 1 if it is

catpkgsplit(mydata, silent=1)

source code 

Takes a Category/Package-Version-Rev and returns a list of each.

Parameters:
  • mydata (string) - Data to split
  • silent (Boolean (integer)) - suppress error messages
Returns:
  1. If each exists, it returns [cat, pkgname, version, rev]
  2. If cat is not specificed in mydata, cat will be "null"
  3. if rev does not exist it will be '-r0'
  4. If cat is invalid (specified but has incorrect syntax) an InvalidData Exception will be thrown

pkgsplit(mypkg, silent=1)

source code 

docstring_title

Parameters:
  • mypkg ()
  • silent=1 ()

dep_getkey(mydepx)

source code 

Return the category/package-name of a depstring.

Example usage:

>>> dep_getkey('media-libs/test-3.0')
'media-libs/test'
Parameters:
  • mydep (String) - The depstring to retrieve the category/package-name of
Returns: String
The package category/package-version

dep_getcpv(mydep)

source code 

Return the category-package-version with any operators/slot specifications stripped off

Example usage:

>>> dep_getcpv('>=media-libs/test-3.0')
'media-libs/test-3.0'
Parameters:
  • mydep (String) - The depstring
Returns: String
The depstring with the operator removed

dep_getslot(mydep)

source code 

# Imported from portage.dep # $Id: dep.py 11281 2008-07-30 06:12:19Z zmedico $

Retrieve the slot on a depend.

Example usage:

>>> dep_getslot('app-misc/test:3')
'3'
Parameters:
  • mydep (String) - The depstring to retrieve the slot of
Returns: String
The slot

dep_getusedeps(depend)

source code 

# Imported from portage.dep # $Id: dep.py 11281 2008-07-30 06:12:19Z zmedico $

Pull a listing of USE Dependencies out of a dep atom.

Example usage:

>>> dep_getusedeps('app-misc/test:3[foo,-bar]')
('foo', '-bar')
Parameters:
  • depend (String) - The depstring to process
Returns: List
List of use flags ( or [] if no flags exist )

remove_usedeps(depend)

source code 

docstring_title

Parameters:
  • depend ()

remove_slot(mydep)

source code 


# Imported from portage.dep
# $Id: dep.py 11281 2008-07-30 06:12:19Z zmedico $

Removes dep components from the right side of an atom:
        * slot
        * use
        * repo

remove_revision(ver)

source code 

docstring_title

Parameters:
  • ver ()

remove_tag(mydep)

source code 

docstring_title

Parameters:
  • mydep ()

remove_entropy_revision(mydep)

source code 

docstring_title

Parameters:
  • mydep ()

dep_get_entropy_revision(mydep)

source code 

docstring_title

Parameters:
  • mydep ()

dep_get_spm_revision(mydep)

source code 

docstring_title

Parameters:
  • mydep ()

dep_get_match_in_repos(mydep)

source code 

docstring_title

Parameters:
  • mydep ()

dep_gettag(mydep)

source code 

Retrieve the slot on a depend.

Example usage:

>>> dep_gettag('app-misc/test#2.6.23-sabayon-r1')
'2.6.23-sabayon-r1'

remove_package_operators(atom)

source code 

docstring_title

Parameters:
  • atom ()

compare_versions(ver1, ver2)

source code 

docstring_title

Parameters:
  • ver1 ()
  • ver2 ()

get_newer_version(versions)

source code 

Return a sorted list of versions

Parameters:
  • versions (list) - input version list
Returns: list
sorted version list

get_entropy_newer_version(versions)

source code 

Sort a list of entropy package versions.

Parameters:
  • versions (list) - list of package versions
Returns: list
sorted list

isnumber(x)

source code 

docstring_title

Parameters:
  • x ()

istextfile(filename, blocksize=512)

source code 

docstring_title

Parameters:
  • filename ()
  • blocksize ()

istext(mystring)

source code 

docstring_title

Parameters:
  • s ()

filter_duplicated_entries(alist)

source code 

docstring_title

Parameters:
  • alist ()

escape(*args)

source code 

docstring_title

Parameters:
  • *args ()

escape_single(x)

source code 

docstring_title

Parameters:
  • x ()

unescape(val)

source code 

docstring_title

Parameters:
  • val ()

unescape_list(*args)

source code 

docstring_title

Parameters:
  • *args ()

spliturl(url)

source code 

docstring_title

Parameters:
  • url ()

compress_tar_bz2(storepath, pathtocompress)

source code 

docstring_title

Parameters:
  • storepath ()
  • pathtocompress ()

spawn_function(f, *args, **kwds)

source code 

docstring_title

Parameters:
  • f ()
  • *args ()
  • **kwds ()

uncompress_tar_bz2(filepath, extractPath=None, catchEmpty=False)

source code 

docstring_title # FIXME: rename this and make bz2 independent

Parameters:
  • filepath ()
  • extractPath ()
  • catchEmpty ()

bytes_into_human(xbytes)

source code 

docstring_title

Parameters:
  • xbytes ()

get_file_unix_mtime(path)

source code 

docstring_title

Parameters:
  • path ()

get_random_temp_file()

source code 

docstring_title

get_file_timestamp(path)

source code 

docstring_title

Parameters:
  • path ()

convert_unix_time_to_human_time(unixtime)

source code 

docstring_title

Parameters:
  • unixtime ()

convert_unix_time_to_datetime(unixtime)

source code 

docstring_title

Parameters:
  • unixtime ()

get_current_unix_time()

source code 

docstring_title

get_year()

source code 

docstring_title

convert_seconds_to_fancy_output(seconds)

source code 

docstring_title

Parameters:
  • seconds ()

cleanup(toCleanDirs=None)

source code 

docstring_title

Parameters:
  • toCleanDirs ()

flatten(l, ltypes=(<type 'list'>, <type 'tuple'>))

source code 

docstring_title

Parameters:
  • l ()
  • ltypes ()
  • tuple ()

read_repositories_conf()

source code 

docstring_title

write_ordered_repositories_entries(ordered_repository_list)

source code 

docstring_title

Parameters:
  • ordered_repository_list ()

save_repository_settings(repodata, remove=False, disable=False, enable=False)

source code 

docstring_title

Parameters:
  • repodata ()
  • remove ()
  • disable ()
  • enable ()

write_parameter_to_file(config_file, name, data)

source code 

docstring_title

Parameters:
  • config_file ()
  • name ()
  • data ()

write_new_branch(branch)

source code 

docstring_title

Parameters:
  • branch ()

is_entropy_package_file(tbz2file)

source code 

docstring_title

Parameters:
  • tbz2file ()

is_valid_string(string)

source code 

docstring_title

Parameters:
  • string ()

is_valid_path(path)

source code 

docstring_title

Parameters:
  • path ()

is_valid_md5(myhash)

source code 

docstring_title

Parameters:
  • myhash ()

open_buffer()

source code 

docstring_title

seek_till_newline(f)

source code 

docstring_title

Parameters:
  • f ()

read_elf_class(elf_file)

source code 

docstring_title

Parameters:
  • elf_file ()

is_elf_file(elf_file)

source code 

docstring_title

Parameters:
  • elf_file ()

resolve_dynamic_library(library, requiring_executable)

source code 

Resolve given library name (as contained into ELF metadata) to a library path.

Parameters:
  • library (string) - library name (as contained into ELF metadata)
  • requiring_executable (string) - path to ELF object that contains the given library name
Returns: string
resolved library path

read_elf_dynamic_libraries(elf_file)

source code 

docstring_title

Parameters:
  • elf_file ()

read_elf_broken_symbols(elf_file)

source code 

docstring_title

Parameters:
  • elf_file ()

read_elf_linker_paths(elf_file)

source code 

docstring_title

Parameters:
  • elf_file ()

xml_from_dict_extended(dictionary)

source code 

docstring_title

Parameters:
  • dictionary ()

dict_from_xml_extended(xml_string)

source code 

docstring_title

Parameters:
  • xml_string ()

xml_from_dict(dictionary)

source code 

docstring_title

Parameters:
  • dictionary ()

dict_from_xml(xml_string)

source code 

docstring_title

Parameters:
  • xml_string ()

create_package_filename(category, name, version, package_tag)

source code 

docstring_title

Parameters:
  • category ()
  • name ()
  • version ()
  • package_tag ()

create_package_atom_string(category, name, version, package_tag)

source code 

docstring_title

Parameters:
  • category ()
  • name ()
  • version ()
  • package_tag ()

extract_packages_from_set_file(filepath)

source code 

docstring_title

Parameters:
  • filepath ()

collect_linker_paths()

source code 

docstring_title

collect_paths()

source code 

docstring_title


Variables Details

ver_regexp

Value:
re.compile(r'^(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\
d*)*)(-r(\d+))?$')

suffix_value

Value:
{'alpha': -4, 'beta': -3, 'p': 0, 'pre': -2, 'rc': -1}