This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from calexandru2018/testing
New layout; Improved Search
- Loading branch information
Showing
21 changed files
with
1,247 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Glade temp file | ||
*.glade~ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import os | ||
from queue import Queue | ||
|
||
from requests_oauthlib import OAuth2Session | ||
from selenium.webdriver import Firefox | ||
from selenium.webdriver.firefox.options import Options | ||
opts = Options() | ||
opts.headless = True | ||
opts.add_argument('--no-sandbox') | ||
assert opts.headless # Operating in headless mode | ||
|
||
import gi | ||
gi.require_version('Gtk', '3.0') | ||
from gi.repository import Gtk, Gdk, GObject | ||
|
||
from .logger import logger | ||
from .constants import CONFIG_DIR, USERDATA, CURRDIR | ||
from .utils import check_user_credentials | ||
|
||
from .login_window import display_login | ||
from .dialog_window import DialogHandlers | ||
from .dashboard_window import display_dashboard | ||
|
||
def init(): | ||
queue = Queue() | ||
interface = Gtk.Builder() | ||
|
||
# Apply CSS | ||
style_provider = Gtk.CssProvider() | ||
style_provider.load_from_path(CURRDIR+"/resources/main.css") | ||
|
||
Gtk.StyleContext.add_provider_for_screen( | ||
Gdk.Screen.get_default(), | ||
style_provider, | ||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION | ||
) | ||
|
||
interface.add_from_file(CURRDIR+"/resources/dialog_window.glade") | ||
interface.connect_signals(DialogHandlers(interface, queue)) | ||
|
||
# dial = interface.get_object("MessageDialog") | ||
|
||
# dial.show() | ||
|
||
if not check_user_credentials(): | ||
display_login(interface, OAuth2Session, Firefox, opts, queue, Gtk) | ||
else: | ||
display_dashboard(interface, OAuth2Session, Firefox, opts, queue, Gtk) | ||
|
||
Gtk.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.