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

Handle inkscape 0.92 where no version string shows #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions tools/inkscape_extension/inkscape-1.1-hack/RUN.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#! /bin/sh

wget="wget -nv --show-progress -c"
dl_o=https://github.com/fablabnbg/VisiCut/releases/download/v1.8-310.1%2B20181009jw/
vers_o=1.8-310.1+20181009jw
vers_n=1.8-310.1+20181009+1jw

mkdir -p 2018
cd 2018
$wget $dl/VisiCut-1.8-310.1+20181009jw-Windows-Installer.exe
$wget $dl/visicut_1.8-310.1+20181009jw-1_all.deb
$wget $dl/VisiCutMac-1.8-310.1+20181009jw.zip
cd ..
mkdir -p ext-1.1
cd ext-1.1
dl_e=https://raw.githubusercontent.com/t-oster/VisiCut/master/tools/inkscape_extension/
$wget $dl_e/daemonize.py
$wget $dl_e/visicut_export.py
cd ..

mkdir -p mac
cd mac
unzip -n ../2018/*Mac*.zip
cp ../ext-1.1/* VisiCut.app/Contents/Resources/Java/inkscape_extension/
sed -i -e "s/$vers_o/$vers_n/" VisiCut.app/Contents/Info.plist
zip -r ../VisiCutMac-$vers_n.zip VisiCut.app
cd ..

mkdir -p lin
dpkg-deb -R 2018/*.deb lin
sed -i -e "s/$vers_o/$vers_n/" lin/DEBIAN/control
cp ext-1.1/* lin/usr/share/visicut/inkscape_extension/
dpkg-deb --build lin visicut_$vers_n-1_all.deb

mkdir -p win
cd win
7z x ../2018/*.exe
cp ../ext-1.1/* inkscape_extension/
cp ../2018/*.exe ../VisiCut-$vers_n-Windows-Installer.exe
7z u ../VisiCut-$vers_n-Windows-Installer.exe inkscape_extension/daemonize.py inkscape_extension/visicut_export.py
####### ERROR:
# Path = ../VisiCut-1.8-310.1+20181009+1jw-Windows-Installer.exe
# Type = Nsis
# Physical Size = 14745102
# Method = Deflate
# Solid = -
# Headers Size = 59395
# Embedded Stub Size = 88064
# SubType = NSIS-2 BadCmd=11
#
# System ERROR:
# E_NOTIMPL
####### ERROR:
12 changes: 7 additions & 5 deletions tools/inkscape_extension/visicut_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ def is_exe(fpath):
def inkscape_version():
"""determine if Inkscape is version 0 or 1"""
version = subprocess.check_output([INKSCAPEBIN, "--version"], stderr=DEVNULL).decode('ASCII', 'ignore')
assert version.startswith("Inkscape ")
if version.startswith("Inkscape 0"):
return 0
if version.startswith("Inkscape "):
if version.startswith("Inkscape 0"):
return 0
else:
return 1
else:
return 1

# sometimes in inkscape 0.92 under windows 10, we don't get the version string at all.
return 0


# Strip SVG to only contain selected elements, convert objects to paths, unlink clones
Expand Down