borgend/locations.py

Wed, 14 Feb 2018 15:23:39 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Wed, 14 Feb 2018 15:23:39 +0000
changeset 114
ad9fb3dd9fec
parent 89
51cc2e25af38
permissions
-rw-r--r--

Disable Notification Centre notifications.
They don't work reliably for some reason, and are in any case annoying
unless the display is somehow fine-tuned.

#
# Borgend by Tuomo Valkonen, 2018
#
# Detection of configuration file and log file locations.
#

import os
import platform

from . import branding

if platform.system()!='Darwin':
    import xdg
    cfgfile=os.path.join(xdg.XDG_CONFIG_HOME, branding.appname, "config.yaml")
    logs_dir=os.path.join(xdg.XDG_DATA_HOME, branding.appname, "logs")
else:
    import rumps
    __base=rumps.application_support(branding.appname)
    cfgfile=os.path.join(__base, "config.yaml")
    logs_dir=os.path.join(__base, "logs")

mercurial