Skip to content

Commit

Permalink
flake8 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
maeriil committed Oct 15, 2023
1 parent 3df7fc7 commit f498969
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
3 changes: 3 additions & 0 deletions backend/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore = E203,W503

2 changes: 1 addition & 1 deletion backend/src/core/imagetranslation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
This module, imagetranslation, contains the main function that will translate
the image to the destination language.
the image to the destination language.
TODO Currently, the only supported destination lang is English. We want to be
able to support multiple destination languages in future
Expand Down
2 changes: 1 addition & 1 deletion backend/src/modules/coreimage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This module, coreimage, contains multiple image processing functions which
can be used to process on the images. All the images are assumed to be of
cv2 image format.
cv2 image format.
"""

Expand Down
3 changes: 1 addition & 2 deletions backend/src/modules/fontdetection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
This module, fontdetection, contains functionalities to determine the font size
of the original text in the image.
of the original text in the image.
TODO This module contains many similarities between textinsertion module
Revamp this module so we dont rewrite same variables/functions
Expand Down Expand Up @@ -118,7 +118,6 @@ def calculate_font_size(
# line_height_gap = interpolate()
padding = 3

font_size = DEFAULT_FONT_SIZE
font_path = DEFAULT_FONT_PATH

if font_name == "wild-words":
Expand Down
3 changes: 1 addition & 2 deletions backend/src/modules/textinsertion.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""
This module, textinsertion, contains functionalities to insert translated text
into the provided image. Note that all the images in this section will be using
Pillow image in order to use custom ImageFont and easier writing methods.
Pillow image in order to use custom ImageFont and easier writing methods.
"""

import math
import numpy as np
import textwrap

from PIL import Image, ImageFont, ImageDraw
Expand Down
6 changes: 3 additions & 3 deletions backend/src/modules/textsection.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
This module, textsection, contains two main classes, textsection and
parenttextsection. The details of each class will contain on its own respective
classes.
classes.
Apart from the classes, this module also contains bounding box merging logics.
The reason for these functions to exist is because EasyOCR is not always able
to correctly merge the text bounding boxes.
to correctly merge the text bounding boxes.
"""

Expand Down Expand Up @@ -255,7 +255,7 @@ def __str__(self) -> str:
content += f"height={self.height}, font-size={self.font_size}, "
content += f"font-type={self.font_type}]\n"
content += f"\tOriginal=[{self.original_section.__str__()}]\n"
content += f"\tChildren=[\n"
content += "\tChildren=[\n"

for child in self.children:
content += f"\t\t[{child.__str__()}],\n"
Expand Down
4 changes: 2 additions & 2 deletions backend/src/modules/translators/google_translator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This module, google_translator, contains the Google Translate API functions
used to translate the texts into english language. All credentials must be
exported out from this page for security reasons.
used to translate the texts into english language. All credentials must be
exported out from this page for security reasons.
"""
from google.cloud import translate_v2 as translate
Expand Down

0 comments on commit f498969

Please sign in to comment.