Comments are lines starting with "#" - in the hope that no screen name
or xrandr option will ever start with a hash sign. Fixes #50.
+* *2017-01-18* Accept comments (lines starting with `#`) in config/setup files
+
**autorandr 1.0**
* *2016-12-07* Tag the current code as version 1.0.0; see github issue #54
**autorandr 1.0**
* *2016-12-07* Tag the current code as version 1.0.0; see github issue #54
for line in configuration.split("\n"):
if line:
line = line.split(None, 1)
for line in configuration.split("\n"):
if line:
line = line.split(None, 1)
+ if line and line[0].startswith("#"):
+ continue
options[line[0]] = line[1] if len(line) > 1 else None
edid = None
options[line[0]] = line[1] if len(line) > 1 else None
edid = None
if not os.path.isfile(config_name) or not os.path.isfile(setup_name):
continue
if not os.path.isfile(config_name) or not os.path.isfile(setup_name):
continue
- edids = dict([ x.strip().split() for x in open(setup_name).readlines() if x.strip() ])
+ edids = dict([ x.split() for x in (y.strip() for y in open(setup_name).readlines()) if x and x[0] != "#" ])