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

Error if profiles.json folder doesn't exist #30

Open
Jademalo opened this issue Aug 5, 2024 · 0 comments
Open

Error if profiles.json folder doesn't exist #30

Jademalo opened this issue Aug 5, 2024 · 0 comments

Comments

@Jademalo
Copy link

Jademalo commented Aug 5, 2024

I've been writing a nix derivation to install this on NixOS (it's working great!), but I've come across an error.

If the program is run without ~.config/g13/g13gui/profiles.json existing, then it throws the following error;

Discovering devices
Exception in thread Thread-2 (storePrefs):
Traceback (most recent call last):
Detected change -- saving via <Thread(Thread-2 (storePrefs), started daemon 140342821123776)>
  File "/nix/store/l014xp1qxdl6gim3zc0jv3mpxhbp346s-python3-3.12.4/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/nix/store/l014xp1qxdl6gim3zc0jv3mpxhbp346s-python3-3.12.4/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/nix/store/ly3c1f2rhiwgs6d8i3zv8y9bxwzj1znb-g13gui-0.1.0/lib/python3.12/site-packages/g13gui/model/prefsstore.py", line 26, in storePrefs
Detected change -- saving via <Thread(Thread-3 (storePrefs), started daemon 140342812731072)>
Exception in thread Thread-3 (storePrefs):
Traceback (most recent call last):
    with open(PROFILES_CONFIG_PATH, 'w') as f:
  File "/nix/store/l014xp1qxdl6gim3zc0jv3mpxhbp346s-python3-3.12.4/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/jademalo/.config/g13/g13gui/profiles.json'
    self.run()
  File "/nix/store/l014xp1qxdl6gim3zc0jv3mpxhbp346s-python3-3.12.4/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/nix/store/ly3c1f2rhiwgs6d8i3zv8y9bxwzj1znb-g13gui-0.1.0/lib/python3.12/site-packages/g13gui/model/prefsstore.py", line 26, in storePrefs
    with open(PROFILES_CONFIG_PATH, 'w') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/jademalo/.config/g13/g13gui/profiles.json'
Exception in thread Thread-4 (storePrefs):
Detected change -- saving via <Thread(Thread-4 (storePrefs), started daemon 140342812731072)>
Traceback (most recent call last):
  File "/nix/store/l014xp1qxdl6gim3zc0jv3mpxhbp346s-python3-3.12.4/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/nix/store/l014xp1qxdl6gim3zc0jv3mpxhbp346s-python3-3.12.4/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/nix/store/ly3c1f2rhiwgs6d8i3zv8y9bxwzj1znb-g13gui-0.1.0/lib/python3.12/site-packages/g13gui/model/prefsstore.py", line 26, in storePrefs
    with open(PROFILES_CONFIG_PATH, 'w') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/jademalo/.config/g13/g13gui/profiles.json'

So long as ~/.config/g13/g13gui has been created, it will correctly create profiles.json, but if the folder doesn't exist it can't create the json.

Hopefully this can be fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant