Skip to content

Commit

Permalink
Fix too many local variables (pylint)
Browse files Browse the repository at this point in the history
Ref #265
  • Loading branch information
algorys committed Mar 8, 2018
1 parent bb8b29f commit 04ab349
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions alignak_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,7 @@ def start(self, username=None, password=None):
password = settings.get_config('Alignak', 'password')

if not app_backend.login(username, password):
login = LoginQDialog()
login.create_widget()

while not app_backend.connected:
connect_dialog = MessageQDialog()
connect_dialog.initialize(
'Connection',
'error',
'Warning!',
'Access denied! Check your username and password.'
)
if login.exec_() == login.Accepted:
connect_dialog.close()
connect_dialog.deleteLater()
break
else:
connect_dialog.exec_()
self.show_login_window()

# Launch start threads
thread_to_launch = thread_manager.get_threads_to_launch()
Expand Down Expand Up @@ -234,6 +218,31 @@ def start(self, username=None, password=None):

sys.exit(app.exec_())

@staticmethod
def show_login_window():
"""
Show LoginQDialog window for user to login to backend
"""

login = LoginQDialog()
login.create_widget()

while not app_backend.connected:
connect_dialog = MessageQDialog()
connect_dialog.initialize(
'Connection',
'error',
'Warning!',
'Access denied! Check your username and password.'
)
if login.exec_() == login.Accepted:
connect_dialog.close()
connect_dialog.deleteLater()
break
else:
connect_dialog.exec_()

@staticmethod
def quit_launched_threads(launched_threads):
"""
Expand Down

0 comments on commit 04ab349

Please sign in to comment.