Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
WIP commit: Reformatting DataScraper so that org data is in a single …
Browse files Browse the repository at this point in the history
…dict
  • Loading branch information
Ross Jacobs committed Aug 24, 2018
1 parent dd05c8b commit 2907aa1
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 228 deletions.
8 changes: 4 additions & 4 deletions src/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class MainWindow(QMainWindow):
"""Main Window is the controlling class for the GUI.
Attributes:
menu_widget (MenuBars): Used to tie the menu bars to the MainWindow
browser (DataScraper): Browser used to store user credentials
tray_icon = SystrayIcon(self)
menu_widget (MenuBars): Used to tie the menu bars to the MainWindow
tray_icon (SystrayIcon): Used to tie the tray icon to the MainWindow
main_window_ui (MainWindowUi): Class to tie UI to Main Window (while
being in a different file for clarity).
"""
Expand Down Expand Up @@ -81,7 +81,7 @@ def show_main_menu(self):
current_org = self.browser.get_current_org()
self.org_dropdown.addItems(org_list)
# Get the data we need and remove the cruft we don't
self.browser.scrape_networks_by_org()
self.browser.scrape_administered_orgs()
self.status.showMessage("Status: Fetching networks in " +
current_org + "...")
# Remove all elements from the network UI dropdown
Expand Down Expand Up @@ -139,7 +139,7 @@ def change_organization(self):
print("we are getting new info for " + selected_org +
" at index" + str(selected_org_index))
self.browser.set_current_org(selected_org_index)
self.browser.scrape_networks_by_org()
self.browser.scrape_administered_orgs()

self.refresh_network_dropdown()
self.status.showMessage("Status: Select network")
Expand Down
3 changes: 2 additions & 1 deletion src/gui/menu_bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from PyQt5.QtWidgets import QVBoxLayout
from PyQt5.QtWidgets import QTextEdit

import src.modules.os_utils as os_utils

class MenuBars:
"""Menubars of the GUI
Expand Down Expand Up @@ -81,7 +82,7 @@ def generate_menu_bars(self):
@staticmethod
def file_sysprefs():
"""Open system VPN settings"""
s
os_utils.open_vpnsettings()

@staticmethod
def file_quit_action():
Expand Down
3 changes: 1 addition & 2 deletions src/modules/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Controller:
interface (MainWindow | MainCli): Calls interface-dependent functions
(this is a primitive form of overloading).
app (QApplication): Required for the Qt program flow, not used for CLI
"""
# Telling PyCharm linter not to (incorrectly) inspect PyQt function args
# noinspection PyArgumentList
Expand Down Expand Up @@ -88,7 +87,7 @@ def program_structure(self):
"""

# Get organization info so we have something to show user
self.interface.browser.scrape_initial_org_info()
self.interface.browser.count_admin_orgs()
self.interface.show_main_menu()

"""
Expand Down

0 comments on commit 2907aa1

Please sign in to comment.