libka.utils namespace

Submodules

libka.utils.chop module

This module just provides a simple_abort_handler function to exit nice

libka.utils.chop.lchop(string, beginning)[source]

Removes the substring beginning from the left of string.

libka.utils.chop.rchop(string, ending)[source]

Removes the substring ending from the right of string.

libka.utils.get_orig_tarball_extension module

This module provides the get_orig_tarball_extension function, useful to find out the upstream tarball extension.

libka.utils.get_orig_tarball_extension.get_orig_tarball_extension(path)[source]

This function returns the extension for the given path. Examples: ` get_orig_tarball_extension('/my/file.odf') # returns 'odf' get_orig_tarball_extension('/my/file.tgz') # returns 'tgz' get_orig_tarball_extension('/my/file.tar.gz') # returns 'tar.gz' get_orig_tarball_extension('/my/file.orig.tar.gz') # returns 'tar.gz' `

libka.utils.get_orig_tarball_extension.main()[source]

quick test of function

libka.utils.python_debian_warnings module

This module just provides functions to silence python-debian warnings

libka.utils.python_debian_warnings.ignore_python_debian_warnings()[source]

Calling this function will prevent the stdout printing of warnings by python-debian library.

libka.utils.python_debian_warnings.reset_python_debian_warnings()[source]

Calling this function will reset the stdout printing of warnings by python-debian library. This function is meant to be used after calling ignore_python_debian_warnings() like this:

` ignore_python_debian_warnings() <code_that_is_going_to_produce_warnings_printed_on_stdout> reset_python_debian_warnings() `

libka.utils.simple_abort_handler module

This module just provides a simple_abort_handler function to exit nice

libka.utils.simple_abort_handler.simple_abort_handler(recv_signal, frame)[source]

Simple signal handler for Ctrl+C.

It just prints an ‘Aborted by user request’ message and exits the program with code 130.

See http://www.tldp.org/LDP/abs/html/exitcodes.html for more information about exit codes.

libka.utils.verify_signature module

This module provides the verify_signature function, useful to check upstream tarball signatures.

libka.utils.verify_signature.verify_signature(file_name, sig_file_name)[source]

This function verifies the signature of a file with debian/upstream/signing-key.asc