-
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.
- Loading branch information
Showing
7 changed files
with
43 additions
and
9 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,15 @@ | |
import persistentdatatools as pdt | ||
import os | ||
import re | ||
import colorama | ||
from .arestme import ARestMe | ||
from ..utils import custom_filters | ||
__author__ = 'Benjamin P. Trachtenberg' | ||
__copyright__ = "Copyright (c) 2018 Ben Trachtenberg" | ||
__credits__ = 'Benjamin P. Trachtenberg' | ||
__license__ = 'MIT' | ||
__status__ = 'prod' | ||
__version_info__ = (2, 0, 7, __status__) | ||
__version_info__ = (2, 0, 8, __status__) | ||
__version__ = '.'.join(map(str, __version_info__)) | ||
__maintainer__ = 'Benjamin P. Trachtenberg' | ||
__email__ = '[email protected]' | ||
|
@@ -185,7 +186,15 @@ def __run_template_v2(self): | |
LOGGER.critical('Can not write output {}'.format(self.directories.get_output_dir())) | ||
sys.exit(e) | ||
|
||
print(template.render(group)) | ||
colorama.init(autoreset=True) | ||
|
||
for line in template.render(group).splitlines(): | ||
if 'error' in line: | ||
print(colorama.Fore.RED + colorama.Style.BRIGHT + line) | ||
|
||
else: | ||
print(colorama.Fore.GREEN + colorama.Style.BRIGHT + line) | ||
|
||
if self.begin_string or self.include_string: | ||
self.__get_found_data(template.render(group)) | ||
|
||
|
@@ -509,7 +518,14 @@ def server_rest(self): | |
|
||
if response_data.get('status_code') == 200: | ||
config = response_data.get('config') | ||
print(config) | ||
colorama.init(autoreset=True) | ||
for line in config.splitlines(): | ||
if 'error' in line: | ||
print(colorama.Fore.RED + colorama.Style.BRIGHT + line) | ||
|
||
else: | ||
print(colorama.Fore.GREEN + colorama.Style.BRIGHT + line) | ||
|
||
if self.begin_string or self.include_string: | ||
self.__get_found_data(config) | ||
|
||
|
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ ipaddresstools==1.2.8 | |
requests==2.20.0 | ||
flask==1.0.2 | ||
flask-restful==0.3.6 | ||
colorama |