Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

~/.config/siglo.ini was not created during build #81

Closed
jjs10 opened this issue Sep 2, 2021 · 7 comments
Closed

~/.config/siglo.ini was not created during build #81

jjs10 opened this issue Sep 2, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@jjs10
Copy link

jjs10 commented Sep 2, 2021

After building the project from source on my PinePhone running Mobian I received the following error when running:

Traceback (most recent call last):
File "/usr/local/bin/siglo", line 41, in
main()
File "/usr/local/bin/siglo", line 24, in main
d = daemon.daemon()
File "/usr/local/share/siglo/siglo/daemon.py", line 13, in init
self.manager = InfiniTimeManager()
File "/usr/local/share/siglo/siglo/bluetooth.py", line 62, in init
if not self.conf.get_property("paired"):
File "/usr/local/share/siglo/siglo/config.py", line 43, in get_property
prop = config["settings"][key]
File "/usr/lib/python3.9/configparser.py", line 960, in getitem
raise KeyError(key)
KeyError: 'settings'

I eventually figured out the error was because it was looking for ~/.config/siglo.ini that was not created. I created the .ini file with the default values below, which fixed the issue.

[settings]
deploy_type = quick
last_paired_device = None
paired = False
adapter = None

I am not sure if this was something I did wrong during the build or if it is a recent bug in the project.

@theironrobin
Copy link
Owner

weird, i will test when i get the time

@Yasumoto
Copy link
Contributor

Yasumoto commented Sep 2, 2021

Hm, I got this too just now on a new Pop_OS! 21.04 desktop.

I ran the build steps (got an unrelated error) so decided to install the flatpak and hit this too:

❯ flatpak run com.github.alexr4535.siglo
Traceback (most recent call last):
  File "/app/bin/siglo", line 41, in <module>
    main()
  File "/app/bin/siglo", line 24, in main
    d = daemon.daemon()
  File "/app/share/siglo/siglo/daemon.py", line 13, in __init__
    self.manager = InfiniTimeManager()
  File "/app/share/siglo/siglo/bluetooth.py", line 62, in __init__
    if not self.conf.get_property("paired"):
  File "/app/share/siglo/siglo/config.py", line 43, in get_property
    prop = config["settings"][key]
  File "/usr/lib/python3.8/configparser.py", line 960, in __getitem__
    raise KeyError(key)
KeyError: 'settings'

❯ cat ~/.config/siglo.ini
[settings]
  deploy_type = quick
  last_paired_device = None
  paired = False
  adapter = None

@jwillikers
Copy link
Contributor

Yeah, this error doesn't show up if Siglo has previously created the file before being updated.
I can re-create the issue from the Flatpak by deleting the ini file before running Siglo as demonstrated below.

$ rm ~/.var/app/com.github.alexr4535.siglo/config/siglo.ini 
$ flatpak run com.github.alexr4535.siglo
Traceback (most recent call last):
  File "/app/bin/siglo", line 41, in <module>
    main()
  File "/app/bin/siglo", line 24, in main
    d = daemon.daemon()
  File "/app/share/siglo/siglo/daemon.py", line 13, in __init__
    self.manager = InfiniTimeManager()
  File "/app/share/siglo/siglo/bluetooth.py", line 62, in __init__
    if not self.conf.get_property("paired"):
  File "/app/share/siglo/siglo/config.py", line 43, in get_property
    prop = config["settings"][key]
  File "/usr/lib/python3.8/configparser.py", line 960, in __getitem__
    raise KeyError(key)
KeyError: 'settings'

@esijg
Copy link

esijg commented Sep 6, 2021

Had the same happen when installing from flathub on Fedora 34.

creating siglo.ini text file in ~/.var/app/com.github.alexr4535.siglo/config/ with the following contents did the trick though.

[settings]
deploy_type = quick
last_paired_device = None
paired = False
adapter = None

@theironrobin theironrobin added the bug Something isn't working label Sep 6, 2021
@fractalf
Copy link

fractalf commented Sep 6, 2021

Same problem here installing from flathub on Linux Mint 20.1.
Thanks @esijg for the fix!

@darkdragon-001
Copy link

Same problem (freshly) installing from flathub on Fedora 34.

@theironrobin
Copy link
Owner

97b4ca8 should fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants