class NeomanApplication(QtGui.QApplication): def __init__(self, argv): super(NeomanApplication, self).__init__(argv) self._set_basedir() m._translate(self) QtCore.QCoreApplication.setOrganizationName(m.organization) QtCore.QCoreApplication.setOrganizationDomain(m.domain) QtCore.QCoreApplication.setApplicationName(m.app_name) args = self._parse_args() self.devmode = args.devmode self.available_neos = AvailableNeos() self.available_neos.start() self.aboutToQuit.connect(self.available_neos.stop) self.appletmanager = AppletManager() self.window = self._create_window() self.worker = Worker(self.window) self.aboutToQuit.connect(self.worker.work_thread.quit) self.appletmanager.update() def _parse_args(self): parser = argparse.ArgumentParser(description="YubiKey NEO Manager", add_help=True) parser.add_argument('-d', '--devmode', action='store_true', default=False, help='enables features which ' 'require the transport keys of the device to be ' 'known') return parser.parse_args() def _set_basedir(self): if getattr(sys, 'frozen', False): # we are running in a PyInstaller bundle self.basedir = sys._MEIPASS else: # we are running in a normal Python environment self.basedir = os.path.dirname(__file__) def _create_window(self): window = MainWindow() window.setWindowTitle(m.win_title_1 % version) window.setWindowIcon(QtGui.QIcon(':/neoman.png')) window.show() window.raise_() return window
def __init__(self, argv): super(NeomanApplication, self).__init__(m) QtCore.QCoreApplication.setOrganizationName(m.organization) QtCore.QCoreApplication.setOrganizationDomain(m.domain) QtCore.QCoreApplication.setApplicationName(m.app_name) args = self._parse_args() self.devmode = args.devmode self.available_neos = AvailableNeos() self.available_neos.start() self.aboutToQuit.connect(self.available_neos.stop) self.appletmanager = AppletManager() self._init_window() self.appletmanager.update()
class NeomanApplication(qt.Application): def __init__(self, argv): super(NeomanApplication, self).__init__(m) QtCore.QCoreApplication.setOrganizationName(m.organization) QtCore.QCoreApplication.setOrganizationDomain(m.domain) QtCore.QCoreApplication.setApplicationName(m.app_name) args = self._parse_args() self.devmode = args.devmode self.available_neos = AvailableNeos() self.available_neos.start() self.aboutToQuit.connect(self.available_neos.stop) self.appletmanager = AppletManager() self._init_window() self.appletmanager.update() def _parse_args(self): parser = argparse.ArgumentParser(description="YubiKey NEO Manager", add_help=True) parser.add_argument('-d', '--devmode', action='store_true', default=False, help='enables features which ' 'require the transport keys of the device to be ' 'known') return parser.parse_args() def _init_window(self): self.window.setWindowTitle(m.win_title_1 % version) self.window.setWindowIcon(QtGui.QIcon(':/neoman.png')) self.window.setCentralWidget(CentralWidget()) self.window.show() self.window.raise_()
def __init__(self, argv): super(NeomanApplication, self).__init__(argv) self._set_basedir() m._translate(self) QtCore.QCoreApplication.setOrganizationName(m.organization) QtCore.QCoreApplication.setOrganizationDomain(m.domain) QtCore.QCoreApplication.setApplicationName(m.app_name) args = self._parse_args() self.devmode = args.devmode self.available_neos = AvailableNeos() self.available_neos.start() self.aboutToQuit.connect(self.available_neos.stop) self.appletmanager = AppletManager() self.window = self._create_window() self.worker = Worker(self.window) self.aboutToQuit.connect(self.worker.work_thread.quit) self.appletmanager.update()