fix docs
Fix an issue with docs not being able to find Inkycal modules
This commit is contained in:
parent
34550d2e3e
commit
bef931097b
@ -12,7 +12,7 @@
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('.'))
|
||||
sys.path.insert(0, os.path.abspath('../../inkycal'))
|
||||
|
||||
master_doc = 'index'
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
@ -44,7 +44,7 @@ class Display:
|
||||
except FileNotFoundError:
|
||||
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.
|
||||
|
||||
Initlializes the E-Paper display, sends image data and executes command
|
||||
@ -153,7 +153,7 @@ class Display:
|
||||
epaper.sleep()
|
||||
|
||||
@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)
|
||||
|
||||
Looks inside "drivers" folder for the given model name, then returns it's
|
||||
|
@ -19,11 +19,11 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
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):
|
||||
"""Initialize Inkyimage module"""
|
||||
"""Initialize InkyImage module"""
|
||||
|
||||
# no image initially
|
||||
self.image = image
|
||||
@ -114,7 +114,7 @@ class Inkyimage:
|
||||
self.image = image
|
||||
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.
|
||||
|
||||
Args:
|
||||
@ -215,7 +215,7 @@ class Inkyimage:
|
||||
|
||||
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 each pixel from the image to a colour from the palette.
|
||||
@ -320,7 +320,7 @@ class Inkyimage:
|
||||
|
||||
else:
|
||||
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')
|
||||
|
||||
@ -329,3 +329,4 @@ class Inkyimage:
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(f'running {__name__} in standalone/debug mode')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user