naming convention
This commit is contained in:
		
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -142,5 +142,5 @@ dmypy.json | |||||||
| .pyre/ | .pyre/ | ||||||
| /ftp/ | /ftp/ | ||||||
|  |  | ||||||
| # log files | # inkycal logs | ||||||
| *.log | *inkycal.log* | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| # About Inkycal | # About Inkycal | ||||||
| <img align="center" src="https://raw.githubusercontent.com/aceisace/Inky-Calendar/development/Gallery/logo.png" width="800"> | <img align="center" src="https://github.com/aceisace/Inkycal/raw/assets/Repo/logo.png" width="800"> | ||||||
|  |  | ||||||
| Inkycal is a python3 software for selected E-Paper displays. | Inkycal is a python3 software for selected E-Paper displays. | ||||||
| It's open-source (non-commercially), fully modular, user friendly and even runs | It's open-source (non-commercially), fully modular, user friendly and even runs | ||||||
| @@ -27,5 +27,5 @@ Open source means we work for nothing, but it doesn't mean we don't need | |||||||
| anything. We invest a large amount of time, effort and coffee to develop | anything. We invest a large amount of time, effort and coffee to develop | ||||||
| Inkycal. | Inkycal. | ||||||
|  |  | ||||||
| Please support Inkycal via a **[DONATION](https://www.paypal.me/SaadNaseer)** | Please support Inkycal via a **[DONATION](https://www.paypal.me/aceinnolab)** | ||||||
| to help us keep this project alive. Thank You! | to help us keep this project alive. Thank You! | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| # Quickstart | # Quickstart | ||||||
| <img align="center" src="https://raw.githubusercontent.com/aceisace/Inky-Calendar/development/Gallery/logo.png" width="800"> | <img align="center" src="https://github.com/aceisace/Inkycal/raw/assets/Repo/logo.png" width="800"> | ||||||
|  |  | ||||||
| ## Installing Inkycal | ## Installing Inkycal | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| #!/usr/bin/python3 | #!/usr/bin/python3 | ||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
| """ | """ | ||||||
| Inky-Calendar custom-functions for ease-of-use | Inkycal custom-functions for ease-of-use | ||||||
|  |  | ||||||
| Copyright by aceisace | Copyright by aceisace | ||||||
| """ | """ | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| #!/usr/bin/python3 | #!/usr/bin/python3 | ||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
| """ | """ | ||||||
| Inky-Calendar epaper functions | Inkycal ePaper driving functions | ||||||
| Copyright by aceisace | Copyright by aceisace | ||||||
| """ | """ | ||||||
| from importlib import import_module | 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_image import Inkyimage | ||||||
| from .inkycal_jokes import Jokes | from .inkycal_jokes import Jokes | ||||||
| from .inkycal_stocks import Stocks | from .inkycal_stocks import Stocks | ||||||
| from .inkycal_slideshow import Slideshow | from .inkycal_slideshow import Slideshow | ||||||
| # from .inkycal_server import Inkyserver |  | ||||||
							
								
								
									
										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 | #!python3 | ||||||
|  |  | ||||||
| """ | """ | ||||||
| iCalendar (parsing) module for Inky-Calendar Project | Inkycal iCalendar parsing module | ||||||
| Copyright by aceisace | Copyright by aceisace | ||||||
| """ | """ | ||||||
| import urllib | 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 | Copyright by aceisace | ||||||
| """ | """ | ||||||
|  | import logging | ||||||
|  | import os | ||||||
|  | import numpy | ||||||
|  | import requests | ||||||
|  |  | ||||||
| from PIL import Image | 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] | filename = os.path.basename(__file__).split('.py')[0] | ||||||
| logger = logging.getLogger(filename) | logger = logging.getLogger(filename) | ||||||
| @@ -170,7 +168,7 @@ class Inkyimage: | |||||||
|         """Resize an image to desired width or height""" |         """Resize an image to desired width or height""" | ||||||
|         if self._image_loaded(): |         if self._image_loaded(): | ||||||
|  |  | ||||||
|             if width == None and height == None: |             if not width and not height: | ||||||
|                 logger.error('no height of width specified') |                 logger.error('no height of width specified') | ||||||
|                 return |                 return | ||||||
|  |  | ||||||
| @@ -180,7 +178,7 @@ class Inkyimage: | |||||||
|                 initial_width = image.width |                 initial_width = image.width | ||||||
|                 wpercent = (width / float(image.width)) |                 wpercent = (width / float(image.width)) | ||||||
|                 hsize = int((float(image.height) * float(wpercent))) |                 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}") |                 logger.info(f"resized image from {initial_width} to {image.width}") | ||||||
|                 self.image = image |                 self.image = image | ||||||
|  |  | ||||||
| @@ -188,7 +186,7 @@ class Inkyimage: | |||||||
|                 initial_height = image.height |                 initial_height = image.height | ||||||
|                 hpercent = (height / float(image.height)) |                 hpercent = (height / float(image.height)) | ||||||
|                 wsize = int(float(image.width) * float(hpercent)) |                 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}") |                 logger.info(f"resized image from {initial_height} to {image.height}") | ||||||
|                 self.image = image |                 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 | #!python3 | ||||||
|  |  | ||||||
| """ | """ | ||||||
| Agenda module for Inky-Calendar Project | Inkycal Agenda Module | ||||||
| Copyright by aceisace | 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 | #!python3 | ||||||
|  |  | ||||||
| """ | """ | ||||||
| Calendar module for Inky-Calendar Project | Inkycal Calendar Module | ||||||
| Copyright by aceisace | Copyright by aceisace | ||||||
| """ | """ | ||||||
| from inkycal.modules.template import inkycal_module | 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 | #!python3 | ||||||
|  |  | ||||||
| """ | """ | ||||||
| Image module for Inkycal Project | Inkycal Image Module | ||||||
| Copyright by aceisace | 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 | #!python3 | ||||||
|  |  | ||||||
| """ | """ | ||||||
| Image module for Inkycal Project | Inkycal Slideshow Module | ||||||
| Copyright by aceisace | Copyright by aceisace | ||||||
| """ | """ | ||||||
| import glob | 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 | #!python3 | ||||||
|  |  | ||||||
| """ | """ | ||||||
| Stocks Module for Inkycal Project | 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 | #!python3 | ||||||
|  |  | ||||||
| """ | """ | ||||||
| Weather module for Inky-Calendar software. | Inkycal weather module | ||||||
| Copyright by aceisace | 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 os.path import exists | ||||||
| from inkycal.modules.inky_image import Inkyimage | from inkycal.modules.inky_image import Inkyimage | ||||||
|  |  | ||||||
| preview =  Inkyimage.preview | preview = Inkyimage.preview | ||||||
| merge = Inkyimage.merge | merge = Inkyimage.merge | ||||||
|  |  | ||||||
| def get_environment(): | def get_environment(): | ||||||
|   # Check if this is running on the Raspberry Pi |     # Check if this is running on the Raspberry Pi | ||||||
|   environment = None |     environment = None | ||||||
|   envir_path = '/sys/firmware/devicetree/base/model' |     envir_path = '/sys/firmware/devicetree/base/model' | ||||||
|   if exists(envir_path): |     if exists(envir_path): | ||||||
|     with open(envir_path) as file: |         with open(envir_path) as file: | ||||||
|       if 'Raspberry' in file.read(): |             if 'Raspberry' in file.read(): | ||||||
|         environment = 'Raspberry' |                 environment = 'Raspberry' | ||||||
|   return environment |     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" | test_path = "tmp" | ||||||
|  |  | ||||||
|  |  | ||||||
| tests = [ | tests = [ | ||||||
|     { |     { | ||||||
|         "name": "Slideshow", |         "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