Skip to content

Commit

Permalink
Version 1.0.16.prod
Browse files Browse the repository at this point in the history
  • Loading branch information
btr1975 committed Feb 16, 2019
1 parent baa868e commit 734d8f9
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Ben Trachtenberg
Copyright (c) 2019 Ben Trachtenberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ ipaddresstools = "==1.2.8"
requests = "==2.20.0"
flask = "==1.0.2"
flask-restful = "==0.3.6"
colorama = "*"

[requires]
python_version = "3.5"
python_version = "3.7"

[dev-packages]
pyinstaller = "*"
19 changes: 17 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This script is for simple config templates, to make life easier on admins/engine
* [1.0.13.prod](https://github.com/btr1975/QuickConfigTemplates/wiki/Version-1.0.13.prod)
* [1.0.14.prod](https://github.com/btr1975/QuickConfigTemplates/wiki/Version-1.0.14.prod)
* [1.0.15.prod](https://github.com/btr1975/QuickConfigTemplates/wiki/Version-1.0.15.prod)
* [1.0.16.prod](https://github.com/btr1975/QuickConfigTemplates/wiki/Version-1.0.16.prod)

### Requirements
* [See Pipfile](https://github.com/btr1975/QuickConfigTemplates/blob/master/Pipfile)
Expand All @@ -49,4 +50,4 @@ version of pyinstaller.

See the details here [pyinstaller github bug #2434](https://github.com/pyinstaller/pyinstaller/issues/2434)

Compiles fine with pyinstaller 3.3.1
Compiles fine with pyinstaller 3.3.1 and above
2 changes: 1 addition & 1 deletion __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
__copyright__ = "Copyright (c) 2018 Ben Trachtenberg"
__credits__ = 'Benjamin P. Trachtenberg'
__license__ = 'MIT'
__status__ = 'dev'
__status__ = 'prod'
__version_info__ = (1, 0, 16, __status__)
__version__ = '.'.join(map(str, __version_info__))
__maintainer__ = 'Benjamin P. Trachtenberg'
Expand Down
22 changes: 19 additions & 3 deletions module/scripts/template_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
Expand Down Expand Up @@ -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))

Expand Down Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ ipaddresstools==1.2.8
requests==2.20.0
flask==1.0.2
flask-restful==0.3.6
colorama

0 comments on commit 734d8f9

Please sign in to comment.