mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 02:57:52 +00:00
Refactor color temrinal escaping into a common module
I have no idea which one of the existing pypi modules is best for these, and given that we're using just two escape codes, I think it makes sense not to bother with a more capable third-party module just for two magic strings.
This commit is contained in:
@@ -31,6 +31,7 @@ from gnpy.core.request import (Path_request, Result_element, compute_constrained
|
||||
propagate, jsontocsv, Disjunction, compute_path_dsjctn, requests_aggregation,
|
||||
propagate_and_optimize_mode)
|
||||
from gnpy.core.exceptions import ConfigurationError
|
||||
import gnpy.core.ansi_escapes as ansi_escapes
|
||||
from copy import copy, deepcopy
|
||||
from textwrap import dedent
|
||||
from math import ceil
|
||||
@@ -312,7 +313,7 @@ if __name__ == '__main__':
|
||||
equipment = load_equipment(args.eqpt_filename)
|
||||
network = load_network(args.network_filename,equipment)
|
||||
except ConfigurationError as e:
|
||||
print('\x1b[1;31;40m' + 'Configuration error:' + '\x1b[0m' + f' {e}')
|
||||
print(f'{ansi_escapes.red}Configuration error:{ansi_escapes.reset} {e}')
|
||||
exit(1)
|
||||
|
||||
# Build the network once using the default power defined in SI in eqpt config
|
||||
|
||||
Reference in New Issue
Block a user