naming convention
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Inky-Calendar custom-functions for ease-of-use
|
||||
Inkycal custom-functions for ease-of-use
|
||||
|
||||
Copyright by aceisace
|
||||
"""
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Inky-Calendar epaper functions
|
||||
Inkycal ePaper driving functions
|
||||
Copyright by aceisace
|
||||
"""
|
||||
from importlib import import_module
|
||||
|
3
inkycal/modules/__init__.py
Normal file → Executable file
3
inkycal/modules/__init__.py
Normal file → Executable file
@@ -6,5 +6,4 @@ from .inkycal_todoist import Todoist
|
||||
from .inkycal_image import Inkyimage
|
||||
from .inkycal_jokes import Jokes
|
||||
from .inkycal_stocks import Stocks
|
||||
from .inkycal_slideshow import Slideshow
|
||||
# from .inkycal_server import Inkyserver
|
||||
from .inkycal_slideshow import Slideshow
|
0
inkycal/modules/dev_module.py
Normal file → Executable file
0
inkycal/modules/dev_module.py
Normal file → Executable file
2
inkycal/modules/ical_parser.py
Normal file → Executable file
2
inkycal/modules/ical_parser.py
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#!python3
|
||||
|
||||
"""
|
||||
iCalendar (parsing) module for Inky-Calendar Project
|
||||
Inkycal iCalendar parsing module
|
||||
Copyright by aceisace
|
||||
"""
|
||||
import urllib
|
||||
|
16
inkycal/modules/inky_image.py
Normal file → Executable file
16
inkycal/modules/inky_image.py
Normal file → Executable file
@@ -8,14 +8,12 @@ images.
|
||||
|
||||
Copyright by aceisace
|
||||
"""
|
||||
import logging
|
||||
import os
|
||||
import numpy
|
||||
import requests
|
||||
|
||||
from PIL import Image
|
||||
import requests
|
||||
import numpy
|
||||
import os
|
||||
import logging
|
||||
|
||||
from PIL.Image import Resampling
|
||||
|
||||
filename = os.path.basename(__file__).split('.py')[0]
|
||||
logger = logging.getLogger(filename)
|
||||
@@ -170,7 +168,7 @@ class Inkyimage:
|
||||
"""Resize an image to desired width or height"""
|
||||
if self._image_loaded():
|
||||
|
||||
if width == None and height == None:
|
||||
if not width and not height:
|
||||
logger.error('no height of width specified')
|
||||
return
|
||||
|
||||
@@ -180,7 +178,7 @@ class Inkyimage:
|
||||
initial_width = image.width
|
||||
wpercent = (width / float(image.width))
|
||||
hsize = int((float(image.height) * float(wpercent)))
|
||||
image = image.resize((width, hsize), Resampling.LANCZOS)
|
||||
image = image.resize((width, hsize), Image.LANCZOS)
|
||||
logger.info(f"resized image from {initial_width} to {image.width}")
|
||||
self.image = image
|
||||
|
||||
@@ -188,7 +186,7 @@ class Inkyimage:
|
||||
initial_height = image.height
|
||||
hpercent = (height / float(image.height))
|
||||
wsize = int(float(image.width) * float(hpercent))
|
||||
image = image.resize((wsize, height), Resampling.LANCZOS)
|
||||
image = image.resize((wsize, height), Image.LANCZOS)
|
||||
logger.info(f"resized image from {initial_height} to {image.height}")
|
||||
self.image = image
|
||||
|
||||
|
2
inkycal/modules/inkycal_agenda.py
Normal file → Executable file
2
inkycal/modules/inkycal_agenda.py
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#!python3
|
||||
|
||||
"""
|
||||
Agenda module for Inky-Calendar Project
|
||||
Inkycal Agenda Module
|
||||
Copyright by aceisace
|
||||
"""
|
||||
|
||||
|
2
inkycal/modules/inkycal_calendar.py
Normal file → Executable file
2
inkycal/modules/inkycal_calendar.py
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#!python3
|
||||
|
||||
"""
|
||||
Calendar module for Inky-Calendar Project
|
||||
Inkycal Calendar Module
|
||||
Copyright by aceisace
|
||||
"""
|
||||
from inkycal.modules.template import inkycal_module
|
||||
|
2
inkycal/modules/inkycal_image.py
Normal file → Executable file
2
inkycal/modules/inkycal_image.py
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#!python3
|
||||
|
||||
"""
|
||||
Image module for Inkycal Project
|
||||
Inkycal Image Module
|
||||
Copyright by aceisace
|
||||
"""
|
||||
|
||||
|
0
inkycal/modules/inkycal_jokes.py
Normal file → Executable file
0
inkycal/modules/inkycal_jokes.py
Normal file → Executable file
0
inkycal/modules/inkycal_server.py
Normal file → Executable file
0
inkycal/modules/inkycal_server.py
Normal file → Executable file
2
inkycal/modules/inkycal_slideshow.py
Normal file → Executable file
2
inkycal/modules/inkycal_slideshow.py
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#!python3
|
||||
|
||||
"""
|
||||
Image module for Inkycal Project
|
||||
Inkycal Slideshow Module
|
||||
Copyright by aceisace
|
||||
"""
|
||||
import glob
|
||||
|
1
inkycal/modules/inkycal_stocks.py
Normal file → Executable file
1
inkycal/modules/inkycal_stocks.py
Normal file → Executable file
@@ -1,5 +1,4 @@
|
||||
#!python3
|
||||
|
||||
"""
|
||||
Stocks Module for Inkycal Project
|
||||
|
||||
|
2
inkycal/modules/inkycal_weather.py
Normal file → Executable file
2
inkycal/modules/inkycal_weather.py
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#!python3
|
||||
|
||||
"""
|
||||
Weather module for Inky-Calendar software.
|
||||
Inkycal weather module
|
||||
Copyright by aceisace
|
||||
"""
|
||||
|
||||
|
0
inkycal/modules/template.py
Normal file → Executable file
0
inkycal/modules/template.py
Normal file → Executable file
18
inkycal/tests/helper_functions.py
Normal file → Executable file
18
inkycal/tests/helper_functions.py
Normal file → Executable file
@@ -10,15 +10,15 @@ import sys
|
||||
from os.path import exists
|
||||
from inkycal.modules.inky_image import Inkyimage
|
||||
|
||||
preview = Inkyimage.preview
|
||||
preview = Inkyimage.preview
|
||||
merge = Inkyimage.merge
|
||||
|
||||
def get_environment():
|
||||
# Check if this is running on the Raspberry Pi
|
||||
environment = None
|
||||
envir_path = '/sys/firmware/devicetree/base/model'
|
||||
if exists(envir_path):
|
||||
with open(envir_path) as file:
|
||||
if 'Raspberry' in file.read():
|
||||
environment = 'Raspberry'
|
||||
return environment
|
||||
# Check if this is running on the Raspberry Pi
|
||||
environment = None
|
||||
envir_path = '/sys/firmware/devicetree/base/model'
|
||||
if exists(envir_path):
|
||||
with open(envir_path) as file:
|
||||
if 'Raspberry' in file.read():
|
||||
environment = 'Raspberry'
|
||||
return environment
|
||||
|
0
inkycal/tests/ical_parser_test.py
Normal file → Executable file
0
inkycal/tests/ical_parser_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_agenda_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_agenda_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_calendar_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_calendar_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_feeds_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_feeds_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_image_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_image_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_jokes_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_jokes_test.py
Normal file → Executable file
1
inkycal/tests/inkycal_slideshow_test.py
Normal file → Executable file
1
inkycal/tests/inkycal_slideshow_test.py
Normal file → Executable file
@@ -33,7 +33,6 @@ for count, url in enumerate(im_urls):
|
||||
|
||||
test_path = "tmp"
|
||||
|
||||
|
||||
tests = [
|
||||
{
|
||||
"name": "Slideshow",
|
||||
|
0
inkycal/tests/inkycal_stocks_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_stocks_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_weather_test.py
Normal file → Executable file
0
inkycal/tests/inkycal_weather_test.py
Normal file → Executable file
0
inkycal/tests/main_test.py
Normal file → Executable file
0
inkycal/tests/main_test.py
Normal file → Executable file
Reference in New Issue
Block a user