Hello world!
What version of libtextworker I want?
In the code above, we import the require function from the libtextworker.versioning module, then use it to "require" version 0.1.4 of libtextworker. This ensures that your project is using the library with version 0.1.4, nothing else.
Here's the require
function:
You can use this function for other packages, just make sure that the package has __version__
attribute.
There are many functions for your use: require_exact
, require_lower
, and even is_development_version
, is_development_version_from_project
for verions type-checking.
Imported projects for version checking/getting are placed in libtextworker.versioning.Requested
.
There is also a function called test_import
, which returns a boolean. The test result will be added in a variable called Importable
. You better use it before any (related) use of the target library
Explore variables
The top-level module has some useful attributes:
TOPLV_DIR
: top-level settings pathTHEMES_DIR
(str
):Defaults to
; where all themes for GUIs are placed~/.configs/textworker/themesEDITOR_DIR
(str
):Defauls to
; default configs directory for GUI editors~/.configs/textworker/editorconfigs/Importable
(dict[str, bool]
): An alias togeneral.Importable
, contains check results for Python modules.
In libtextworker.general module we have a variable called available_toolkits
(since 0.1.3), indicates supported GUI toolkits.
Choose what you want
Take a look at all library modules:
general
: Has functions that mostly about file/directory touch. They are born to make file operations easier.get_config
ported from texteditor, contains GetConfig class which is an advanced INI parser (json import/export ongoing), with backup, value aliases, and runtime update.versioning
: See above.interface.manager
: Contains ColorManager which handles GUI widgets color/fontinterface.colors
(since 0.1.4) orinterface._colors
(since 0.1.3) names some colors.subfolders in
interface
: GUIs support ('wx' for wxPython, 'tk' for Tkinter)
Packaging
Head over to this page.
Last updated