XDG folders

Get XDG user or site folders

Some platforms require app author name. Linux doesn’t.

Take the (head) author name from the target package’s meta data and then slugify it. If that gives a wrong result, on a per author basis, would need a way to specify the correct author name

Since the target platform is POSIX, not losing sleep over this issue

Module private variables

logging_strict.util.xdg_folder.__all__: tuple[str, str, str] = ("DestFolderSite", "DestFolderUser", "_get_path_config")

Module exports

Module objects

class logging_strict.util.xdg_folder.DestFolderSite(appname, author_no_period=True, author_no_space=True, author_no_underscore=True, version=None, multipath=False)

XDG Site folders

Variables:
  • appname (str) – Package name

  • author_no_period (str) – Default True. True if should remove period from author name otherwise False

  • author_no_space (str) – Default True. True if should remove whitespace from author name otherwise False

  • author_no_underscore (str) – Default True. True if should remove underscore from author name otherwise False

  • version (str | None) – Default None. Possible to have version specific author information. Can specific version

  • multipath (bool | None) – Default False. Could retrieve all possible folders. True for multipath. False for first entry in multipath

property config_dir

Get XDG site config dir

Returns:

XDG site config dir

Return type:

str

property data_dir

Get XDG site data dir

Returns:

XDG site data dir

Return type:

str

class logging_strict.util.xdg_folder.DestFolderUser(appname: str, author_no_period=True, author_no_space=True, author_no_underscore=True, version=None, roaming=False, opinion=True)

XDG User folders

Variables:
  • appname (str) – Package name

  • author_no_period (str) – Default True. True if should remove period from author name otherwise False

  • author_no_space (str) – Default True. True if should remove whitespace from author name otherwise False

  • author_no_underscore (str) – Default True. True if should remove underscore from author name otherwise False

  • version (str | None) – Default None. Possible to have version specific author information. Can specific version

  • roaming (bool | None) – Default False. Only applicable to Windows

  • opinion (bool | None) – Default True. ??

property cache_dir

Get XDG user cache dir

Returns:

XDG user cache dir

Return type:

str

property config_dir

Get XDG user config dir

Returns:

XDG user config dir

Return type:

str

property data_dir

Get XDG user data dir

Returns:

XDG user data dir

Return type:

str

property log_dir

Get XDG user log dir

Returns:

XDG user log dir

Return type:

str

property state_dir

Get XDG user state dir

Returns:

XDG user state dir

Return type:

str