From 4afac32590eef8463af333448ee7e8afc2791d7b Mon Sep 17 00:00:00 2001 From: trav Date: Sun, 7 Feb 2021 15:14:08 -0500 Subject: [PATCH] hopefully works --- carousel.py | 7 ++++--- refreshdb.py | 10 ++++++---- run-ssb.sh | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/carousel.py b/carousel.py index 8faeee5..101ea7a 100644 --- a/carousel.py +++ b/carousel.py @@ -57,14 +57,14 @@ newFlier = db.get(doc_id=dbIndex) flierPath = newFlier["path"] Limage = Image.new('1', (epd4in2.EPD_HEIGHT, epd4in2.EPD_WIDTH), 255) # 255: clear the frame try: - font36 = ImageFont.truetype('/usr/share/fonts/truetype/wqy/wqy-microhei.ttc', 36) + font18 = ImageFont.truetype('/usr/share/fonts/truetype/wqy/wqy-microhei.ttc', 36) epd = epd4in2.EPD() epd.init() bmp = Image.open(flierPath) Limage.paste(bmp) draw = ImageDraw.Draw(Limage) - draw.text((2, 240), 'EBB', font = font18, fill = 255) - draw.text((2, 260), 'version .02', font = font18, fill = 255) + draw.text((2, 280), 'EBB', font = font18, fill = 255) + draw.text((2, 300), 'version .02', font = font18, fill = 255) epd.display(epd.getbuffer(Limage)) time.sleep(2) epd.sleep() @@ -105,6 +105,7 @@ def button_e(button, pressed): buttonshim.set_pixel(0x00, 0x00, 0xFF) button_flag = "button_5" +buttonshim.set_pixel(0x00, 0x00, 0x00) ## MAIN LOOP ## while True: diff --git a/refreshdb.py b/refreshdb.py index 1fde03f..a129085 100644 --- a/refreshdb.py +++ b/refreshdb.py @@ -21,6 +21,7 @@ def main(): def fresh(): + print 'refreshing db from ssb' #get our ssb pub key and db location from config configParser = ConfigParser.RawConfigParser() configFilePath = r'config.txt' @@ -33,11 +34,12 @@ def fresh(): #get time of last db-to-ssb sync from db root_entry = db.get(doc_id=1) last_run = root_entry["date"] + print 'looking for posts since: ' last_run #if last run is never ran then only look back 1 month (new installs don't need EVERY old post...) if last_run==4: whatever=time.time() - whaever-=2700000 + whatever-=2700000 last_run=int(whatever) newssb="nada" @@ -89,11 +91,11 @@ def fresh(): except: print 'traceback.format_exc():\n%s' % traceback.format_exc() exit() - #tru/false: + #tru/false whether we have the blob: newssb=proc.stdout.read() + print 'do we have the blob? ' newssb - print newssb - + # if we have it, add it! if (str(newssb)=='true\n'): print "yep, we have the blob" #generate unique file_name diff --git a/run-ssb.sh b/run-ssb.sh index d8887d5..5fb8a32 100755 --- a/run-ssb.sh +++ b/run-ssb.sh @@ -1,6 +1,6 @@ #!/bin/bash while true; do - ssb-server start + ssb-server start -- --friends.hops 1 sleep 300 done