borgend/locations.py

Mon, 17 Sep 2018 19:48:02 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 17 Sep 2018 19:48:02 -0500
changeset 118
aadd60a24bc8
parent 89
51cc2e25af38
permissions
-rw-r--r--

py2app is fucked up shit that couldn't find a packages with staring at it
with its name written on it, and instead takes them all, so include a long
list of modules to forcibly exclude to build a reasonably-sized app.

#
# 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