コード例 #1
0
    def buildM3uBouquets(self):
        self.categories = []

        for x in jglob.getm3ustreams:
            if x[0] != '':
                if [x[0], x[4]] not in self.categories:
                    self.categories.append([x[0], x[4]])

        if self.firstrun == True:
            self.epg_name_list = []

            self.unique_ref = cfg.unique.value

        self.firstrun = False

        if self.category_num < len(self.categories):
            self.m3u_process_category()

        else:
            if jglob.live and jglob.has_epg_importer and jglob.epg_provider and jglob.xmltv_address != '':
                bx.buildXMLTVChannelFile(self.epg_name_list)
                bx.buildXMLTVSourceFile()
                self.updateBouquetJsonFile()
                jfunc.refreshBouquets()

            self.nextjob((''), self.loopPlaylists)
コード例 #2
0
    def deleteBouquets(self, answer=None):
        if answer is None:
            self.session.openWithCallback(
                self.deleteBouquets, MessageBox,
                _('Permanently delete all Jedi created bouquets?'))
        elif answer:
            with open('/etc/enigma2/bouquets.tv', 'r+') as f:
                lines = f.readlines()
                f.seek(0)
                for line in lines:
                    if 'jmx' not in line:
                        f.write(line)
                f.truncate()

            jfunc.purge('/etc/enigma2', 'jmx')

            if jglob.has_epg_importer:
                jfunc.purge('/etc/epgimport', 'jmx')

            self.playlists_all = jfunc.getPlaylistJson()

            jglob.bouquets_exist = False
            jfunc.resetUnique()
            jglob.firstrun = 0
            jglob.current_selection = 0
            jglob.current_playlist = []

            # delete leftover empty dicts
            self.playlists_all = filter(None, self.playlists_all)

            os.remove(playlist_file)
            jfunc.refreshBouquets()

            self.createSetup()
        return
コード例 #3
0
 def loopPlaylists(self):
     if self.x < len(self.playlists_bouquets):
         self.catloop()
     else:
         jfunc.refreshBouquets()
         self.session.openWithCallback(self.done,
                                       MessageBox,
                                       str(len(self.playlists_bouquets)) +
                                       _(' Providers IPTV Updated'),
                                       MessageBox.TYPE_INFO,
                                       timeout=30)
コード例 #4
0
    def buildBouquets(self):
        if self.firstrun == True:
            self.epg_name_list = []

        self.firstrun = False

        if self.category_num < len(self.categories):
            self.process_category()
        else:
            if jglob.live and jglob.has_epg_importer and jglob.epg_provider and jglob.xmltv_address != '':
                bx.buildXMLTVChannelFile(self.epg_name_list)
                bx.buildXMLTVSourceFile()
                self.updateBouquetJsonFile()
                jfunc.refreshBouquets()

            self.nextjob((''), self.loopPlaylists)
コード例 #5
0
	def buildBouquets(self):
		self.nextjob(_('%s - Deleting existing bouquets...') % str(jglob.name),self.deleteBouquets)
		if self.firstrun == True:
			self.epg_name_list = []
	
		self.firstrun = False
		
		if self.category_num < len(self.categories):
			self.process_category()
		else:
			if jglob.live and jglob.has_epg_importer and jglob.epg_provider and jglob.xmltv_address != '':
				if jglob.fixepg:
					bx.downloadXMLTV()
				bx.buildXMLTVChannelFile(self.epg_name_list)
				bx.buildXMLTVSourceFile()
				self.updateBouquetJsonFile()
				jfunc.refreshBouquets()
				
			self.nextjob((''),self.loopPlaylists)
コード例 #6
0
    def deleteBouquets(self):
        selectedBouquetList = self.getSelectionsList()

        for x in selectedBouquetList:
            bouquet_name = x

            cleanName = re.sub(r'[\<\>\:\"\/\\\|\?\*]', '_', str(bouquet_name))
            cleanName = re.sub(r' ', '_', cleanName)
            cleanName = re.sub(r'_+', '_', cleanName)

            with open('/etc/enigma2/bouquets.tv', 'r+') as f:
                lines = f.readlines()
                f.seek(0)
                for line in lines:
                    if 'jmx_live_' + str(
                            cleanName) + "_" in line or 'jmx_vod_' + str(
                                cleanName
                            ) + "_" in line or 'jmx_series_' + str(
                                cleanName) + "_" in line or 'jmx_' + str(
                                    cleanName) in line:
                        continue
                    f.write(line)
                f.truncate()

            jfunc.purge('/etc/enigma2', 'jmx_live_' + str(cleanName) + "_")
            jfunc.purge('/etc/enigma2', 'jmx_vod_' + str(cleanName) + "_")
            jfunc.purge('/etc/enigma2', 'jmx_series_' + str(cleanName) + "_")
            jfunc.purge('/etc/enigma2', str(cleanName) + str('.tv'))

            if jglob.has_epg_importer:
                jfunc.purge('/etc/epgimport',
                            'jmx.' + str(cleanName) + '.channels.xml')
                jfunc.purge('/etc/epgimport',
                            'jmx.' + str(cleanName) + '.sources.xml')

            jfunc.refreshBouquets()
            self.deleteBouquetFile(bouquet_name)
            jglob.firstrun = 0
            jglob.current_selection = 0
            jglob.current_playlist = []
        self.close()