|
|
|
@ -3,13 +3,13 @@ import email.mime.application
|
|
|
|
|
import email.mime.multipart
|
|
|
|
|
import email.mime.text
|
|
|
|
|
from email.header import decode_header, make_header
|
|
|
|
|
#import imaplib
|
|
|
|
|
import os.path
|
|
|
|
|
import random
|
|
|
|
|
import smtplib
|
|
|
|
|
import string
|
|
|
|
|
|
|
|
|
|
import imapclient
|
|
|
|
|
import kode256
|
|
|
|
|
|
|
|
|
|
from bureau import Bureau, add_command, add_api
|
|
|
|
|
|
|
|
|
@ -172,23 +172,17 @@ class MailRoom(Bureau):
|
|
|
|
|
# TODO: switch this to inline svgs
|
|
|
|
|
# make action barcodes
|
|
|
|
|
msg.un_bc = os.path.join("/tmp", "POun." + shortcode + ".png")
|
|
|
|
|
barcode.generate("code128", "POun." + shortcode,
|
|
|
|
|
writer=barcode.writer.ImageWriter(), output=msg.un_bc)
|
|
|
|
|
kode256.image("POun." + shortcode).save(msg.un_bc)
|
|
|
|
|
msg.d_bc = os.path.join("/tmp", "POd." + shortcode + ".png")
|
|
|
|
|
barcode.generate("code128", "POd." + shortcode,
|
|
|
|
|
writer=barcode.writer.ImageWriter(), output=msg.d_bc)
|
|
|
|
|
kode256.image("POd." + shortcode).save(msg.d_bc)
|
|
|
|
|
msg.sp_bc = os.path.join("/tmp", "POsp." + shortcode + ".png")
|
|
|
|
|
barcode.generate("code128", "POsp." + shortcode,
|
|
|
|
|
writer=barcode.writer.ImageWriter(), output=msg.sp_bc)
|
|
|
|
|
kode256.image("POsp." + shortcode).save(msg.sp_bc)
|
|
|
|
|
msg.re_bc = os.path.join("/tmp", "POre." + shortcode + ".png")
|
|
|
|
|
barcode.generate("code128", "POre." + shortcode,
|
|
|
|
|
writer=barcode.writer.ImageWriter(), output=msg.re_bc)
|
|
|
|
|
kode256.image("POre." + shortcode).save(msg.re_bc)
|
|
|
|
|
msg.rea_bc = os.path.join("/tmp", "POrea." + shortcode + ".png")
|
|
|
|
|
barcode.generate("code128", "POrea." + shortcode,
|
|
|
|
|
writer=barcode.writer.ImageWriter(), output=msg.rea_bc)
|
|
|
|
|
kode256.image("POrea." + shortcode).save(msg.rea_bc)
|
|
|
|
|
msg.r_bc = os.path.join("/tmp", "POr." + shortcode + ".png")
|
|
|
|
|
barcode.generate("code128", "POr." + shortcode,
|
|
|
|
|
writer=barcode.writer.ImageWriter(), output=msg.r_bc)
|
|
|
|
|
kode256.image("POr." + shortcode).save(msg.r_bc)
|
|
|
|
|
|
|
|
|
|
self.print_full("email.html", msg=msg, shortcode=shortcode)
|
|
|
|
|
|
|
|
|
@ -315,9 +309,9 @@ class MailRoom(Bureau):
|
|
|
|
|
msg.subject = clean_header(envelope.subject.decode("utf-8"))
|
|
|
|
|
|
|
|
|
|
# make action barcodes
|
|
|
|
|
msg.d_bc = self.bc_svg("POd." + shortcode)
|
|
|
|
|
msg.sp_bc = self.bc_svg("POsp." + shortcode)
|
|
|
|
|
msg.r_bc = self.bc_svg("POr." + shortcode)
|
|
|
|
|
msg.d_bc = kode256.svg("POd." + shortcode)
|
|
|
|
|
msg.sp_bc = kode256.svg("POsp." + shortcode)
|
|
|
|
|
msg.r_bc = kode256.svg("POr." + shortcode)
|
|
|
|
|
|
|
|
|
|
msgs.append(msg.__dict__)
|
|
|
|
|
|
|
|
|
|