Esempio n. 1
0
	def activateTimezone(self, tz, tzarea):
		try:
			from Plugins.Extensions.AutoTimer.plugin import autotimer, autopoller
			self.autopoller = autopoller
			self.autotimer = autotimer
			if config.plugins.autotimer.autopoll.value:
				print "[Timezones] trying to stop main AutoTimer poller"
				if autopoller is not None:
					autopoller.stop()
				self.ATupdate = True
		except ImportError, KeyError:
			pass
Esempio n. 2
0
 def activateTimezone(self, tz, tzarea):
     try:
         from Plugins.Extensions.AutoTimer.plugin import autotimer, autopoller
         self.autopoller = autopoller
         self.autotimer = autotimer
         if config.plugins.autotimer.autopoll.value:
             print "[Timezones] trying to stop main AutoTimer poller"
             if autopoller is not None:
                 autopoller.stop()
             self.ATupdate = True
     except ImportError, KeyError:
         pass
Esempio n. 3
0
    def activateTimezone(self, tz, tzarea):
        try:
            from Plugins.Extensions.AutoTimer.plugin import autotimer, autopoller
            self.autopoller = autopoller
            self.autotimer = autotimer
            if config.plugins.autotimer.autopoll.value:
                print("[Timezones] trying to stop main AutoTimer poller")
                if autopoller is not None:
                    autopoller.stop()
                self.ATupdate = True
        except ImportError as KeyError:
            pass

        if tzarea == Timezones.gen_label:
            fulltz = tz
        else:
            fulltz = "%s/%s" % (tzarea, tz)

        tzneed = "%s/%s" % (Timezones.tzbase, fulltz)
        if not path.isfile(tzneed):
            print("[Timezones] Attempt to set timezone", fulltz,
                  "ignored. UTC used")
            fulltz = "UTC"
            tzneed = "%s/%s" % (Timezones.tzbase, fulltz)

        print("[Timezones] setting timezone to", fulltz)
        environ['TZ'] = fulltz
        try:
            unlink("/etc/localtime")
        except OSError:
            pass
        try:
            symlink(tzneed, "/etc/localtime")
        except OSError:
            pass
        try:
            time.tzset()
        except:
            from enigma import e_tzset
            e_tzset()
        try:
            from Plugins.Extensions.AutoTimer.plugin import autotimer, autopoller
            self.autopoller = autopoller
            self.autotimer = autotimer
            if config.plugins.autotimer.autopoll.value:
                self.startATupdate()
        except ImportError as KeyError:
            pass