Commit 45b59e76 authored by Qantas94Heavy's avatar Qantas94Heavy

Backport from extensions master: Remove code that downloads and executes...

Backport from extensions master: Remove code that downloads and executes unknown code from the internet

This is a backport of c1cc229aba from the master branch of
inkscape/extensions.

Fixes: https://bugs.launchpad.net/inkscape/+bug/1795562
Refs: extensions@c1cc229a.
Refs: extensions!48
parent f44b7ea9
Pipeline #52613665 passed with stages
in 7 minutes and 59 seconds
......@@ -483,7 +483,6 @@ share/extensions/wireframe_sphere.py
[type: gettext/xml] share/extensions/funcplot.inx
[type: gettext/xml] share/extensions/gcodetools_about.inx
[type: gettext/xml] share/extensions/gcodetools_area.inx
[type: gettext/xml] share/extensions/gcodetools_check_for_updates.inx
[type: gettext/xml] share/extensions/gcodetools_dxf_points.inx
[type: gettext/xml] share/extensions/gcodetools_engraving.inx
[type: gettext/xml] share/extensions/gcodetools_graffiti.inx
......
......@@ -6320,37 +6320,6 @@ G01 Z1 (going to cutting z)\n""",
# new_subpath += [ [sp2[i][0] - width*o,sp2[i][1]] for i in range(3) ]
################################################################################
###
### Update function
###
### Gets file containing version information from the web and compaares it with.
### current version.
################################################################################
def update(self) :
try :
if sys.version_info[0] < 3:
import urllib2
else:
import urllib.request as urllib2
f = urllib2.urlopen("http://www.cnc-club.ru/gcodetools_latest_version")
a = f.read().decode()
for s in a.split("\n") :
r = re.search(r"Gcodetools\s+latest\s+version\s*=\s*(.*)",s)
if r :
ver = r.group(1).strip()
if ver != gcodetools_current_version :
self.error("There is a newer version of Gcodetools you can get it at: \nhttp://www.cnc-club.ru/gcodetools (English version). \nhttp://www.cnc-club.ru/gcodetools_ru (Russian version). ","Warning")
else :
self.error("You are currently using latest stable version of Gcodetools.","Warning")
return
self.error("Can not check the latest version. You can check it manualy at \nhttp://www.cnc-club.ru/gcodetools (English version). \nhttp://www.cnc-club.ru/gcodetools_ru (Russian version). \nCurrent version is Gcodetools %s"%gcodetools_current_version,"Warning")
except :
self.error("Can not check the latest version. You can check it manualy at \nhttp://www.cnc-club.ru/gcodetools (English version). \nhttp://www.cnc-club.ru/gcodetools_ru (Russian version). \nCurrent version is Gcodetools %s"%gcodetools_current_version,"Warning")
################################################################################
### Graffiti function generates Gcode for graffiti drawer
################################################################################
......@@ -6689,7 +6658,7 @@ G01 Z1 (going to cutting z)\n""",
elif self.options.active_tab == '"test"' :
self.test()
elif self.options.active_tab not in ['"dxfpoints"','"path-to-gcode"', '"area_fill"', '"area"', '"area_artefacts"', '"engraving"', '"orientation"', '"tools_library"', '"lathe"', '"offset"', '"arrangement"', '"update"', '"graffiti"', '"lathe_modify_path"', '"plasma-prepare-path"']:
elif self.options.active_tab not in ['"dxfpoints"','"path-to-gcode"', '"area_fill"', '"area"', '"area_artefacts"', '"engraving"', '"orientation"', '"tools_library"', '"lathe"', '"offset"', '"arrangement"', '"graffiti"', '"lathe_modify_path"', '"plasma-prepare-path"']:
self.error(_("Select one of the action tabs - Path to Gcode, Area, Engraving, DXF points, Orientation, Offset, Lathe or Tools library.\n Current active tab id is %s" % self.options.active_tab),"error")
else:
# Get all Gcodetools data from the scene.
......@@ -6729,8 +6698,6 @@ G01 Z1 (going to cutting z)\n""",
self.lathe()
elif self.options.active_tab == '"lathe_modify_path"':
self.lathe_modify_path()
elif self.options.active_tab == '"update"':
self.update()
elif self.options.active_tab == '"offset"':
if self.options.offset_just_get_distance :
for layer in self.selected_paths :
......
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Check for updates</_name>
<id>ru.cnc-club.filter.gcodetools_update_no_options_no_preferences</id>
<dependency type="executable" location="extensions">gcodetools.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
<param name='active-tab' type="notebook">
<page name='update' _gui-text='Check for updates'>
<_param name="help" type="description">Check for Gcodetools latest stable version and try to get the updates.</_param>
</page>
<page name='help' _gui-text='Help'>
<_param name="fullhelp" type="description" xml:space="preserve">
Gcodetools plug-in: converts paths to Gcode (using circular interpolation), makes offset paths and engraves sharp corners using cone cutters.
This plug-in calculates Gcode for paths using circular interpolation or linear motion when needed.
Tutorials, manuals and support can be found at
English support forum:
http://www.cnc-club.ru/gcodetools
and Russian support forum:
http://www.cnc-club.ru/gcodetoolsru
Credits: Nick Drobchenko, Vladimir Kalyaev, John Brooker, Henry Nicolas, Chris Lusby Taylor.
Gcodetools ver. 1.7
</_param>
</page>
</param>
<effect>
<effects-menu>
<submenu _name="Gcodetools"/>
</effects-menu>
<object-type>path</object-type>
</effect>
<script>
<command reldir="extensions" interpreter="python">gcodetools.py</command>
</script>
</inkscape-extension>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment