DRY principle
This commit is contained in:
parent
9687313cb4
commit
0930d20224
1 changed files with 4 additions and 2 deletions
|
@ -31,6 +31,8 @@ USERAGENT = (
|
||||||
|
|
||||||
LYRICS_ROW = '.main-page>.row>.col-xs-12'
|
LYRICS_ROW = '.main-page>.row>.col-xs-12'
|
||||||
|
|
||||||
|
EDITMSG = 'edit'
|
||||||
|
|
||||||
safename_re = re.compile(
|
safename_re = re.compile(
|
||||||
r'[^A-Za-z0-9А-ЯЁа-яё \'".,()\[\]&!#$@_~=*+-]'
|
r'[^A-Za-z0-9А-ЯЁа-яё \'".,()\[\]&!#$@_~=*+-]'
|
||||||
)
|
)
|
||||||
|
@ -107,7 +109,7 @@ def main() -> None:
|
||||||
print(err)
|
print(err)
|
||||||
|
|
||||||
if isinstance(err, ParseError) \
|
if isinstance(err, ParseError) \
|
||||||
and err.parsing_obj == 'edit':
|
and err.parsing_obj == EDITMSG:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -312,7 +314,7 @@ def parse_azlyrics(link: str) -> None:
|
||||||
print('Correct something?')
|
print('Correct something?')
|
||||||
|
|
||||||
if input('[y/N] ').lower == 'y':
|
if input('[y/N] ').lower == 'y':
|
||||||
manual_info_input(False)
|
raise ParseError('edit')
|
||||||
else:
|
else:
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
Reference in a new issue