app_dirs
app_dirs
Application data directory and folder access utilities.
Resolve per-user application data paths and provide helpers for creating and opening the directory.
APP_NAME = 'TapMap'
module-attribute
README_TEXT = 'Place GeoIP .mmdb databases here.\n\nIf running in Docker, this folder is mapped from the host to /data in the container.\nRequired files:\n- GeoLite2-City.mmdb\n- GeoLite2-ASN.mmdb\n\nDownload (free, account required):\nhttps://dev.maxmind.com/geoip/geolite2-free-geolocation-data\n'
module-attribute
get_native_app_data_dir(app_name=APP_NAME)
Return the per-user application data directory for the current OS.
Windows: %APPDATA%\
Source code in app_dirs.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
ensure_app_data_dir(app_dir)
Create the application data directory and README.txt file when missing.
Source code in app_dirs.py
52 53 54 55 56 57 58 59 | |
ensure_native_app_data_dir(app_name=APP_NAME)
Return native app data directory and ensure it exists.
Source code in app_dirs.py
62 63 64 65 66 | |
open_folder(path)
Open a folder in the system file manager.
Returns:
| Name | Type | Description |
|---|---|---|
ok |
bool
|
True on success. |
message |
str
|
Status message suitable for UI. |
Source code in app_dirs.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |