forked from quattor/pan
-
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.
Add fallback functionality for Colorama and PrettyTable
Resolves quattor#218.
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 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
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,39 @@ | ||
""" Panlint fallback functionality for systems without Colorama and PrettyTable """ | ||
|
||
# Disable pylint too-few methods check as we are providing stub classes rather than useful functionality | ||
# pylint: disable=R0903 | ||
|
||
class Fore(object): | ||
BLUE = '' | ||
CYAN = '' | ||
GREEN = '' | ||
RED = '' | ||
RESET = '' | ||
YELLOW = '' | ||
|
||
|
||
class Style(object): | ||
BRIGHT = '' | ||
DIM = '' | ||
RESET_ALL = '' | ||
|
||
|
||
def init(**_): | ||
pass | ||
|
||
|
||
class PrettyTable(object): | ||
def __init__(self, cols): | ||
cols = [str(c) for c in cols] | ||
self.rows = ['\t'.join(cols)] | ||
self.align = dict(zip(cols, cols)) | ||
|
||
def __str__(self): | ||
return '\n'.join(self.rows) | ||
|
||
def add_row(self, cols): | ||
cols = [str(c) for c in cols] | ||
self.rows.append('\t'.join(cols)) | ||
|
||
def sortby(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