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

v3.9 #374

Merged
merged 8 commits into from
Jun 10, 2017
Merged

v3.9 #374

merged 8 commits into from
Jun 10, 2017

Conversation

bilelmoussaoui
Copy link
Owner

@bilelmoussaoui bilelmoussaoui commented Jun 5, 2017

This PR should contain some code improvements and simplifications of overcomplicated stuff

What i want to be done before this going to be merged:

  • Split the electron module into two modules: asar and electron
  • use abstractmethod instead of using pass
  • Simplify settings, json & system files. Some methods shouldn't be static at all.
  • Verify that the icon theme detection works perfectly and improve it a little bit.

@bilelmoussaoui bilelmoussaoui self-assigned this Jun 5, 2017
@bilelmoussaoui
Copy link
Owner Author

Hey @wa4557, can you try this whenever you've got some free time? Everything works perfectly on my system. It's more on the continuation of code improvement as with the latest versions. And some small bug fixes

@bilelmoussaoui bilelmoussaoui requested a review from andia89 June 7, 2017 13:12
@andia89
Copy link
Collaborator

andia89 commented Jun 7, 2017

I get an error:

Traceback (most recent call last):
  File "/usr/lib/python3.5/configparser.py", line 786, in get
    value = d[option]
  File "/usr/lib/python3.5/collections/__init__.py", line 878, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/lib/python3.5/collections/__init__.py", line 870, in __missing__
    raise KeyError(key)
KeyError: 'gtk-icon-theme-name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "hardcode-tray.py", line 87, in <module>
    if not isinstance(App.theme(), dict):
  File "/opt/Hardcode-Tray/src/app.py", line 168, in theme
    theme = App.get("theme")
  File "/opt/Hardcode-Tray/src/app.py", line 71, in get
    value = method()
  File "/opt/Hardcode-Tray/src/modules/config/system.py", line 77, in theme
    theme_name = cnfg.get("Settings", "gtk-icon-theme-name")
  File "/usr/lib/python3.5/configparser.py", line 789, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'gtk-icon-theme-name' in section: 'Settings'

@bilelmoussaoui
Copy link
Owner Author

Alright, what distro/de are you using ?

@andia89
Copy link
Collaborator

andia89 commented Jun 7, 2017

Ubuntu 16.04 / Unity

@bilelmoussaoui
Copy link
Owner Author

Ah my bad, i thought that Unity stores the icon theme name in https://github.com/bil-elmoussaoui/Hardcode-Tray/blob/master/src/modules/config/system.py#L64

@bilelmoussaoui
Copy link
Owner Author

Should be fixed

@andia89
Copy link
Collaborator

andia89 commented Jun 7, 2017

Seems to be still the same error

Traceback (most recent call last):
  File "/usr/lib/python3.5/configparser.py", line 786, in get
    value = d[option]
  File "/usr/lib/python3.5/collections/__init__.py", line 878, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/lib/python3.5/collections/__init__.py", line 870, in __missing__
    raise KeyError(key)
KeyError: 'gtk-icon-theme-name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "hardcode-tray.py", line 87, in <module>
    if not isinstance(App.theme(), dict):
  File "/opt/Hardcode-Tray/src/app.py", line 168, in theme
    theme = App.get("theme")
  File "/opt/Hardcode-Tray/src/app.py", line 71, in get
    value = method()
  File "/opt/Hardcode-Tray/src/modules/config/system.py", line 77, in theme
    theme_name = cnfg.get("Settings", "gtk-icon-theme-name")
  File "/usr/lib/python3.5/configparser.py", line 789, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'gtk-icon-theme-name' in section: 'Settings'

@bilelmoussaoui
Copy link
Owner Author

Hmm, what's the output of echo $XDG_CURRENT_DESKTOP?

@andia89
Copy link
Collaborator

andia89 commented Jun 7, 2017

Unity

@bilelmoussaoui
Copy link
Owner Author

Hmm ! What if you add a print just after this line https://github.com/bil-elmoussaoui/Hardcode-Tray/blob/beta/src/const.py#L43 to get the detected_desktop_env print(DESKTOP_ENV)

@andia89
Copy link
Collaborator

andia89 commented Jun 7, 2017

Everything works fine 👍

But every second time I get this:

Traceback (most recent call last):
  File "./hardcode-tray.py", line 104, in <module>
    App.execute()
  File "/home/andreas/Diverses/Hardcode-Tray/src/app.py", line 119, in execute
    delta = app.do_action(action)
  File "/home/andreas/Diverses/Hardcode-Tray/src/modules/applications/application.py", line 151, in do_action
    self.install()
  File "/home/andreas/Diverses/Hardcode-Tray/src/decorators.py", line 59, in wrapper
    func(app)
  File "/home/andreas/Diverses/Hardcode-Tray/src/modules/applications/application.py", line 97, in install
    self.execute(Action.APPLY)
  File "/home/andreas/Diverses/Hardcode-Tray/src/modules/applications/helpers/binary.py", line 51, in execute
    self.install_icon(icon, icon_path)
  File "/home/andreas/Diverses/Hardcode-Tray/src/modules/applications/electron.py", line 39, in install_icon
    png_bytes = get_pngbytes(icon)
  File "/home/andreas/Diverses/Hardcode-Tray/src/utils.py", line 242, in get_pngbytes
    App.icon_size())
  File "/home/andreas/Diverses/Hardcode-Tray/src/modules/svg/svg.py", line 90, in to_bin
    with open(outfile, 'rb') as temppng:
FileNotFoundError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/tmp/tmpac1ubj8s'

@bilelmoussaoui
Copy link
Owner Author

Hmm, it shouldn't be any issue at all :( i will see what's going wrong. Anyway, it seems that the temporary output file is not found

@bilelmoussaoui
Copy link
Owner Author

@wa4557 Should be fixed :)

Repository owner deleted a comment Jun 10, 2017
@andia89
Copy link
Collaborator

andia89 commented Jun 10, 2017

@bil-elmoussaoui Indeed everything works fine on two different machines 👍

@bilelmoussaoui bilelmoussaoui merged commit 07dfcc6 into master Jun 10, 2017
@bilelmoussaoui bilelmoussaoui deleted the beta branch June 10, 2017 15:49
@bilelmoussaoui
Copy link
Owner Author

Thanks for testing 👍

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

Successfully merging this pull request may close these issues.

2 participants