aesophor / py-todo

📋 Lightweight reminder / todo-list in cli
https://www.reddit.com/r/unixporn/comments/9qy35q/oc_pytodo_a_lightweight_reminder_in_cli/
MIT License
107 stars 22 forks source link

config file read error #31

Closed drasbeck closed 5 years ago

drasbeck commented 5 years ago

I have a problem reading the config file. An empty config files works fine, but then I am missing sweet colors and details. OS: macOS 10.14.4, py-todo: latest version per 20th of April, 2019.

Error message:

❯ todo
Traceback (most recent call last):
  File "/usr/local/bin/todo", line 289, in <module>
    config.read(os.path.join(config_location, config_name))
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 696, in read
    self._read(fp, filename)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 1079, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: '/Users/max/.config/py-todo/config', line: 1
'color = true\n'

Contents of config:

❯ cat ~/.config/py-todo/config
color = true
detail_mode = true
aesophor commented 5 years ago

Put [PY-TODO] add the beginning of the config, and it will work.

I've update the readme and added an example config. Sorry for the inconvenience, the readme didn't contain enough information.

drasbeck commented 5 years ago

It works! =) Keep up the good work. 👍