Files
RASCSI/src/web/settings.py
Daniel Markstedt 7e546e2cb8 ID reservation in Web UI (#416)
* Remove dead code

* Clean up indentation

* Cleanup

* Move socket commands into its own file

* Move non-rascsi command methods into its own file

* Refactoring

* Bring back list_config_files

* Cleanup

* Cleanup of status messages

* Remove unused libraries

* Resolve pylint warnings

* Resolve pylint warnings

* Remove unused library

* Resolve pylint warnings

* Clean up status messages

* Add requests lib to requirements.txt

* Clean up status messages

* Resolve interpolation warnings for logging

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Cleanup

* Add html/head/body tags to the base document

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Resolve pylint warnings

* Add .pylintrc and suppress warnings for the generated protobuf module

* Resolve pylint warnings

* Clean up docstrings

* Fix error

* Cleanup

* Add info on pylint to README

* Store .pylintrc in parent dir to allow other Python packages to use it

* Tidy index.html

* Cleanup

* Resolve jinja-ninja warnings

* Cleanup

* Cleanup

* Cleanup

* Cleanup

* Cleanup

* Save and load id reservations in config file

* Reserve and unreserve in the web ui

* TODO

* Add backwards compatibility with 21.10 config files

* Comment cleanup

* Save and load reservation memos into the config file

* Cleanup

* Resolve pylint warnings

* Fix bugs

* Fix bug

* Fix bugs

* Cleanup

* Fix typo

* Fix successful return clause

* Cleanup

* Fix bugs
2021-11-06 21:11:17 -05:00

31 lines
988 B
Python

"""
Constant definitions used by other modules
"""
from os import getenv, getcwd
# TODO: Make HOME_DIR portable when running rascsi-web
# as a service, since the HOME env variable doesn't get set then.
HOME_DIR = getenv("HOME", "/home/pi")
CFG_DIR = f"{HOME_DIR}/.config/rascsi/"
AFP_DIR = f"{HOME_DIR}/afpshare"
WEB_DIR = getcwd()
MAX_FILE_SIZE = getenv("MAX_FILE_SIZE", str(1024 * 1024 * 1024 * 4)) # 4gb
ARCHIVE_FILE_SUFFIX = "zip"
CONFIG_FILE_SUFFIX = "json"
# File ending used for drive properties files
PROPERTIES_SUFFIX = "properties"
# The file name of the default config file that loads when rascsi-web starts
DEFAULT_CONFIG = f"default.{CONFIG_FILE_SUFFIX}"
# File containing canonical drive properties
DRIVE_PROPERTIES_FILE = WEB_DIR + "/drive_properties.json"
REMOVABLE_DEVICE_TYPES = ("SCCD", "SCRM", "SCMO")
# The RESERVATIONS list is used to keep track of the reserved ID memos.
# Initialize with a list of 8 empty strings.
RESERVATIONS = ["" for x in range(0, 8)]