ahrm / sioyek-python-extensions

Python wrapper and simple addons for sioyek PDF viewer
GNU General Public License v3.0
164 stars 7 forks source link

no quotations for %{selected_rect} #11

Closed gokberkgunes closed 1 year ago

gokberkgunes commented 1 year ago

When using the commands with %{selected_rect} provided in the README.md, commands fail to work with below error.

QString::arg: Argument missing: python -m sioyek.remove_annotation "%{sioyek_path}" "%{local_database}" "%{shared_database}" "%{file_path}" "%{selected_rect}", /tmp/a.pdf
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.10/site-packages/sioyek/remove_annotation.py", line 21, in <module>
    selected_page, selected_rect = parse_rect(rect_string)
  File "/usr/lib/python3.10/site-packages/sioyek/remove_annotation.py", line 7, in parse_rect
    page = int(parts[0])
ValueError: invalid literal for int() with base 10: '"0'

Changing the commands so that there are no quotations around the %{selected_rect} in order to solve the issue.

ahrm commented 1 year ago

Unfortubately this is a platform-dependent issue. On some platforms quotations are required.