Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Update ubuntu-recentquicklists.py
Browse files Browse the repository at this point in the history
fixed: logfile & conf generated in home-directory, instead of script dir
  • Loading branch information
thirschbuechler committed Jun 23, 2016
1 parent d234cca commit 7382c98
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ubuntu-recentquicklists.py
Expand Up @@ -13,19 +13,22 @@
#LOG_PATH = '/home/'+username+'/logs/'
#LOG_PATH = '/var/log/' #file here needs to be manually created and chown respectively
#what the hell, just log in the same folder the script is in..
LOG_PATH = ''
Path=os.path.dirname(os.path.realpath(__file__))




def configread():#https://docs.python.org/3/library/configparser.html
global maxage, onlycritical, startupsplash, shortnagging, verboselogging, showfullpath
global Path
config = configparser.SafeConfigParser()
config.optionxform = lambda opt: opt#reason:
#https://github.com/earwig/git-repo-updater/commit/51cac2456201a981577fc2cf345a1cf8c11b8b2f



#open the config file
config.read("urq.conf")
config.read(Path+'/'+"urq.conf")

#if these entries are not existant, create them with default values
if not config.has_section("General"):
Expand Down Expand Up @@ -74,8 +77,8 @@ def configread():#https://docs.python.org/3/library/configparser.html
log.verbose(verboselogging)#also display debug messages, if false: up to warning level
log.onlycritical(onlycritical)#turn general logging on or off, yes this has to sit below "verbose"

log.set_logpath(LOG_PATH)#where to put..
log.create('ubuntu-recentquicklists.out')#..this logfile
log.set_logpath(Path+'/')#here goes..
log.create('ubuntu-recentquicklists.out')#..the logfile
log.logging.warning('----Start-----')

#on registered exit try to log the occasion
Expand Down

0 comments on commit 7382c98

Please sign in to comment.