plotter/hpgl_parser.py

changeset 34
022e881b758e
parent 32
59da528bc470
equal deleted inserted replaced
33:61809bb871bf 34:022e881b758e
21 while data[self.idx] in [';','\n','\r', '\a', ' ']: 21 while data[self.idx] in [';','\n','\r', '\a', ' ']:
22 self.idx += 1 22 self.idx += 1
23 if data[self.idx] == chr(0x03): 23 if data[self.idx] == chr(0x03):
24 self.ESC() 24 self.ESC()
25 else: 25 else:
26 cmd = data[self.idx: self.idx+2] 26 cmd = data[self.idx: self.idx+2].upper()
27 self.idx += 2 27 self.idx += 2
28 getattr(self, cmd)() 28 getattr(self, cmd)()
29 while self.idx<len(data) and data[self.idx] in [';','\n','\r', '\a', ' ']: 29 while self.idx<len(data) and data[self.idx] in [';','\n','\r', '\a', ' ']:
30 self.idx += 1 30 self.idx += 1
31 31

mercurial