X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=xsetbg_conf.py;h=1e54e6cccf34bbdd042eba66bca62bb651bcd870;hb=577e6f1ca8e079172fcd42f373f5948e84d3d0b6;hp=368667c9b02e9362dc2d66f9a5e934da1080dca1;hpb=62e1582b16651a19a941b7db643fd8771f35c051;p=xsetbg.git diff --git a/xsetbg_conf.py b/xsetbg_conf.py index 368667c..1e54e6c 100755 --- a/xsetbg_conf.py +++ b/xsetbg_conf.py @@ -1,17 +1,13 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 """XSetBg config """ -__author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2014 PhiloSoft Design" -__license__ = "GNU GPL" +import os +from configparser import ConfigParser __all__ = ['xsetbg_conf'] -import os -from ConfigParser import SafeConfigParser - config_dirs = [] if 'XDG_CONFIG_HOME' in os.environ: config_dirs.append(os.environ['XDG_CONFIG_HOME']) @@ -27,12 +23,12 @@ config_dirs.append(xsetbg_dir) for d in config_dirs: xsetbg_conf_file = os.path.join(d, 'xsetbg.conf') if os.path.exists(xsetbg_conf_file): - xsetbg_conf = SafeConfigParser() + xsetbg_conf = ConfigParser(inline_comment_prefixes=(';', '#')) xsetbg_conf.read(xsetbg_conf_file) break else: raise RuntimeError("Cannot find xsetbg.conf; searched %s", config_dirs) if __name__ == '__main__': - print "Config dirs:", config_dirs - print "Config file:", xsetbg_conf_file + print("Config dirs:", config_dirs) + print("Config file:", xsetbg_conf_file)