Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allows for local config file in ~/.config, also enable info logging o…

…n oblogout command
  • Loading branch information...
commit edb6dee07bf22e51a48cbcd51f7ce82132a60294 1 parent 350d3ce
@nikdoof authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 data/oblogout
View
15 data/oblogout
@@ -41,6 +41,7 @@ def main(argv = None):
logout = logging.StreamHandler(sys.stdout)
logout.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s"))
logger.addHandler(logout)
+ logger.setLevel(logging.INFO)
verbose = None
config = None
@@ -72,21 +73,23 @@ def main(argv = None):
local_mode = True
if not config:
- if not local_mode:
- config = '/etc/oblogout.conf'
- else:
+ if local_mode:
config = 'data/oblogout.conf'
+ elif os.path.isfile('%s/.config/oblogout.conf' % os.getenv("HOME")):
+ config = '%s/.config/oblogout.conf' % os.getenv("HOME")
+ else:
+ config = '/etc/oblogout.conf'
# Check config in local path, if it exists pass it on
- if not os.path.exists(config):
+ if not os.path.isfile(config):
logger.error("Invalid config file: %s" % config)
return 1
+ else:
+ logger.info("Using config file %s" % config)
# If debug mode is enabled, output debug messages
if verbose:
logger.setLevel(logging.DEBUG)
- else:
- logger.setLevel(logging.INFO)
# Start the application
app = OpenboxLogout(config, local_mode)
Please sign in to comment.
Something went wrong with that request. Please try again.