|
|
|
@ -17,6 +17,7 @@
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
from os import path
|
|
|
|
|
from PySide import QtCore, QtGui
|
|
|
|
|
import time
|
|
|
|
|
from calculate.core.client.cert_info import user_can_run_update
|
|
|
|
@ -158,7 +159,8 @@ class CheckThread(QtGui.QMainWindow, UpdateInfo):
|
|
|
|
|
|
|
|
|
|
self.wm = pyinotify.WatchManager()
|
|
|
|
|
self.notifier = pyinotify.Notifier(self.wm, timeout=1)
|
|
|
|
|
self.wm.add_watch("/etc/calculate", pyinotify.IN_CLOSE_WRITE,
|
|
|
|
|
self.wm.add_watch(path.dirname(UpdateInfo.update_file),
|
|
|
|
|
pyinotify.IN_DELETE | pyinotify.IN_CREATE,
|
|
|
|
|
self.event_step)
|
|
|
|
|
|
|
|
|
|
self.already_timer = QtCore.QTimer(self)
|
|
|
|
@ -197,7 +199,7 @@ class CheckThread(QtGui.QMainWindow, UpdateInfo):
|
|
|
|
|
self.notifier.process_events()
|
|
|
|
|
|
|
|
|
|
def event_step(self, event):
|
|
|
|
|
if event.name == 'ini.env':
|
|
|
|
|
if event.name == path.basename(UpdateInfo.update_file):
|
|
|
|
|
self.step()
|
|
|
|
|
|
|
|
|
|
def is_console_gui_run(self):
|
|
|
|
|