From e015d90e9a35a42dc5d09be3077fbdbe4f686af5 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 8 Dec 2017 17:46:30 +0100 Subject: [bug] remove hardcoded path --- src/leap/bitmask/gui/app2.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/gui/app2.py b/src/leap/bitmask/gui/app2.py index 0e445026..f243c27a 100644 --- a/src/leap/bitmask/gui/app2.py +++ b/src/leap/bitmask/gui/app2.py @@ -16,9 +16,14 @@ # along with this program. If not, see . """ -This is an alternative entrypoint for Bitmask, based on pywebview. +This is an alternative entrypoint for Bitmask, based on pywebview, to be used +in osx and windows. + +For the moment, it requires also qt5 for the systray, but we should move to a +native solution on each platform. """ +import getpass import os import platform import signal @@ -74,7 +79,6 @@ class Systray(WithTrayIcon): sys.exit() else: event.ignore() - def launch_systray(): @@ -93,6 +97,7 @@ class BrowserWindow(object): This BrowserWindow assumes that the backend is already running, since it is going to look for the authtoken in the configuration folder. """ + def __init__(self, *args, **kw): url = kw.pop('url', None) first = False @@ -117,7 +122,6 @@ class BrowserWindow(object): self.closing = False webview.create_window('Bitmask', self.url) - def loadPage(self, web_page): self.load(url) @@ -139,8 +143,10 @@ class BrowserWindow(object): print('[bitmask] shutting down gui...') def cleanup(self): - # TODO get path!!!!!!! ----------- - os.remove('/Users/admin/Library/Preferences/leap/bitmasd.pid') + # TODO get path----------------------------------- + os.remove('/Users/' + getpass.getuser() + + '/Library/Preferences/leap/bitmasd.pid') + # ------------------------------------------------ def launch_gui(): @@ -189,7 +195,6 @@ def start_app(): launch_gui() - class NoAuthToken(Exception): pass -- cgit v1.2.3