|
@ -74,7 +74,7 @@ def update_db(db, db_path, post, source, date, type=None): |
|
|
|
|
|
|
|
|
return already_in_db |
|
|
return already_in_db |
|
|
|
|
|
|
|
|
def print_now(output, lp=None, type=None): |
|
|
def print_now(output, lp=None, type=None, size=None): |
|
|
# configure the printouts |
|
|
# configure the printouts |
|
|
if lp: |
|
|
if lp: |
|
|
if type == 'rss': |
|
|
if type == 'rss': |
|
@ -86,10 +86,10 @@ def print_now(output, lp=None, type=None): |
|
|
) |
|
|
) |
|
|
lp.line_spacing(spacing=75) # 0 - 255 |
|
|
lp.line_spacing(spacing=75) # 0 - 255 |
|
|
columns = 12 # b 8 8 |
|
|
columns = 12 # b 8 8 |
|
|
elif type == "txt": |
|
|
elif size == "normal": |
|
|
lp.set( |
|
|
lp.set( |
|
|
align='left', |
|
|
align='left', |
|
|
font='b', |
|
|
font='a', |
|
|
text_type='normal', # B, U, U2, BU, BU2, NORMAL |
|
|
text_type='normal', # B, U, U2, BU, BU2, NORMAL |
|
|
width=1, # 1-8 |
|
|
width=1, # 1-8 |
|
|
height=1, # 1-8 |
|
|
height=1, # 1-8 |
|
@ -100,13 +100,27 @@ def print_now(output, lp=None, type=None): |
|
|
) |
|
|
) |
|
|
lp.line_spacing(spacing=65) # 0 - 255 |
|
|
lp.line_spacing(spacing=65) # 0 - 255 |
|
|
# columns = 48 # a 1 1 |
|
|
# columns = 48 # a 1 1 |
|
|
columns = 65 # b 1 1 |
|
|
columns = 48 # b 1 1 |
|
|
|
|
|
elif size == "big": |
|
|
|
|
|
lp.set( |
|
|
|
|
|
align='left', |
|
|
|
|
|
font='b', |
|
|
|
|
|
text_type='normal', # B, U, U2, BU, BU2, NORMAL |
|
|
|
|
|
width=8, # 1-8 |
|
|
|
|
|
height=8, # 1-8 |
|
|
|
|
|
invert=True |
|
|
|
|
|
) |
|
|
|
|
|
lp.line_spacing(spacing=75) # 0 - 255 |
|
|
|
|
|
# columns = 48 # a 1 1 |
|
|
|
|
|
columns = 8 # b 1 1 |
|
|
elif type == 'img': |
|
|
elif type == 'img': |
|
|
lp.line_spacing(spacing=50) # 0 - 255 |
|
|
lp.line_spacing(spacing=50) # 0 - 255 |
|
|
|
|
|
|
|
|
# print |
|
|
# print |
|
|
if lp: |
|
|
if lp: |
|
|
if type == 'txt' or type == 'rss': |
|
|
if type == 'txt' or type == 'rss': |
|
|
|
|
|
# lp._raw(b'\x1b'+b'\x52'+b'\x32') # switch to code table, see http://docshare03.docshare.tips/files/24677/246773902.pdf for more info (does not work) |
|
|
|
|
|
# lp.magic.force_encoding('CP858') # does not work |
|
|
lp.block_text(output, columns=columns) # columns=line width |
|
|
lp.block_text(output, columns=columns) # columns=line width |
|
|
lp.cut() |
|
|
lp.cut() |
|
|
elif type == 'img': |
|
|
elif type == 'img': |
|
|