예제 #1
0
파일: printer.py 프로젝트: WALR/pypos
# -*- coding: utf-8 -*- 
from serialEscPos import serialEscPos

ser = serialEscPos()

def printReport(waiter, total):
    ser.doubleStrike(1)

    ser.underline(1)

    ser.centre()

    ser.println(u'ОТЧЕТ'.encode('cp866', 'ignore'))

    ser.println("")

    ser.println(waiter.upper().encode('cp866', 'ignore'))

    ser.centre()

    ser.underline(0)

    ser.println("")
    ser.println(str("{0:.2f}".format(total)) + u' лв.'.encode('cp866', 'ignore'))

    ser.println("")

    ser.println("")

    ser.println("")
    
예제 #2
0
# -*- coding: utf-8 -*-
from serialEscPos import serialEscPos

ser = serialEscPos()


def printReport(waiter, total):
    ser.doubleStrike(1)

    ser.underline(1)

    ser.centre()

    ser.println(u'ОТЧЕТ'.encode('cp866', 'ignore'))

    ser.println("")

    ser.println(waiter.upper().encode('cp866', 'ignore'))

    ser.centre()

    ser.underline(0)

    ser.println("")
    ser.println(
        str("{0:.2f}".format(total)) + u' лв.'.encode('cp866', 'ignore'))

    ser.println("")

    ser.println("")
예제 #3
0
import serialEscPos,twitter,time
rp = serialEscPos.serialEscPos()
api = twitter.Api()

got = {}
latest=0
searchterm = ""
slipprint = False
starttime = time.time()
stopbeforeprint = True


def printstatus(status):
    global got,rp
    if status.id in got:
        return
    got[status.id] = status.id
    if stopbeforeprint:
        print "In stop before print mode. Won't actually print.\n"
        return
    rp.doubleStrike(1)
    rp.underline(1)
    rp.centre()
    rp.println("@" + unicode(status.user.screen_name).encode('ascii', 'ignore'))
    rp.left()
    rp.doubleStrike(0)
    rp.underline(0)
    rp.println(unicode(status.text).encode('ascii', 'ignore'))
    rp.println("")

def prime(term):