Skip to content

Commit

Permalink
Move initialization of global to outside function
Browse files Browse the repository at this point in the history
  • Loading branch information
aanker committed Oct 22, 2022
1 parent 3b6b76b commit d2f9873
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xwordlist.py
Expand Up @@ -26,6 +26,8 @@
'impact_color': 'ansired',
}

IMPACT_COLOR = GLOBAL_SETTINGS['impact_color']

COLOR_OPTIONS = ['ansiblack', 'ansired', 'ansigreen', 'ansiyellow', 'ansiblue', 'ansimagenta',
'ansicyan', 'ansigray', 'ansibrightblack', 'ansibrightred', 'ansibrightgreen',
'ansibrightyellow', 'ansibrightblue', 'ansibrightmagenta', 'ansibrightcyan', 'ansiwhite']
Expand Down Expand Up @@ -373,15 +375,13 @@ def main():
Use --strip keepdiacritic to leave diacriticals in.'
parser.add_argument('-s', '--strip', nargs='?', const='diacritic', help=strip_help)

global IMPACT_COLOR
IMPACT_COLOR = GLOBAL_SETTINGS['impact_color']

args = parser.parse_known_args()
confArgs = args[0]
envArgs = create_dict(args[1])

# See if conf file contains an impact color
if 'impact_color' in envArgs and 'ansi{}'.format(envArgs['impact_color']) in COLOR_OPTIONS:
global IMPACT_COLOR
IMPACT_COLOR = 'ansi{}'.format(envArgs['impact_color'])

# See if a default directory was specified and rewrite inputs and outputs as necessary
Expand Down

0 comments on commit d2f9873

Please sign in to comment.