Skip to content

Commit

Permalink
1.17, no dev.reset per default.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnweiger committed May 17, 2016
1 parent c6971e8 commit 55277d5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions sendto_silhouette.inx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@

<page name='about' _gui-text='About'>
<param name="about_who" type="description">inkscape-silhouette extension from https://github.com/jnweiger/inkscape-silhouette by Jürgen Weigert [[email protected]] and contributors</param>
<!-- Keep in sync with sendto_silhouette.py line 103 __version__ = ... -->
<param name="about_version" type="description">Version 1.16</param>
<!-- Keep in sync with sendto_silhouette.py line 78 __version__ = ... -->
<param name="about_version" type="description">Version 1.17</param>
</page>
</param>

Expand Down
4 changes: 3 additions & 1 deletion sendto_silhouette.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@
# Added misc/silhouette_move.py misc/silhouette_cut.py, misc/endless_clock.py
# 2016-01-15 jw, v1.15 -- ubuntu loads the wrong usb library.
# 2016-05-15 jw, v1.16 -- merged regmarks code from https://github.com/fablabnbg/inkscape-silhouette/pull/23
# 2016-05-17 jw, v1.17 -- fix avoid dev.reset in Graphtec.py, fix helps with
# https://github.com/fablabnbg/inkscape-silhouette/issues/10

__version__ = '1.16' # Keep in sync with sendto_silhouette.inx ca line 42
__version__ = '1.17' # Keep in sync with sendto_silhouette.inx ca line 79
__author__ = 'Juergen Weigert <[email protected]> and contributors'

import sys, os, shutil, time, logging, tempfile
Expand Down
20 changes: 12 additions & 8 deletions silhouette/Graphtec.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
# plot(bboxonly=None) is now the special case for not doing anything. False is normal plot.
# 2015-06-05 Renamed cut_bbox() to find_bbox(). It does not cut anything.
# 2015-06-06 refactored plot_cmds() from plot().
# 2016-05-16 no reset per default, this helps usbip.

from __future__ import print_function
import sys, time, re

usb_reset_needed = False # https://github.com/fablabnbg/inkscape-silhouette/issues/10

sys_platform = sys.platform.lower()
if sys_platform.startswith('win'):
import usb.core
Expand Down Expand Up @@ -225,14 +228,15 @@ def __init__(self, log=sys.stderr, no_device=False, progress_cb=None):
print(msg, file=sys.stderr)
sys.exit(0)

for i in range(5):
try:
dev.reset();
break
except usb.core.USBError as e:
print("reset failed: ", e, file=self.log)
print("retrying reset in 5 sec", file=self.log)
time.sleep(5)
if usb_reset_needed:
for i in range(5):
try:
dev.reset();
break
except usb.core.USBError as e:
print("reset failed: ", e, file=self.log)
print("retrying reset in 5 sec", file=self.log)
time.sleep(5)

dev.set_configuration()
try:
Expand Down

0 comments on commit 55277d5

Please sign in to comment.