-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checker: Added checkers for too more empty lines - fix: #4
- Loading branch information
1 parent
adb71eb
commit 93113cf
Showing
6 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
WSC008: More than 2 empty lines | ||
================================ | ||
|
||
Alerting for more than 2 empty lines after the firs and before the last non-empty lines. | ||
|
||
|
||
Example | ||
------- | ||
|
||
.. test-wsc:: examples/WSC008_more_empty_lines.py | ||
|
||
In <PATH> line 10: | ||
os.makedirs(self.__print_cache_dir, exist_ok=True) | ||
^-- WSC008: More than 2 empty lines (+1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class LabelPrinter: | ||
def __generate_pdf(self): | ||
pdf_generator = _LabelPdfGenerator() | ||
pdf_generator.generate_label( | ||
self.__title, self.__data, self.__logo_path, config.App.LABEL_BORDER, | ||
output_path=self.__pdf_path) | ||
|
||
|
||
def __prepare_print_cache_dir(self): | ||
os.makedirs(self.__print_cache_dir, exist_ok=True) | ||
|
||
|
||
|
||
def __get_pdf_path(self) -> str: | ||
pdf_name = self.__pdf_name_template.format( | ||
data=self.__data, | ||
title_hash=hashlib.sha1(self.__title.encode()).hexdigest()) | ||
return os.path.join(self.__print_cache_dir, pdf_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters