-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce BaseFormat class and report generation
BaseFormat has a decorator to provide common report formatting capabilities for generated report sections. Strings have been extracted to constants.
- Loading branch information
1 parent
c90cde8
commit c029ed9
Showing
3 changed files
with
57 additions
and
10 deletions.
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,17 @@ | ||
from abc import ABCMeta, abstractmethod | ||
|
||
LINES_BEFORE_SECTION = "\n\n" | ||
LINES_AFTER_SECTION = "\n\n" | ||
|
||
|
||
def formatted_section(func): | ||
def wrapper(self): | ||
return LINES_BEFORE_SECTION + func(self) + LINES_AFTER_SECTION | ||
return wrapper | ||
|
||
|
||
class BaseClient(metaclass=ABCMeta): | ||
|
||
@abstractmethod | ||
def generate_report(self): | ||
pass |
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