AES Encrypt/Decrypt Library
External Decrypt function
External Encrypt function
Serial(COM) Port Functions
Returns list of available serial ports
Database Classes Classes that save/load python content to/from the hard drive(or other means of non-volatile memory). Make sure to provide pickle-able data, no objects, classes or anything that might be hard to convert to a string Please do not use DatabaseEntry directly, nor DatabaseDictBase. Those are exposed for overloading purposes. Use DatabaseList, DatabaseDict or DatabaseOrderedDict!
Bases: py_knife.database.DatabaseDictBase
DatabaseDict class
Bases: py_knife.database.DatabaseEntry
Some Dictionary Specific Methods
Allows using clear method
Allows using items method
Allows using keys method
Allows using update method
Allows using values method
Bases: object
DatabaseEntry class
Deletes database file
External Load
Allows using pop method
Saves main to a file
Bases: py_knife.database.DatabaseEntry
DatabaseList class
Allows using append method
Allows using extend method
Allows using insert method
Bases: py_knife.database.DatabaseDictBase
DatabaseOrderedDict class
Allows using insert_after method
Allows using insert_before method
Collection of decorators to make our life a little easier Simple Decorator is based on a recipe from here: https://wiki.python.org/moin/PythonDecoratorLibrary
Decorator to perform multiple attempts
This decorator can be used to turn simple functions into well-behaved decorators, so long as the decorators are fairly simple. If a decorator expects a function and returns a function (no descriptors), and if it doesn’t modify function attributes or docstring, then it is eligible to use this. Simply apply @simple_decorator to your decorator and it will automatically preserve the docstring and function attributes of functions to which it is applied.
This module functionality consist of:
- File Manipulation Functions
- Directory Manipulation Functions
- File/Folder Memory Space/Size Functions
- Open/Write/Read File Functions
- Time Stamp Functions
Copying File :param source_file: Source File Path :param destination_file: Destination File Path :param permissions: Permissions string (for unix only) :param dos2unix: Conversion to unix format (for unix only) :return: True if copying is successful, False otherwise
Empty directory :param dir_path: Path of the directory :return: True if empty successful (such directory existed in the first place), False otherwise
Fetches files, specified by path/filter
Return free space in bytes Taken from here, slightly modified: http://stackoverflow.com/questions/51658/cross-platform-space-remaining-on-volume-using-python
Taken from here http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python
Creating directory :param dir_path: Path of the new directory :return: True if folder has been created, False if folder exists already
Creating empty file
Tries reading file. Returns false if failed
Taken from here http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python
Removing directory :param dir_path: Path of the directory :return: True if remove successful (such directory existed in the first place), False otherwise
Removes files, specified by path/filter
Tries to open file for writing
Tries writing file
Logger Class
Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. Passes Python2.7’s test suite and incorporates all the latest updates.
Reference links:
Bases: dict
Dictionary that remembers insertion order
and values equal to v (which defaults to None).
od.iteritems -> an iterator over the (key, value) items in od
od.itervalues -> an iterator over the values in od
If key is not found, d is returned if given, otherwise KeyError is raised.
Pairs are returned in LIFO order if last is true or FIFO order if false.
If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v
Pickle/Unpickle Functions
Pickle file
Unpickle file
Python Distribution Install Functions
Runs install inside of install
Web Upload Functions
Tries to open Upload File
Zip Archive Functions
Creates Zip Archive
Opens Zip Archive in order to extract files
Swiss Army Knife of Python