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

Typo in parser.py and more #324

Closed
yochananmarqos opened this issue Mar 5, 2017 · 7 comments
Closed

Typo in parser.py and more #324

yochananmarqos opened this issue Mar 5, 2017 · 7 comments
Labels
Milestone

Comments

@yochananmarqos
Copy link

yochananmarqos commented Mar 5, 2017

Specifications

  • Hardcode-Tray version : hardcode-tray --version shows v3.6.5, but Synaptic shows 3.5.21~729~ubuntu16.04.1
  • Distribution : Linux Mint 18.1 "Serena" Xfce Edition
  • Gtk version : 3.18.9-1ubuntu3.1 amd64 / 2.24.30-1ubuntu1 amd64/i386
  • Inkscape version : 0.91-7ubuntu2
  • Cairo version : 1.0.19-1
  • Sni-qt version: 0.27+20161212~10~ubuntu16.04.1
  • Application name : N/A
  • Application version : N/A

Expected behavior and actual behavior

Expected: hardcode-tray applies icons.

Actual:

Traceback (most recent call last):
  File "script.py", line 26, in <module>
    from modules.parser import Parser, ArgsParser, CONVERSION_TOOLS
  File "/opt/Hardcode-Tray/modules/parser.py", line 260
    if not svgtool_found:
                        ^
IndentationError: unindent does not match any outer indentation level

I fixed the indent on line 260 & 261, and now get this:

ls: cannot access 'xprop -root _DT_SAVE_MODE': No such file or directory
Welcome to the tray icons hardcoder fixer!
Your indicator icon size is : 22
The detected desktop environement : Other
Your current icon theme is : Papirus
Conversion tool : ImageMagick
Applications will be fixed : All
Applying now..

Clementine          [##......................................] 1/21 4.8%
Traceback (most recent call last):
  File "script.py", line 164, in <module>
    apply(True)
  File "script.py", line 115, in apply
    app.install()
  File "/opt/Hardcode-Tray/modules/applications/binary.py", line 64, in install
    self.install_icon(icon, icon_path)
  File "/opt/Hardcode-Tray/modules/applications/pak.py", line 44, in install_icon
    pngbytes = get_pngbytes(self.svgtopng, icon)
  File "/opt/Hardcode-Tray/modules/utils.py", line 320, in get_pngbytes
    pngbytes = svgtopng.to_bin(icon_for_repl)
  File "/opt/Hardcode-Tray/modules/svg/svg.py", line 55, in to_bin
    with open(outfile, 'rb') as temppng:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpx68vzzpd'

I then tried using Inkscape instead of ImageMagick as that's what it usually used by default and the script ran properly:

ls: cannot access 'xprop -root _DT_SAVE_MODE': No such file or directory
Welcome to the tray icons hardcoder fixer!
Your indicator icon size is : 22
The detected desktop environement : Other
Your current icon theme is : Papirus
Conversion tool : Inkscape
Applications will be fixed : All
Applying now..

Clementine          [##......................................] 1/21 4.8%
Google Chrome       [######..................................] 3/21 14.3%
Google Music Manager[########................................] 4/21 19.0%
Hexchat             [###############.........................] 8/21 38.1%
Solaar              [################################........] 17/21 81.0%
Steam               [##################################......] 18/21 85.7%
Touchpad Indicator  [########################################] 21/21 100.0%

Done, Thank you for using the Hardcode-Tray fixer!

Steps to reproduce the problem

  1. Running hardcode-tray --theme Papirus --apply
@bilelmoussaoui
Copy link
Owner

For the first issue, it's already fixed on master. Just run hardcode-tray --update-git to get the latest git version.
For the ImageMagick issue, i will investigate right now

@bilelmoussaoui
Copy link
Owner

Both issues seems to be already fixed on master, can you confirm that?

@yochananmarqos
Copy link
Author

Yes, the first issue is fixed. As for the second issue, if I run hardcode-tray --theme Papirus --apply, it uses CairoSVG and applies successfully. However, if I use ImageMagick, I get the same errors:

~ $ hardcode-tray --conversion-tool ImageMagick --theme Papirus --apply
ls: cannot access 'xprop -root _DT_SAVE_MODE': No such file or directory
Welcome to the tray icons hardcoder fixer!
Your indicator icon size is : 22
The detected desktop environement : Other
Your current icon theme is : Papirus
Conversion tool : ImageMagick
Applications will be fixed : All
Applying now..

Clementine          [#.......................................] 1/27 3.7%
Dropbox             [##########..............................] 7/27 25.9%
Traceback (most recent call last):
  File "script.py", line 164, in <module>
    apply(True)
  File "script.py", line 115, in apply
    app.install()
  File "/opt/Hardcode-Tray/modules/applications/binary.py", line 64, in install
    self.install_icon(icon, icon_path)
  File "/opt/Hardcode-Tray/modules/applications/pak.py", line 44, in install_icon
    pngbytes = get_pngbytes(self.svgtopng, icon)
  File "/opt/Hardcode-Tray/modules/utils.py", line 322, in get_pngbytes
    pngbytes = svgtopng.to_bin(icon_for_repl)
  File "/opt/Hardcode-Tray/modules/svg/svg.py", line 55, in to_bin
    with open(outfile, 'rb') as temppng:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpzc5sjbxq'

@bilelmoussaoui
Copy link
Owner

I will try to investigate more in few hours. Thanks !

@bilelmoussaoui
Copy link
Owner

Does this issue happens only with ImageMagick?

@bilelmoussaoui bilelmoussaoui added this to the v3.6.6 milestone Mar 9, 2017
@bilelmoussaoui
Copy link
Owner

Honestly, i can't really reproduce this at all
screenshot from 2017-03-09 15-13-12
Maybe something is going wrong with using Papirus and ImageMagick? I will give it a try =)

@bilelmoussaoui
Copy link
Owner

Couldn't reproduce using ImageMagick + Papirus neither
screenshot from 2017-03-09 15-13-12
Must be something going wrong with your ImageMagick installation. Just use Inkscape or an other conversion tool to avoid this. If you find a way to fix it just open a PR and i will merge it;
Thanks

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

No branches or pull requests

2 participants