Skip to content

Commit

Permalink
Merge pull request #39 from proDreams/Ivan
Browse files Browse the repository at this point in the history
Ivan
  • Loading branch information
proDreams authored Apr 6, 2023
2 parents 6253d9b + a75874d commit 1c84777
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def parser_menu(self):
select = Inputs().menu_selector(1)
clear_console()
match select:
case "1":
case 1:
Data().update_file()
UpdaterViews().print_update_operation(1)
case "2":
case 2:
poesessid = Configuration().poesessid
if poesessid == "":
poesessid = Inputs().menu_selector(6)
Expand All @@ -75,7 +75,7 @@ def parser_menu(self):
Parse().parse(actual_league=Configuration().actual_league,
poesessid=poesessid)
ParserEvents().print_event(2)
case "3":
case 3:
self.menu_depth = 1
case _:
Inputs().wrong_input_message()
Expand Down
8 changes: 6 additions & 2 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,14 @@ class Inputs:
6: "Please enter your POESESSID for parser: "}}

def menu_selector(self, point):
return input(self.input_words[MainMenuView().lang][point])
while True:
try:
return int(input(self.input_words[MainMenuView().lang][point]))
except ValueError:
self.wrong_input_message()

def wrong_input_message(self):
return self.input_words[MainMenuView().lang][0]
print(self.input_words[MainMenuView().lang][0])

def any_key(self):
return input(self.input_words[MainMenuView().lang][3])
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ current_language: ru
poesessid: ''
selected_league: Standard
trade_mode: bulk
version: 1.0.0
version: 1.0.1

0 comments on commit 1c84777

Please sign in to comment.