"""
This module provides constants used throughout the maestral, the GUI and CLI. It should
be kept free of memory heavy imports.
"""
# system imports
import platform
from enum import Enum
try:
from importlib.resources import path
except ImportError:
from importlib_resources import path # type: ignore
# app
[docs]BUNDLE_ID = "com.samschott.maestral"
[docs]APP_ICON_PATH = path("maestral.resources", "maestral.png").__enter__()
[docs]ENV = {"PYTHONOPTIMIZE": "2", "LC_CTYPE": "UTF-8"}
# sync
[docs]OLD_REV_FILE = ".maestral"
[docs]MIGNORE_FILE = ".mignore"
[docs]FILE_CACHE = ".maestral.cache"
[docs]EXCLUDED_FILE_NAMES = frozenset(
[
"desktop.ini",
"Thumbs.db",
"thumbs.db",
".DS_Store",
".ds_tore",
"Icon\r",
"icon\r",
".com.apple.timemachine.supported",
".dropbox",
".dropbox.attr",
".dropbox.cache",
FILE_CACHE,
OLD_REV_FILE,
]
)
[docs]EXCLUDED_DIR_NAMES = frozenset([".dropbox.cache", FILE_CACHE])
# state messages
[docs]DISCONNECTED = "Connection lost"
[docs]CONNECTING = "Connecting..."
[docs]SYNC_ERROR = "Sync error"
# file status enum
[docs]class FileStatus(Enum):
"""Enumeration of sync status"""
[docs] Unwatched = "unwatched"
[docs] Uploading = "uploading"
[docs] Downloading = "downloading"
# platform detection
[docs]IS_MACOS = platform.system() == "Darwin"
[docs]IS_LINUX = platform.system() == "Linux"
# keys
[docs]DROPBOX_APP_KEY = "2jmbq42w7vof78h"
# urls
[docs]GITHUB_RELEASES_API = "https://api.github.com/repos/samschott/maestral/releases"