Tweaking, including reducing sig figs in weather
This commit is contained in:
12
imagegen.py
12
imagegen.py
@@ -20,10 +20,10 @@ row = 0 # current row to write at
|
||||
out = Image.new("L", (displaysize[0], displaysize[1]),255)
|
||||
|
||||
# get a font
|
||||
HeightNormal = 25
|
||||
HeightBold = 35
|
||||
#HeightNormal = 25
|
||||
#HeightBold = 35
|
||||
MarginLeft = 1
|
||||
MarginIndent = 5
|
||||
MarginIndent = 10
|
||||
# get a drawing context
|
||||
d = ImageDraw.Draw(out)
|
||||
|
||||
@@ -35,7 +35,7 @@ row = WriteTextBlock(txt1,d,fntBigBold,displaysize[0]/2,row,"ma")
|
||||
txt1a = "As of "+datetime.datetime.now(pytz.timezone('America/New_York')).strftime('%I:%M %p')
|
||||
row = WriteTextBlock(txt1a,d,fnt,displaysize[0]/2,row,"ma")
|
||||
|
||||
row = WriteTextBlock("Weather",d,fnt,MarginLeft,row,"la")
|
||||
row = WriteTextBlock("Weather",d,fntBold,MarginLeft,row,"la")
|
||||
try:
|
||||
weather = google_weather.get_google_weather()
|
||||
txt2 = "Current: "+weather["current"] \
|
||||
@@ -45,11 +45,9 @@ except: # Assume the weather API blew up
|
||||
txt2 = "Problem getting weather (from ImageGen)"
|
||||
row = WriteTextBlock(txt2,d,fnt,MarginIndent,row,"la")
|
||||
|
||||
row = WriteTextBlock("Pirates",d,fnt,MarginLeft,row,"la")
|
||||
row = WriteTextBlock("Pirates",d,fntBold,MarginLeft,row,"la")
|
||||
row = WriteTextBlock(mlb.get_pirates(),d,fnt,MarginIndent,row,"la")
|
||||
|
||||
row = WriteTextBlock("========== End =========",d,fnt,MarginLeft,row,"la")
|
||||
|
||||
out.save("/mnt/nfs/HomeAutomation/ForHA.jpg","JPEG")
|
||||
#out.show()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user