Revert "Lint: W605 invalid escape sequence '\+'"

This reverts commit f787c4cb14.
This commit is contained in:
Joshua Boniface 2020-11-07 17:38:03 -05:00
parent 893e7a616c
commit d37e5a0c0b
1 changed files with 3 additions and 3 deletions

View File

@ -733,7 +733,7 @@ def vm_modify(domain, cfgfile, editor, restart):
click.echo('') click.echo('')
diff = list(difflib.unified_diff(current_vm_cfgfile.split('\n'), new_vm_cfgfile.split('\n'), fromfile='current', tofile='modified', fromfiledate='', tofiledate='', n=3, lineterm='')) diff = list(difflib.unified_diff(current_vm_cfgfile.split('\n'), new_vm_cfgfile.split('\n'), fromfile='current', tofile='modified', fromfiledate='', tofiledate='', n=3, lineterm=''))
for line in diff: for line in diff:
if re.match('^[+]', line) is not None: if re.match('^\+', line) is not None:
click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET) click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET)
elif re.match('^\-', line) is not None: elif re.match('^\-', line) is not None:
click.echo(colorama.Fore.RED + line + colorama.Fore.RESET) click.echo(colorama.Fore.RED + line + colorama.Fore.RESET)
@ -3039,7 +3039,7 @@ def provisioner_userdata_modify(name, filename, editor):
click.echo('') click.echo('')
diff = list(difflib.unified_diff(current_userdata.split('\n'), new_userdata.split('\n'), fromfile='current', tofile='modified', fromfiledate='', tofiledate='', n=3, lineterm='')) diff = list(difflib.unified_diff(current_userdata.split('\n'), new_userdata.split('\n'), fromfile='current', tofile='modified', fromfiledate='', tofiledate='', n=3, lineterm=''))
for line in diff: for line in diff:
if re.match('^[+]', line) is not None: if re.match('^\+', line) is not None:
click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET) click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET)
elif re.match('^\-', line) is not None: elif re.match('^\-', line) is not None:
click.echo(colorama.Fore.RED + line + colorama.Fore.RESET) click.echo(colorama.Fore.RED + line + colorama.Fore.RESET)
@ -3224,7 +3224,7 @@ def provisioner_script_modify(name, filename, editor):
click.echo('') click.echo('')
diff = list(difflib.unified_diff(current_script.split('\n'), new_script.split('\n'), fromfile='current', tofile='modified', fromfiledate='', tofiledate='', n=3, lineterm='')) diff = list(difflib.unified_diff(current_script.split('\n'), new_script.split('\n'), fromfile='current', tofile='modified', fromfiledate='', tofiledate='', n=3, lineterm=''))
for line in diff: for line in diff:
if re.match('^[+]', line) is not None: if re.match('^\+', line) is not None:
click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET) click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET)
elif re.match('^\-', line) is not None: elif re.match('^\-', line) is not None:
click.echo(colorama.Fore.RED + line + colorama.Fore.RESET) click.echo(colorama.Fore.RED + line + colorama.Fore.RESET)