示例#1
0
 def init_network(self):
     while True:
         try:
             self.auth_token = get_auth_token()
             self.note_store = get_note_store(self.auth_token)
             break
         except socket.error:
             time.sleep(30)
示例#2
0
 def init_network(self):
     while True:
         try:
             self.auth_token = get_auth_token()
             self.note_store = get_note_store(self.auth_token)
             break
         except socket.error:
             time.sleep(30)
示例#3
0
文件: daemon.py 项目: cas--/everpad
 def __init__(self, verbose, *args, **kwargs):
     AppClass.__init__(self, *args, **kwargs)
     self.settings = QSettings('everpad', 'everpad-provider')
     self.verbose = verbose
     session_bus = dbus.SessionBus()
     self.bus = dbus.service.BusName("com.everpad.Provider", session_bus)
     self.service = ProviderService(session_bus, '/EverpadProvider')
     self.sync_thread = SyncThread()
     self.sync_thread.sync_state_changed.connect(
         Slot(int)(self.service.sync_state_changed), )
     self.sync_thread.data_changed.connect(
         Slot()(self.service.data_changed), )
     if get_auth_token():
         self.sync_thread.start()
     self.service.qobject.authenticate_signal.connect(
         self.on_authenticated, )
     self.service.qobject.remove_authenticate_signal.connect(
         self.on_remove_authenticated, )
     self.service.qobject.terminate.connect(self.terminate)
示例#4
0
 def __init__(self, verbose, *args, **kwargs):
     AppClass.__init__(self, *args, **kwargs)
     self.settings = QSettings('everpad', 'everpad-provider')
     self.verbose = verbose
     session_bus = dbus.SessionBus()
     self.bus = dbus.service.BusName("com.everpad.Provider", session_bus)
     self.service = ProviderService(session_bus, '/EverpadProvider')
     self.sync_thread = SyncThread()
     self.sync_thread.sync_state_changed.connect(
         Slot(int)(self.service.sync_state_changed),
     )
     self.sync_thread.data_changed.connect(
         Slot()(self.service.data_changed),
     )
     if get_auth_token():
         self.sync_thread.start()
     self.service.qobject.authenticate_signal.connect(
         self.on_authenticated,
     )
     self.service.qobject.remove_authenticate_signal.connect(
         self.on_remove_authenticated,
     )
     self.service.qobject.terminate.connect(self.terminate)
示例#5
0
文件: service.py 项目: cas--/everpad
 def is_authenticated(self):
     return bool(get_auth_token())