From 0930d20224225738f9abeb99aa2e1c6f812cb62e Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 8 Feb 2023 14:40:20 +0400 Subject: [PATCH] DRY principle --- .id3tag_helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.id3tag_helper.py b/.id3tag_helper.py index c89354a..69cc7a7 100755 --- a/.id3tag_helper.py +++ b/.id3tag_helper.py @@ -31,6 +31,8 @@ USERAGENT = ( LYRICS_ROW = '.main-page>.row>.col-xs-12' +EDITMSG = 'edit' + safename_re = re.compile( r'[^A-Za-z0-9А-ЯЁа-яё \'".,()\[\]&!#$@_~=*+-]' ) @@ -107,7 +109,7 @@ def main() -> None: print(err) if isinstance(err, ParseError) \ - and err.parsing_obj == 'edit': + and err.parsing_obj == EDITMSG: pass else: @@ -312,7 +314,7 @@ def parse_azlyrics(link: str) -> None: print('Correct something?') if input('[y/N] ').lower == 'y': - manual_info_input(False) + raise ParseError('edit') else: print()