def autostart(reason, **kwargs):
	if reason == 0:  # start
		if config.pushservice.enable.value:
			try:
				global gPushService
				gPushService = PushService()
				gPushService.start()
			except Exception, e:
				log.exception( ("PushService autostart exception ") + str(e) )
示例#2
0
def autostart(reason, **kwargs):
    if reason == 0:  # start
        if config.pushservice.enable.value:
            try:
                global gPushService
                gPushService = PushService()
                gPushService.start()
            except Exception, e:
                log.exception(("PushService autostart exception ") + str(e))
示例#3
0
def autostart(reason, **kwargs):
	if reason == 0:  # start
		if config.pushservice.enable.value:
			try:
				global gPushService
				gPushService = PushService()
				gPushService.start()
			except Exception, e:
				print _("PushService autostart exception ") + str(e)
				exc_type, exc_value, exc_traceback = sys.exc_info()
				traceback.print_exception(exc_type, exc_value, exc_traceback, file=sys.stdout)
示例#4
0
def autostart(reason, **kwargs):
	if reason == 0:  # start
		if config.pushservice.enable.value:
			try:
				global gPushService
				gPushService = PushService()
				gPushService.start()
			except Exception, e:
				print _("PushService autostart exception ") + str(e)
				exc_type, exc_value, exc_traceback = sys.exc_info()
				traceback.print_exception(exc_type, exc_value, exc_traceback, file=sys.stdout)
	def keySave(self):
		self.hideHelpWindow()

		# Save E2 PushService config
		self.saveAll()

		# Build xml config and write it
		self.save()

		# If we need assign / "write" access import the plugin
		# global won't work across module scope
		import plugin
		if config.pushservice.enable.value:
			if plugin.gPushService:
				plugin.gPushService.copyfrom(self)
				plugin.gPushService.start()
			else:
				#global gPushService
				plugin.gPushService = PushService()
				plugin.gPushService.start()
		else:
			#global gPushService
			plugin.gPushService = None

		self.close()