fancytools.os package¶
Submodules¶
fancytools.os.PathStr module¶
-
class
fancytools.os.PathStr.PathStr[source]¶ Bases:
streasy path-string handling and manipulation using os.path and shutil
Windows only: there is no need of transforming to - it will be done automatically when a PathStr instance is created
>>> p = PathStr.home() >>> print p.isdir() True >>> print p.exists() True >>> d_list = [p.join(x) for x in p.listdir()]
fancytools.os.StartMenuEntry module¶
-
class
fancytools.os.StartMenuEntry.StartMenuEntry(name, target, **kwargs)[source]¶ Bases:
objectthis class creates a shortcut for a given target in the start menu of the used os depending either system wide or user specific
kwargs description icon [path of the program icon] directory [start dir of the program], version [version number] description [of the program] console False -> hide console (only GUI applications) categories e.g. “Application;Science;Graphics;Office;” # Linux only >>> entry = StartMenuEntry('myLittleTest', 'www.python.org') >>> entry.create()
Now look for the entry in your start menu
>>> entry.remove()
fancytools.os.assignFtypeToPyFile module¶
-
fancytools.os.assignFtypeToPyFile.assignFtypeToPyFile(extension, args=(), mimetype=None, showTerminal=True)[source]¶ Connect a file extension to a python script
Example: We created a python file that can open ‘.da’ files The command we need to execute to open that is is: ‘python MY_PYTH_FILE.py -o MY_DA_FILE.da’
To be able to open these files with a simple double click run:
openExtensionWith(extension=’da’, args=(‘MY_PYTH_FILE.py’, ‘-o’))
OPTIONAL ARGUMENTS: args -> (...) additional arguments to be added after the pyFile
- mimetype (str) -> assign a MIMETYPE name to your file extension
- e.g. ‘daFile’
showTerminal (bool) -> True: open your program in a terminal
fancytools.os.copyTree module¶
fancytools.os.countLines module¶
fancytools.os.isAdmin module¶
fancytools.os.legalizeFilename module¶
fancytools.os.runAsAdmin module¶
fancytools.os.setup module¶
-
fancytools.os.setup.setup(package)[source]¶ a template for the python setup.py installer routine
- take setup information from the packages __init__.py file
- this way these informations, like...
- __email__
- __version__
- __depencies__
are still available after installation
exclude /tests*
create scripts from all files in /bin
- create the long description from
- /README.rst
- /CHANGES.rst
- /AUTHORS.rst
remove /build at the end