Mercurial > hg > zebra
comparison zebra.py @ 2:ad9d9bf61243
Change direct transfer to direct thermal
author | Ben Croston <ben@fuzzyduckbrewery.co.uk> |
---|---|
date | Fri, 12 Aug 2011 21:52:11 +0100 |
parents | 21c3229ed401 |
children | 0687a6666873 |
comparison
equal
deleted
inserted
replaced
1:21c3229ed401 | 2:ad9d9bf61243 |
---|---|
51 return self._getqueues_unix() | 51 return self._getqueues_unix() |
52 | 52 |
53 def setqueue(self, queue): | 53 def setqueue(self, queue): |
54 self.queue = queue | 54 self.queue = queue |
55 | 55 |
56 def setup(self, direct_transfer=None, label_height=None, label_width=None): | 56 def setup(self, direct_thermal=None, label_height=None, label_width=None): |
57 commands = '\n' | 57 commands = '\n' |
58 if direct_transfer: | 58 if direct_thermal: |
59 commands += ('OD\n') | 59 commands += ('OD\n') |
60 if label_height: | 60 if label_height: |
61 commands += ('Q%s,%s\n'%(label_height[0],label_height[1])) | 61 commands += ('Q%s,%s\n'%(label_height[0],label_height[1])) |
62 if label_width: | 62 if label_width: |
63 commands += ('q%s\n'%label_width) | 63 commands += ('q%s\n'%label_width) |
74 | 74 |
75 if __name__ == '__main__': | 75 if __name__ == '__main__': |
76 z = zebra() | 76 z = zebra() |
77 print 'Printer queues found:',z.getqueues() | 77 print 'Printer queues found:',z.getqueues() |
78 z.setqueue('zebra_python_unittest') | 78 z.setqueue('zebra_python_unittest') |
79 z.setup(direct_transfer=True, label_height=(406,32), label_width=609) # 3" x 2" direct transfer label | 79 z.setup(direct_thermal=True, label_height=(406,32), label_width=609) # 3" x 2" direct thermal label |
80 z.store_graphic('logo','logo.pcx') | 80 z.store_graphic('logo','logo.pcx') |
81 label = """ | 81 label = """ |
82 N | 82 N |
83 GG419,40,"logo" | 83 GG419,40,"logo" |
84 A40,80,0,4,1,1,N,"Tangerine Duck 4.4%" | 84 A40,80,0,4,1,1,N,"Tangerine Duck 4.4%" |