From 4c43ce978eb7db1375c3c4adda5d421226a6e16e Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 29 May 2018 15:15:33 -0400 Subject: [PATCH] linting --- Cyber_Flower/main.py | 1 + Cyber_Flower/main_simple.py | 1 + EPROM_Emulator/directory_node.py | 10 +++++++--- EPROM_Emulator/main.py | 1 + Foul_Fowl/main.py | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cyber_Flower/main.py b/Cyber_Flower/main.py index 2b2f4e0af..a0d3da9d3 100644 --- a/Cyber_Flower/main.py +++ b/Cyber_Flower/main.py @@ -127,6 +127,7 @@ def lerp(x, x0, x1, y0, y1): return y0 + (x - x0) * ((y1 - y0) / (x1 - x0)) +# pylint: disable=redefined-outer-name # Main loop below will run forever: while True: # Get the current time at the start of the animation update. diff --git a/Cyber_Flower/main_simple.py b/Cyber_Flower/main_simple.py index 986ca2c2e..8ffe6abc9 100644 --- a/Cyber_Flower/main_simple.py +++ b/Cyber_Flower/main_simple.py @@ -131,6 +131,7 @@ beat_phase = beat_period / 5.0 # Phase controls how long in-between # the two parts of the heart beat # (the 'ba-boom' of the beat). +# pylint: disable=redefined-outer-name # Define a gamma correction lookup table to make colors more accurate. # See this guide for more background on gamma correction: # https://learn.adafruit.com/led-tricks-gamma-correction/ diff --git a/EPROM_Emulator/directory_node.py b/EPROM_Emulator/directory_node.py index 73b1f0f29..f649863ad 100644 --- a/EPROM_Emulator/directory_node.py +++ b/EPROM_Emulator/directory_node.py @@ -55,7 +55,8 @@ class DirectoryNode(object): self.files = None return self - def __is_dir(self, path): + @staticmethod + def __is_dir(path): """Determine whether a path identifies a machine code bin file. :param string path: path of the file to check """ @@ -67,7 +68,8 @@ class DirectoryNode(object): except OSError: return False - def __sanitize(self, name): + @staticmethod + def __sanitize(name): """Nondestructively strip off a trailing slash, if any, and return the result. :param string name: the filename """ @@ -75,6 +77,7 @@ class DirectoryNode(object): return name[:-1] return name + # pylint: disable=protected-access def __path(self): """Return the result of recursively follow the parent links, building a full path to this directory.""" @@ -133,7 +136,8 @@ class DirectoryNode(object): self.display.show() self.old_selected_offset = self.selected_offset - def __is_directory_name(self, filename): + @staticmethod + def __is_directory_name(filename): """Is a filename the name of a directory. :param string filename: the name of the file """ diff --git a/EPROM_Emulator/main.py b/EPROM_Emulator/main.py index 9fc5a483b..03aba4a0a 100644 --- a/EPROM_Emulator/main.py +++ b/EPROM_Emulator/main.py @@ -120,6 +120,7 @@ def display_emulating_screen(): oled.show() +#pylint disable=global-statement def emulate(): global current_mode data = load_file(current_dir.selected_filepath) diff --git a/Foul_Fowl/main.py b/Foul_Fowl/main.py index 978f00ebe..22e879a84 100644 --- a/Foul_Fowl/main.py +++ b/Foul_Fowl/main.py @@ -58,6 +58,7 @@ pause = 0.25 # The functions that follow are the various payloads to deliver +# pylint: disable=too-many-statements def launch_terminal(): if operating_system is 0: led.value = False