Skip to content

Commit

Permalink
Update tools/inkscape_extension/visicut_export.py
Browse files Browse the repository at this point in the history
dirname() should be fine to. It is more readable. Thanks!

(not sure if introducing a new apprun_path variable contributes to readability though ...) But I don't mind.

Co-authored-by: TheAssassin <[email protected]>
  • Loading branch information
jnweiger and TheAssassin authored Apr 8, 2024
1 parent e435f2e commit ab42570
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/inkscape_extension/visicut_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,13 @@ def get_original_filename(filename):
# We detect this by checking for an AppRun file, in one of the parent folders of our INKSCAPEBIN.
# If so, replace INKSCAPEBIN with AppRun, as this is the only safe way to call inkscape.
# (a direct call mixes libraries from the host system with the appimage, may or may not work.)
dir = os.path.split(INKSCAPEBIN)[0]
dir = os.path.dirname(INKSCAPEBIN)
while dir != '/':
if os.path.exists(os.path.join(dir, "AppRun")):
INKSCAPEBIN = os.path.join(dir, "AppRun")
apprun_path = os.path.join(dir, "AppRun")
if os.path.exists(apprun_path):
INKSCAPEBIN = apprun_path
break
dir = os.path.split(dir)[0]

dir = os.path.dirname(dir)
tmpdir = tempfile.mkdtemp(prefix='temp-visicut-')
dest_filename = os.path.join(tmpdir, get_original_filename(filename))

Expand Down

0 comments on commit ab42570

Please sign in to comment.