Fix an issue with docs not being able to find Inkycal modules
This commit is contained in:
Ace 2023-12-07 18:40:24 +01:00
parent 34550d2e3e
commit bef931097b
3 changed files with 9 additions and 8 deletions

View File

@ -12,7 +12,7 @@
# #
import os import os
import sys import sys
sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('../../inkycal'))
master_doc = 'index' master_doc = 'index'
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------

View File

@ -44,7 +44,7 @@ class Display:
except FileNotFoundError: except FileNotFoundError:
raise Exception('SPI could not be found. Please check if SPI is enabled') raise Exception('SPI could not be found. Please check if SPI is enabled')
def render(self, im_black: Image, im_colour=Image or None) -> None: def render(self, im_black: Image, im_colour:Image or None) -> None:
"""Renders an image on the selected E-Paper display. """Renders an image on the selected E-Paper display.
Initlializes the E-Paper display, sends image data and executes command Initlializes the E-Paper display, sends image data and executes command
@ -153,7 +153,7 @@ class Display:
epaper.sleep() epaper.sleep()
@classmethod @classmethod
def get_display_size(cls, model_name): def get_display_size(cls, model_name) -> (int, int):
"""Returns the size of the display as a tuple -> (width, height) """Returns the size of the display as a tuple -> (width, height)
Looks inside "drivers" folder for the given model name, then returns it's Looks inside "drivers" folder for the given model name, then returns it's

View File

@ -19,11 +19,11 @@ logger = logging.getLogger(__name__)
class Inkyimage: class Inkyimage:
"""Custom Imge class written for commonly used image operations. """Custom Imgae class written for commonly used image operations.
""" """
def __init__(self, image=None): def __init__(self, image=None):
"""Initialize Inkyimage module""" """Initialize InkyImage module"""
# no image initially # no image initially
self.image = image self.image = image
@ -114,7 +114,7 @@ class Inkyimage:
self.image = image self.image = image
logger.info(f'flipped image by {angle} degrees') logger.info(f'flipped image by {angle} degrees')
def autoflip(self, layout): def autoflip(self, layout:str) -> None:
"""flips the image automatically to the given layout. """flips the image automatically to the given layout.
Args: Args:
@ -215,7 +215,7 @@ class Inkyimage:
return image1 return image1
def to_palette(self, palette, dither=True): def to_palette(self, palette, dither=True) -> (Image, Image):
"""Maps an image to a given colour palette. """Maps an image to a given colour palette.
Maps each pixel from the image to a colour from the palette. Maps each pixel from the image to a colour from the palette.
@ -320,7 +320,7 @@ class Inkyimage:
else: else:
im_black = image.convert('1', dither=dither) im_black = image.convert('1', dither=dither)
im_colour = Image.new(mode='RGB', size=im_black.size, color='white') im_colour = Image.new(mode='1', size=im_black.size, color='white')
logger.info('mapped image to specified palette') logger.info('mapped image to specified palette')
@ -329,3 +329,4 @@ class Inkyimage:
if __name__ == '__main__': if __name__ == '__main__':
print(f'running {__name__} in standalone/debug mode') print(f'running {__name__} in standalone/debug mode')