Skip to content

Commit

Permalink
don't flip vertically, almost works, #283
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrasca committed Oct 9, 2017
1 parent 0f4a897 commit b71c3dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions bauble/plugins/report/mako/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ class Code39:
# and end with a single special symbol (we call it '!') which isn't
# included in the 45 encodable characters.

# we only need the 13 chars ' !.0123456789', and they all contain 9
# black units and 6 white units, plus the final separator. this makes
# things a lot easier.

MAP = {'!': 'b b bbb bbb b',
'7': 'b b b bbb bbb',
'-': 'b b b bbb bbb',
Expand Down Expand Up @@ -241,7 +237,7 @@ def __call__(self, x, y, text, scale=1, side=None, format='svg'):
if format == 'svg':
qr.svg(self.buffer, xmldecl=False, quiet_zone=0, scale=scale)
else:
qr.eps(self.buffer)
qr.eps(self.buffer, quiet_zone=0)
match = self.pattern[format].match(self.buffer.getvalue())
result_list = [match.group(2)]
transform = []
Expand All @@ -250,8 +246,6 @@ def __call__(self, x, y, text, scale=1, side=None, format='svg'):
transform.append("%s %s translate" % (x, y))
else:
transform.append("translate(%s,%s)" % (x, y))
if format == 'ps':
transform.append("1 -1 scale")
if side is not None:
orig_side = float(match.group(1))
if format == 'ps':
Expand All @@ -264,6 +258,8 @@ def __call__(self, x, y, text, scale=1, side=None, format='svg'):
else:
result_list.insert(0, '<g transform="%s">' % (''.join(transform)))
result_list.append('</g>')
if format == 'ps':
result_list = ['gsave'] + result_list + ["grestore"]
return '\n'.join(result_list)

add_qr = add_qr_functor()
Expand Down
Binary file modified bauble/plugins/report/mako/templates/accession-label-qr.ps
Binary file not shown.

0 comments on commit b71c3dc

Please sign in to comment.