Commit c1cc229a authored by Ryan Jarvis's avatar Ryan Jarvis

Remove code that downloads and executes unknown code from the internet

parent 47559017
......@@ -6249,35 +6249,6 @@ G01 Z1 (going to cutting z)\n""",
# o = (1 if cross(n, [0,1])>0 else -1)*orientation
# 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 urllib
else:
import urllib.request as urllib
f = urllib.urlopen("http://www.cnc-club.ru/gcodetools_latest_version", proxies=urllib.getproxies())
a = f.read()
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 manually at \nhttp://www.cnc-club.ru/gcodetools (English version). \nhttp://www.cnc-club.ru/gcodetools_ru (Russian version). \nCurrent version is Gcodetools {}".format(gcodetools_current_version), "Warning")
except:
self.error("Can not check the latest version. You can check it manually at \nhttp://www.cnc-club.ru/gcodetools (English version). \nhttp://www.cnc-club.ru/gcodetools_ru (Russian version). \nCurrent version is Gcodetools {}".format(gcodetools_current_version), "Warning")
################################################################################
# Graffiti function generates Gcode for graffiti drawer
################################################################################
......@@ -6615,7 +6586,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 {}".format(self.options.active_tab)), "error")
else:
# Get all Gcodetools data from the scene.
......@@ -6655,8 +6626,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>
<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