Esempio n. 1
0
    def start(self):
        log.reinit()

        log.info("PushService start")
        self.stopTimer()

        self.begin()
        self.next()
	def start(self):
		log.reinit()
		
		log.info( "PushService start" )
		self.stopTimer()
		
		self.begin()
		self.next()
Esempio n. 3
0
def getInstance():
	global instance
	
	if instance is None:
		
		log.reinit()
		
		from plugin import VERSION
		
		log.debug(" SERIESPLUGIN NEW INSTANCE " + VERSION)
		log.debug( " ", strftime("%a, %d %b %Y %H:%M:%S", localtime()) )
		
		try:
			from Tools.HardwareInfo import HardwareInfo
			log.debug( " DeviceName " + HardwareInfo().get_device_name().strip() )
		except:
			sys.exc_clear()
		
		try:
			from Components.About import about
			log.debug( " EnigmaVersion " + about.getEnigmaVersionString().strip() )
			log.debug( " ImageVersion " + about.getVersionString().strip() )
		except:
			sys.exc_clear()
		
		try:
			#http://stackoverflow.com/questions/1904394/python-selecting-to-read-the-first-line-only
			log.debug( " dreamboxmodel " + open("/proc/stb/info/model").readline().strip() )
			log.debug( " imageversion " + open("/etc/image-version").readline().strip() )
			log.debug( " imageissue " + open("/etc/issue.net").readline().strip() )
		except:
			sys.exc_clear()
		
		try:
			for key, value in config.plugins.seriesplugin.dict().iteritems():
				log.debug( " config..%s = %s" % (key, str(value.value)) )
		except Exception as e:
			sys.exc_clear()
		
		global CompiledRegexpReplaceChars
		try:
			if config.plugins.seriesplugin.replace_chars.value:
				CompiledRegexpReplaceChars = re.compile('['+config.plugins.seriesplugin.replace_chars.value.replace("\\", "\\\\\\\\")+']')
		except:
			log.exception( " Config option 'Replace Chars' is no valid regular expression" )
			CompiledRegexpReplaceChars = re.compile("[:\!/\\,\(\)'\?]")
		
		# Check autotimer
		try:
			from Plugins.Extensions.AutoTimer.plugin import autotimer
			deprecated = False
			try:
				from Plugins.Extensions.AutoTimer.plugin import AUTOTIMER_VERSION
				if int(AUTOTIMER_VERSION[0]) < 4:
					deprecated = True
			except ImportError:
				AUTOTIMER_VERSION = "deprecated"
				deprecated = True
			log.debug( " AutoTimer: " + AUTOTIMER_VERSION )
			if deprecated:
				log.warning( _("Your autotimer is deprecated")  + "\n" +_("Please update it") )
		except ImportError:
			log.debug( " AutoTimer: Not found" )
		
		# Check dependencies
		start = True
		from imp import find_module
		dependencies = ["difflib", "json", "re", "xml", "xmlrpclib"]
		for dependency in dependencies:
			try:
				find_module(dependency)
			except ImportError:
				start = False
				log.error( _("Error missing dependency")  + "\n" + "python-"+dependency + "\n\n" +_("Please install missing python paket manually") )
		if start:
			instance = SeriesPlugin()
		
	return instance
 def onInit(self):
     log.reinit()
     for plugin in self.getPlugins():
         plugin.onInit()