file_manager

Module Contents

Classes

Type

Create a collection of name/value pairs.

Functions

get_path_type_str(path_enum)

path(name[, file_type, custom_folder])

Get absolute path to resource, works for dev and for PyInstaller

folder_path([folder_name, resource_type])

Attributes

logger

file_manager.logger = "'file_manager'"[source]
class file_manager.Type(*args, **kwds)[source]

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

ProjectRoot[source]
ResourcesRoot[source]
Source[source]
UI[source]
Icons[source]
Docs[source]
Data[source]
file_manager.get_path_type_str(path_enum: Type)[source]
file_manager.path(name: str, file_type: Type = None, custom_folder: str = None)[source]

Get absolute path to resource, works for dev and for PyInstaller

file_manager.folder_path(folder_name: str = None, resource_type: Type = None)[source]