Esempio n. 1
0
    def openAutoTimerList(self):
        self.closeEventViewDialog()
        global autopoller
        global autotimer
        try:
            from Plugins.Extensions.AutoTimer.AutoPoller import AutoPoller
            from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
            from Plugins.Extensions.AutoTimer.plugin import autostart, main
            autopoller = AutoPoller()
            autotimer = AutoTimer()
            try:
                autotimer.readXml()
            except SyntaxError as se:
                self.session.open(
                    MessageBox,
                    _("Your config file is not well formed:\n%s") % str(se),
                    type=MessageBox.TYPE_ERROR,
                    timeout=10)
                return

            if autopoller is not None:
                autopoller.stop()
            from Plugins.Extensions.AutoTimer.AutoTimerOverview import AutoTimerOverview
            self.session.openWithCallback(self.editCallback, AutoTimerOverview,
                                          autotimer)
        except ImportError:
            self.session.open(MessageBox,
                              self.noAutotimer,
                              type=MessageBox.TYPE_INFO,
                              timeout=10)
Esempio n. 2
0
	def render(self, request):
		request.setResponseCode(http.OK)
		request.setHeader('Content-type', 'application/xhtml+xml')
		request.setHeader('charset', 'UTF-8')
		try:
			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
			autotimer = AutoTimer()
			try:
				autotimer.readXml()
			except Exception:
				return '<?xml version="1.0" encoding="UTF-8" ?><e2simplexmlresult><e2state>false</e2state><e2statetext>AutoTimer Config not found</e2statetext></e2simplexmlresult>'
			return ''.join(autotimer.getXml())
		except ImportError:
			return '<?xml version="1.0" encoding="UTF-8" ?><e2simplexmlresult><e2state>false</e2state><e2statetext>AutoTimer Plugin not found</e2statetext></e2simplexmlresult>'
Esempio n. 3
0
	def render(self, request):
		request.setResponseCode(http.OK)
		request.setHeader('Content-type', 'application/xhtml+xml')
		request.setHeader('charset', 'UTF-8')
		try:
			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
			autotimer = AutoTimer()
			try:
				autotimer.readXml()
			except Exception:
				return '<?xml version="1.0" encoding="UTF-8" ?><e2simplexmlresult><e2state>false</e2state><e2statetext>AutoTimer Config not found</e2statetext></e2simplexmlresult>'
			return ''.join(autotimer.getXml())
		except ImportError:
			return '<?xml version="1.0" encoding="UTF-8" ?><e2simplexmlresult><e2state>false</e2state><e2statetext>AutoTimer Plugin not found</e2statetext></e2simplexmlresult>'
Esempio n. 4
0
	def showAutoTimerList(self):
		global autopoller
		global autotimer
		try:
			from Plugins.Extensions.AutoTimer.plugin import main, autostart
			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
			from Plugins.Extensions.AutoTimer.AutoPoller import AutoPoller
			autopoller = AutoPoller()
			autotimer = AutoTimer()
			try:
				autotimer.readXml()
			except SyntaxError as se:
				self.session.open(MessageBox, _('Your config file is not well-formed:\n%s') % str(se), type=MessageBox.TYPE_ERROR, timeout=10)
				return

			if autopoller is not None:
				autopoller.stop()
			from Plugins.Extensions.AutoTimer.AutoTimerOverview import AutoTimerOverview
			self.session.openWithCallback(self.editCallback, AutoTimerOverview, autotimer)
		except ImportError:
			self.session.open(MessageBox, _('The AutoTimer plugin is not installed!\nPlease install it.'), type=MessageBox.TYPE_INFO, timeout=10)
Esempio n. 5
0
 def readXml(self, **kwargs):
     if "xml_string" in kwargs:
         AutoTimer.readXml(self, **kwargs)