borgend/locations.py

Sun, 04 Feb 2018 01:36:59 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 04 Feb 2018 01:36:59 +0000
changeset 102
0d43cd568f3c
parent 89
51cc2e25af38
permissions
-rw-r--r--

Changed scheduler busylooping method, and decreased precision to 5 minutes:
if there are finite-horizon events in the queue, the scheduler thread will never
sleep longer than that. This is to quickly get back on track with the schedule
when the computer wakes up from sleep, if the sleep monitor is not working or
is not implemented for the particular operating system. However, if there are
only infinite-horizon events in the queue (meaning, DreamTime-scheduled events,
and the system is sleeping or "sleeping"), the scheduler will also sleep.
Hopefully this will also help the system stay properly asleep.

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