Returns an object from a dot path.
Path can either be a full path, in which case the get_object function will try to import the module and follow the path. Or it can be a path relative to the object passed in as the second argument.
Example for full paths:
>>> get_object('os.path.join')
<function join at 0x1002d9ed8>
>>> get_object('tea.process')
<module 'tea.process' from 'tea/process/__init__.pyc'>
Example for relative paths when an object is passed in:
>>> import os
>>> get_object('path.join', os)
<function join at 0x1002d9ed8>
Recursively zip a directory
Parameters: |
|
---|
Extract a 7z archive
Create a 7z archive
Unzip the a complete zip archive into destination directory, or unzip a specific file(s) from the archive.
>>> output = os.path.join(os.getcwd(), 'output')
>>> # Archive can be an instance of a ZipFile class
>>> archive = zipfile.ZipFile('test.zip', 'r')
>>> # Or just a filename
>>> archive = 'test.zip'
>>> # Extracts all files
>>> unzip(archive, output)
>>> # Extract only one file
>>> unzip(archive, output, 'my_file.txt')
>>> # Extract a list of files
>>> unzip(archive, output, ['my_file1.txt', 'my_file2.txt'])
>>> unzip_file('test.zip', 'my_file.txt', output)
Parameters: |
|
---|
Performs encryption of provided data.
Decrypts provided data.
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
Do the UNIX double-fork magic
See Stevens’ “Advanced Programming in the UNIX Environment” for details (ISBN 0201563177) http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
Restart the daemon
You should override this method when you subclass Daemon.
It will be called after the process has been daemonized by start() or restart().
Start the daemon
Stop the daemon
Returns a bytes version of ‘s’, encoded as specified in ‘encoding’.
If strings_only is True, don’t convert (some) non-string-like objects.
Returns a unicode object representing ‘s’. Treats bytes using the ‘encoding’ codec.
If strings_only is True, don’t convert (some) non-string-like objects.