-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
29 lines (24 loc) · 772 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from __future__ import print_function
import time
from JJ_Print.JJ_Todoist import JJ_Todoist
from JJ_Print.JJ_Todoist_Config import JJ_Todoist_Config
class MockPrinter:
def println(self, msg):
return print("printer: " + msg)
def printImage(self, img, lat):
return print("(Image Printed)")
def feed(self, amt):
return print("(Feed)")
config = {
"refresh_time": 5,
"token": "<REDACTED>",
"morning_image": "M:\\Repositories\\thermal-printer\\JJ_Print\\Python_Thermal_Printer\\gfx\\coffee.png"
}
todoist = JJ_Todoist(JJ_Todoist_Config(config), MockPrinter())
prevTime = 0
while(True):
nextTime = time.time()
tickTime = nextTime - prevTime
if tickTime > 0.0:
prevTime = nextTime
todoist.tick(tickTime)