docstrings all end with a dot

This commit is contained in:
Martin Patz 2020-03-23 01:04:07 +01:00
parent 7e01b0d84c
commit 1b07640875

View File

@ -50,7 +50,7 @@ class Color:
@property @property
def octal(self): def octal(self):
"""Export color in octal""" """Export color in octal."""
return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:]) return "%s%s" % ("#", oct(int(self.hex_color[1:], 16))[2:])
@property @property
@ -79,17 +79,17 @@ class Color:
return "%.3f" % (hex_to_rgb(self.hex_color)[2]/255.) return "%.3f" % (hex_to_rgb(self.hex_color)[2]/255.)
def lighten(self, percent): def lighten(self, percent):
"""Lighten color by percent""" """Lighten color by percent."""
percent = float(re.sub(r'[\D\.]', '', str(percent))) percent = float(re.sub(r'[\D\.]', '', str(percent)))
return Color(lighten_color(self.hex_color, percent / 100)) return Color(lighten_color(self.hex_color, percent / 100))
def darken(self, percent): def darken(self, percent):
"""Darken color by percent""" """Darken color by percent."""
percent = float(re.sub(r'[\D\.]', '', str(percent))) percent = float(re.sub(r'[\D\.]', '', str(percent)))
return Color(darken_color(self.hex_color, percent / 100)) return Color(darken_color(self.hex_color, percent / 100))
def saturate(self, percent): def saturate(self, percent):
"""Saturate a color""" """Saturate a color."""
percent = float(re.sub(r'[\D\.]', '', str(percent))) percent = float(re.sub(r'[\D\.]', '', str(percent)))
return Color(saturate_color(self.hex_color, percent / 100)) return Color(saturate_color(self.hex_color, percent / 100))
@ -108,7 +108,7 @@ def read_file_json(input_file):
def read_file_raw(input_file): def read_file_raw(input_file):
"""Read data from a file as is, don't strip """Read data from a file as is, don't strip
newlines or other special characters..""" newlines or other special characters."""
with open(input_file, "r") as file: with open(input_file, "r") as file:
return file.readlines() return file.readlines()