New folder structure

redesign
Josef Dabrowski 7 years ago
parent fed62b7d06
commit 1dcb98172e

@ -0,0 +1,6 @@
[Dolphin]
Timestamp=2019,1,23,16,14,48
Version=4
[Settings]
HiddenFilesShown=true

2
.gitignore vendored

@ -1,2 +1,4 @@
*.py[cod]
*.secret
test/*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

@ -1 +0,0 @@
hello

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

@ -0,0 +1,5 @@
[Dolphin]
PreviewsShown=false
Timestamp=2019,1,23,16,24,39
Version=4
ViewMode=1

@ -1,15 +1,18 @@
from PIL import Image, ImageDraw, ImageFont, ImageOps
import re
import time
import widget
import widgets.widget as widget
import argparse
import os
try:
import epd7in5b
import drivers.epd7in5b
testMode = False
except:
testMode = True
parser = argparse.ArgumentParser(description="EinkPaper display")
mydir = os.path.dirname(os.path.abspath(__file__))
parser = argparse.ArgumentParser(description="NotiFrame display")
parser.add_argument('-t', '--test', help='enable test mode', action='store_true')
args = parser.parse_args()
if args.test:
@ -31,17 +34,17 @@ draw_yellow = ImageDraw.Draw(image_yellow)
image_black = Image.new('1', (width, height), 255) # 255: clear the frame
draw_black = ImageDraw.Draw(image_black)
str1 = open("text.txt", "r").read()
str2 = open("text.txt", "r").read()
str3 = open("text.txt", "r").read()
strList = []
strList.append(str1)
strList.append(str2)
strList.append(str3)
#str1 = open("text.txt", "r").read()
#str2 = open("text.txt", "r").read()
#str3 = open("text.txt", "r").read()
#strList = []
#strList.append(str1)
#strList.append(str2)
#strList.append(str3)
def initWidgets():
widgetList = []
#widgetList.append(widget.ImageWidget(cwidth, cheight, (0, 0), (3, 3), "mono", "fill", "forest.jpg"))
widgetList.append(widget.ImageWidget(cwidth, cheight, (0, 0), (3, 3), "mono", "fill", os.path.join(mydir, 'widgets/resources/images/forest.jpg')))
widgetList.append(widget.TrelloWidget(cwidth, cheight, (0, 0), (1, 3), "Organisation", "Plans"))
widgetList.append(widget.TrelloWidget(cwidth, cheight, (1, 0), (2, 3), "E-paper", "Done"))
#widgetList.append(widget.ImageWidget(cwidth, cheight, (1, 2), (2, 1), "mono", "fill", "forest.jpg"))
@ -67,8 +70,8 @@ def render(index):
if not testMode:
epd.display_frame(epd.get_frame_buffer(image_black),epd.get_frame_buffer(image_yellow))
else:
image_black.save("imgBlack.bmp")
image_yellow.save("imgYellow.bmp")
image_black.save(os.path.join(mydir, 'test/imgBlack.bmp'))
image_yellow.save(os.path.join(mydir, 'test/imgYellow.bmp'))
widgetList = initWidgets()
i = 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Before

Width:  |  Height:  |  Size: 350 KiB

After

Width:  |  Height:  |  Size: 350 KiB

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 891 KiB

After

Width:  |  Height:  |  Size: 891 KiB

Before

Width:  |  Height:  |  Size: 759 KiB

After

Width:  |  Height:  |  Size: 759 KiB

@ -5,9 +5,9 @@ from trello import TrelloClient
import os
import requests
from requests_oauthlib import OAuth1Session
import re
mydir = os.path.dirname(os.path.abspath(__file__))
def textBox(text, font, position, limits, colour, draw_black):
str = ""
@ -38,11 +38,11 @@ def textBox(text, font, position, limits, colour, draw_black):
def putImage(imagepath, maskpath, position, colour):
if type(imagepath) is str:
if type(imagepath) is str:
img = Image.open(imagepath)
else:
img = imagepath
if type(imagepath) is str:
if type(imagepath) is str:
mask = Image.open(maskpath).convert(mode='1')
else:
mask = maskpath
@ -111,7 +111,7 @@ def roundRect(draw, topLeft, bottomRight, arcsize, type):
draw.line((lineStart, lastLineEnd))
class TextWidget():
@ -132,7 +132,7 @@ class TextWidget():
self.draw_black = ImageDraw.Draw(self.image_black)
self.mask_black = Image.new('1', (self.wt, self.ht), 255)
self.draw_mask_black = ImageDraw.Draw(self.mask_black)
self.font = ImageFont.truetype('DejaVuSans.ttf', 16)
self.font = ImageFont.truetype(os.path.join(mydir, 'resources/fonts/DejaVuSans.ttf'), 16)
self.stringInput = stringIn
self.updateWidget()
@ -144,8 +144,8 @@ class TextWidget():
textBox(str, self.font, position, limit, "black", self.draw_black)
def saveImages(self):
self.image_black.save("imgBlackWidget.bmp")
self.image_yellow.save("imgYellowWidget.bmp")
self.image_black.save(os.path.join(mydir, '../test/imgBlackWidget.bmp'))
self.image_yellow.save(os.path.join(mydir, '../test/imgYellowWidget.bmp'))
def updateWidget(self):
if self.stringInput is not None:
@ -209,7 +209,7 @@ class ImageWidget():
def autoThresholdLimit(self, img):
gscale = img.convert(mode="L")
gscale.save("greyscale.bmp")
gscale.save(os.path.join(mydir, '../test/greyscale.bmp'))
extrema = gscale.getextrema()
limit = extrema[0] + 0.4 * (extrema[1] - extrema[0])
self.thresLim = limit
@ -238,8 +238,8 @@ class ImageWidget():
self.image_black.paste(img, (0, offset))
def saveImages(self):
self.image_black.save("imgBlackWidget.bmp")
self.image_yellow.save("imgYellowWidget.bmp")
self.image_black.save(os.path.join(mydir, '../test/imgBlackWidget.bmp'))
self.image_yellow.save(os.path.join(mydir, '../test/imgYellowWidget.bmp'))
def updateWidget(self):
if self.image is not None:
@ -249,9 +249,7 @@ class ImageWidget():
rsImg = self.resizeImg(self.image)
if self.scaleMode is "none":
rsImg = self.image
rsImg.save("rsImg.bmp")
newImg = self.bwImg(rsImg)
newImg.save("bwImg.bmp")
self.pasteImg(newImg)
self.saveImages()
@ -280,9 +278,10 @@ class TrelloWidget():
self.draw_mask_black = ImageDraw.Draw(self.mask_black)
self.lastY = 0
self.cardLastY = 0
self.font1 = ImageFont.truetype('DejaVuSans.ttf', 12)
self.font2 = ImageFont.truetype('DejaVuSans.ttf', 13)
self.font3 = ImageFont.truetype('DejaVuSans.ttf', 10)
fontpath = os.path.join(mydir, 'resources/fonts/DejaVuSans.ttf')
self.font1 = ImageFont.truetype(fontpath, 12)
self.font2 = ImageFont.truetype(fontpath, 13)
self.font3 = ImageFont.truetype(fontpath, 10)
self.updateWidget()
@ -364,8 +363,8 @@ class TrelloWidget():
self.mask_black = Image.new('1', (self.wt, self.ht), 255)
card_list = self.cardsFromBoard(self.boardName, self.listName)
self.printCards(card_list)
self.image_black.save("card_image.bmp")
self.mask_black.save("mask.bmp")
self.image_black.save(os.path.join(mydir, '../test/card_image.bmp'))
self.mask_black.save(os.path.join(mydir, '../test/mask.bmp'))
#self.draw_black.rectangle((0, 0, self.wt, self.ht), fill=255) #inclusive/exclusive dimensions?
#self.draw_yellow.rectangle((0, 0, self.wt, self.ht), fill=255)
#textBox(content, self.font, (0,0), (self.wt, self.ht), "black", self.draw_black)
@ -406,8 +405,8 @@ class TrelloWidget():
card_image = card_image.crop((0, 0, card_wt, card_ht+1))
mask_image = ImageOps.invert(mask_image.convert('L'))
card_image.save("card_image.bmp")
card_image.save(os.path.join(mydir, '../test/card_image.bmp'))
self.cardLastY = 0
return card_image, mask_image
@ -434,8 +433,3 @@ class TrelloWidget():
for crd in card_list:
cards.append(self.makeCard(crd))
return cards

@ -1,3 +0,0 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?
Loading…
Cancel
Save