diff options
author | David Lamparter <equinox@diac24.net> | 2013-12-23 19:43:44 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2013-12-23 19:43:44 +0100 |
commit | 62b8d81ca3169d9fb0367f6ae2aa25bc2c9f59e3 (patch) | |
tree | f7a67df34a5c58cb80af8bb52b26fc360f7dd481 | |
parent | ab68f3b5c6774f35c594ca59a4255c3023405cb4 (diff) |
raise timeout, return child
-rw-r--r-- | ptlayout.py | 1 | ||||
-rw-r--r-- | pttarget.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/ptlayout.py b/ptlayout.py index 2d0a3ea..d333c2f 100644 --- a/ptlayout.py +++ b/ptlayout.py @@ -131,6 +131,7 @@ class PTLContainer(PTLayoutElem): def add(self, child): self._children.append(child) + return child class PTLHSpace(PTLContainer): def __init__(self): diff --git a/pttarget.py b/pttarget.py index ff05a1e..24d0e9a 100644 --- a/pttarget.py +++ b/pttarget.py @@ -153,7 +153,7 @@ class PTUSB(PTPrinter): wsize = self.if_wr.wMaxPacketSize if wsize > size - offset: wsize = size - offset - written = self.if_wr.write(data[offset:offset+wsize]) + written = self.if_wr.write(data[offset:offset+wsize], timeout = 5000) if written <= 0: raise IOError, 'failed to write' offset += written |