コード例 #1
0
ファイル: streamplayer.py プロジェクト: OpenVu/XStreamity
	def downloadPicon(self):
		size = []
		stream_url = ''
		desc_image = ''

		if glob.currentchannelist:
			stream_url = glob.currentchannelist[glob.currentchannelistindex][3]
			desc_image = glob.currentchannelist[glob.currentchannelistindex][5]

		if stream_url != 'None':
			imagetype = "picon"
			size = [147,88]
			if screenwidth.width() > 1280:
				size = [220,130]

		if desc_image and desc_image != "n/A" and desc_image != "":
			
			temp = dir_tmp + 'temp.png'
			try:
				downloadPage(desc_image, temp, timeout=3).addCallback(self.checkdownloaded, size, imagetype, temp)
			except:
				if desc_image.startswith('https'):
					desc_image = desc_image.replace('https','http')
					try:
						downloadPage(desc_image, temp, timeout=3).addCallback(self.checkdownloaded, size, imagetype, temp)
					except:
						pass
						self.loadDefaultImage()
				else:
					self.loadDefaultImage()	
		else:
			self.loadDefaultImage()
コード例 #2
0
ファイル: streamplayer.py プロジェクト: AgnitumuS/XStreamity
    def downloadPicon(self):

        size = []
        stream_url = ''
        desc_image = ''

        if glob.currentchannelist:
            stream_url = glob.currentchannelist[glob.currentchannelistindex][6]
            desc_image = glob.currentchannelist[glob.currentchannelistindex][3]

        if stream_url != 'None':
            imagetype = "picon"
            size = [147, 88]
            if screenwidth.width() > 1280:
                size = [220, 130]

        if size != []:
            if desc_image != '':
                temp = '/tmp/xstreamity/temp.png'
                try:
                    downloadPage(desc_image,
                                 temp).addCallback(self.checkdownloaded, size,
                                                   imagetype, temp)
                except:
                    pass
            else:
                self.loadDefaultImage()
コード例 #3
0
    def downloadPicon(self):
        self.timerpicon.stop()
        if self.downloadingpicon:
            return
        self.downloadingpicon = True

        if os.path.exists("/tmp/xstreamity/preview.png"):
            os.remove("/tmp/xstreamity/preview.png")

        if os.path.exists("/tmp/xstreamity/original.png"):
            os.remove("/tmp/xstreamity/original.png")

        url = ''
        size = []
        if self["channel_list"].getCurrent():
            desc_image = self["channel_list"].getCurrent()[3]

            if cfg.showpicons.value == True:

                imagetype = "picon"
                url = desc_image
                size = [147, 88]
                if screenwidth.width() > 1280:
                    size = [220, 130]

            if url != '' and url != "n/A" and url != None:
                original = '/tmp/xstreamity/original.png'

                d = downloadPage(url, original)
                d.addCallback(self.checkdownloaded, size, imagetype)
                d.addErrback(self.ebPrintError)
                return d

            else:
                self.loadDefaultImage()
コード例 #4
0
    def __init__(self, session):

        skin = """
			<screen name="JediCatchup" position="center,center" size="600,600" >

				<widget source="newlist" render="Listbox" position="0,0" size="600,504" enableWrapAround="1" scrollbarMode="showOnDemand" transparent="1">
					<convert type="TemplatedMultiContent">
						{"template": [
							MultiContentEntryText(pos = (15, 0), size = (570, 45), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name
						],
					"fonts": [gFont("jediregular", 36)],
					"itemHeight": 54
					}
					</convert>
				</widget>
		
			</screen>"""

        if screenwidth.width() <= 1280:
            skin = """
				<screen name="JediCatchup" position="center,center" size="400,400" >
					<widget source="newlist" render="Listbox" position="0,0" size="400,336" enableWrapAround="1" scrollbarMode="showOnDemand" transparent="1">
						<convert type="TemplatedMultiContent">
							{"template": [
								MultiContentEntryText(pos = (10, 0), size = (380, 30), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name
							],
						"fonts": [gFont("jediregular", 24)],
						"itemHeight": 36
						}
						</convert>
					</widget>
				</screen>"""

        Screen.__init__(self, session)
        self.session = session

        self.skin = skin

        self.list = []
        self.catchup_all = []

        self.currentSelection = 0

        self["newlist"] = List(self.list)

        self['setupActions'] = ActionMap(['SetupActions'], {
            'ok': self.openSelected,
            'cancel': self.quit,
            'menu': self.quit,
        }, -2)

        self.setup_title = ""
        self.createSetup()
        self['newlist'].onSelectionChanged.append(self.getCurrentEntry)
        self.onLayoutFinish.append(self.__layoutFinished)
コード例 #5
0
    def downloadPicon(self):
        if self["channel_list"].getCurrent():
            next_url = self["channel_list"].getCurrent()[3]
            if next_url != 'None' and "/live/" in next_url:

                try:
                    os.remove(str(dir_tmp) + 'original.png')
                except:
                    pass

                url = ''
                size = []
                if self["channel_list"].getCurrent():

                    desc_image = ''
                    try:
                        desc_image = self["channel_list"].getCurrent()[5]
                    except Exception as e:
                        print("* picon error ** %s" % e)
                        pass

                    imagetype = "picon"
                    url = desc_image
                    size = [147, 88]
                    if screenwidth.width() > 1280:
                        size = [220, 130]

                    if url != '' and url != "n/A" and url != None:
                        original = dir_tmp + 'original.png'

                        try:
                            downloadPage(url, original, timeout=5).addCallback(
                                self.checkdownloaded, size,
                                imagetype).addErrback(self.ebPrintError)
                        except:

                            if url.startswith('https'):
                                url = url.replace('https', 'http')
                                try:
                                    downloadPage(url, original,
                                                 timeout=5).addCallback(
                                                     self.checkdownloaded,
                                                     size,
                                                     imagetype).addErrback(
                                                         self.ebPrintError)
                                except:
                                    pass
                                    self.loadDefaultImage()
                            else:
                                self.loadDefaultImage()
                    else:
                        self.loadDefaultImage()
コード例 #6
0
ファイル: streamplayer.py プロジェクト: OpenVu/XStreamity
	def displayVodImage(self):
		preview = dir_tmp + 'temp.jpg'
		width = 147
		height = 220
		
		if screenwidth.width() > 1280:
			width = 220
			height = 330
			
		self.PicLoad.setPara([width,height,self.Scale[0],self.Scale[1],0,1,"FF000000"])
		
		if self.PicLoad.startDecode(preview):
				# if this has failed, then another decode is probably already in progress
				# throw away the old picload and try again immediately
				self.PicLoad = ePicLoad()
				try:
					self.PicLoad.PictureData.get().append(self.DecodePicture)
				except:
					self.PicLoad_conn = self.PicLoad.PictureData.connect(self.DecodePicture)
				self.PicLoad.setPara([width,height,self.Scale[0],self.Scale[1],0,1,"FF000000"])
				self.PicLoad.startDecode(preview)
コード例 #7
0
    def __init__(self, session, runtype):
        Screen.__init__(self, session)
        self.session = session
        self.runtype = runtype

        if os.path.isdir(
                '/usr/lib/enigma2/python/Plugins/Extensions/EPGImport'):
            jglob.has_epg_importer = True
            if not os.path.exists('/etc/epgimport'):
                os.makedirs('/etc/epgimport')
        else:
            jglob.has_epg_importer = False

        if self.runtype == 'manual':
            skin = skin_path + 'jmx_progress.xml'
            with open(skin, 'r') as f:
                self.skin = f.read()

        else:
            skin = """
				<screen name="Updater" position="0,0" size="1920,1080" backgroundColor="#ff000000" flags="wfNoBorder">
					<ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/JediMakerXtream/icons/JediMakerXtreamFHD.png" position="30,25" size="150,60" alphatest="blend" zPosition="4"  />
					<eLabel position="180,30" size="360,50" backgroundColor="#10232323" transparent="0" zPosition="-1"/>
					<widget name="status" position="210,30" size="300,50" font="Regular;24" foregroundColor="#ffffff" backgroundColor="#000000" valign="center" noWrap="1" transparent="1" zPosition="5" />
				</screen>"""

            if screenwidth.width() <= 1280:
                skin = """
					<screen name="Updater" position="0,0" size="1280,720" backgroundColor="#ff000000" flags="wfNoBorder">
						<ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/JediMakerXtream/icons/JediMakerXtream.png" position="20,16" size="100,40" alphatest="blend" zPosition="4" />
						<eLabel position="120,20" size="240,32" backgroundColor="#10232323" transparent="0" zPosition="-1"/>
						<widget name="status" position="140,20" size="200,32" font="Regular;16" foregroundColor="#ffffff" backgroundColor="#000000" valign="center" noWrap="1" transparent="1" zPosition="5" />
					</screen>"""

            self.skin = skin

        Screen.setTitle(self, _('Updating Bouquets'))

        self['action'] = Label('')
        self['status'] = Label('')
        self['progress'] = ProgressBar()
        self['actions'] = ActionMap(['SetupActions'],
                                    {'cancel': self.keyCancel}, -2)

        self.pause = 20
        self.job_bouquet_name = ''

        self.x = 0

        self.playlists_bouquets = []
        self.playlists_all = jfunc.getPlaylistJson()

        for playlist in self.playlists_all:
            if 'bouquet_info' in playlist:
                self.playlists_bouquets.append(playlist)

        self.progresscount = len(self.playlists_bouquets)

        self.progresscurrent = 0
        self['progress'].setRange((0, self.progresscount))
        self['progress'].setValue(self.progresscurrent)

        self.rytec_ref = {}
        self.epg_alias_names = []

        if self.playlists_bouquets != []:
            self.start()
        else:
            self.close()