Changeset 5923 for ipk/source


Ignore:
Timestamp:
Feb 28, 2011, 6:45:52 PM (15 years ago)
Author:
bauernbub
Message:

[all] added AM 3.04 based on ipk structure

Location:
ipk/source/system_addonmanager_2_0/usr/lib/enigma2/python/Plugins/Extensions/AddonManager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ipk/source/system_addonmanager_2_0/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/downloader.py

    r4929 r5923  
     1from Components.ActionMap import HelpableActionMap
    12from Plugins.Plugin import PluginDescriptor
    23from Screens.PluginBrowser import *
     
    3031from Screens.Console import Console
    3132from os import system, remove, path, walk, makedirs, listdir
     33from Screens.VirtualKeyBoard import VirtualKeyBoard
    3234
    3335import re
     
    4749global activesource
    4850global version
    49 global b_version
    5051global checkok
     52global menu
     53global PreviewPath
    5154
    5255# for local compile in the box
     
    5558# py_compile.compile("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/downloader.py")
    5659
    57 version = "2.12"
     60version = "3.04"
    5861serverurl = ""
    5962activenam = ""
    6063activesource = ""
    61 b_version = 1212
    6264readyflag = 0
    6365checkok = True
     
    7577activenam = "Addons-Server"
    7678serverurl = activesource + "/E2/"
     79PreviewPath = "http://97.74.32.10/svn/preview"
    7780
    7881# Boytyp lesen
     
    9396config.AddonManager.marker_off = ConfigInteger(1, limits=(0, 1))
    9497config.AddonManager.mark_color = ConfigInteger(1, limits=(0, 2))
    95 config.AddonManager.ungenau = ConfigInteger(0, limits=(0, 1))
    96 config.AddonManager.Schriftart = ConfigInteger(14, limits=(10, 22))
     98config.AddonManager.ungenau = ConfigInteger(1, limits=(0, 1))
     99config.AddonManager.Schriftart = ConfigInteger(16, limits=(10, 22))
    97100
    98101config.AddonManager2 = ConfigSubsection()
     
    279282                        <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/pressed.png" position="{yellow2.pos}" zPosition="0" size="140,40" transparent="1" alphatest="on" />
    280283                        <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/pressed.png" position="{blue2.pos}" zPosition="0" size="140,40" transparent="1" alphatest="on" />
    281                         <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/aaf.png" position="{logo.pos}" zPosition="0" size="160,140" transparent="1" alphatest="on" />
    282284                        <widget source="key_red" render="Label" position="{red.pos}" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#9f1313" transparent="1" />
    283285                        <widget source="key_green" render="Label" position="{green.pos}" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
     
    288290                        <widget source="key_3" render="Label" position="{yellow2.pos}" zPosition="1" size="140,40" font="Regular;16" valign="center" halign="center" backgroundColor="#a08500" transparent="1" />
    289291                        <widget source="key_4" render="Label" position="{blue2.pos}" zPosition="1" size="140,40" font="Regular;16" valign="center" halign="center" backgroundColor="#18188b" transparent="1" />
    290                         <widget source="label_top" render="Label" position="10,94" size="240,20" foregroundColor="#3366ff" font="Regular;16" />
     292                        <widget source="label_top" render="Label" position="10,94" size="340,20" foregroundColor="#3366ff" font="Regular;16" />
    291293                        <widget name="feedlist" position="10,116" size="{feed.size}" scrollbarMode="showOnDemand" />
    292294                        <widget name="destlist" position="0,116" size="{dest.size}" scrollbarMode="showOnDemand" />
     
    301303                </screen>"""
    302304
     305#                       <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/aaf.png" position="{logo.pos}" zPosition="0" size="160,140" transparent="1" alphatest="on" />
     306
    303307        def __init__(self, session, destdir="/tmp/aaf/"):
    304                 self.BAtyp = "old"
    305                 if os.path.exists("/var/baroot/.multipart") is True:
    306                         self.BAtyp = "new"
    307 
    308308                #switch automatic to current skin
    309309                current_w = getDesktop(0).size().width()
     
    404404                self.focus = None
    405405                self.download = None
    406                 self.plug = "plugins"
     406                self.plug = "all"
    407407                self.farbe = 1
    408408                self.ListTyp = "pic"
    409                 self.betacode = False
    410409
    411410                self.feed_base = serverurl + "%s/" % self.plug
     
    418417                self.marker_off = config.AddonManager.marker_off.value
    419418
    420                 self.burl = activesource + "/version_b2.txt"
    421                 self.beta_load()
    422 
    423419                self.ThumbTimer = eTimer()
    424420                self.ThumbTimer.callback.append(self.list_download)
    425421
    426                 #self.box = "dm8000"
    427                 if box == "dm8000":
    428                         self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "EPGSelectActions", "MenuActions", "InfobarTeletextActions", "NumberActions", "MovieSelectionActions"],
     422                self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "EPGSelectActions", "MenuActions", "InfobarTeletextActions", "NumberActions", "MovieSelectionActions", "InfobarActions"],
    429423                        {
    430424                                "cancel": self.closeCB,
    431                                 "red": self.plugins_download,
    432                                 "green": self.ipks_download,
    433                                 "yellow":  self.skins_download,
    434                                 "blue": self.emus_download,
    435                                 "1": self.settings_download,
    436                                 "2": self.picons_download,
    437                                 "5": self.BackupRestoreVU,
    438                                 "8": self.beta_download,
     425                                "red": self.red_download,
     426                                "green": self.green_download,
     427                                "yellow": self.yellow_download,
     428                                "blue": self.blue_download,
     429
     430                                "1": self.eins_download,
     431                                "2": self.FavMenu,
     432                                "3": self.drei_download,
     433                                "4": self.vier_download,
     434                                "5": self.fuenf_download,
     435                                "6": self.BackupRestore,
    439436                                "9": self.sh_preview,
    440437                                "0": self.update,
     
    451448                                "startTeletext": self.switch_ListTyp,
    452449                                "showEventInfo": self.info,
    453                                 "down": self.down
    454                         }, -1)
    455                 else:
    456                         self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "EPGSelectActions", "MenuActions", "InfobarTeletextActions", "NumberActions", "MovieSelectionActions"],
    457                         {
    458                                 "cancel": self.closeCB,
    459                                 "red": self.plugins_download,
    460                                 "green": self.ipks_download,
    461                                 "yellow": self.emusconfig_download,
    462                                 "blue": self.emus_download,
    463 
    464                                 "1": self.settings_download,
    465                                 "2": self.bootbilder_download,
    466                                 "3": self.radiobilder_download,
    467                                 "5": self.BackupRestore,
    468                                 "7": self.skins_download,
    469                                 "8": self.beta_download,
    470                                 "9": self.sh_preview,
    471                                 "0": self.update,
    472 
    473                                 "prevBouquet": self.switchList,
    474                                 "nextBouquet": self.switchList,
    475                                 "ok": self.check_download,
    476                                 "left": self.left,
    477                                 "right": self.right,
    478                                 "up": self.up,
    479                                 "upRepeated": self.up,
    480                                 "downRepeated": self.down,
    481                                 "menu": self.settings_menu,
    482                                 "startTeletext": self.switch_ListTyp,
    483                                 "showEventInfo": self.info,
     450                                "showTv": self.FavMenu,
    484451                                "down": self.down
    485452                        }, -1)
     
    510477                if url.find("addons.aaf-board.net") > -1:
    511478                        aafpointer = aafpointer +1
    512                 if url.find("ke2.aaf-board.info") > -1:
    513                         aafpointer = aafpointer +1
    514 
    515                 if str(aafpointer) <= "2":
     479
     480                if str(aafpointer) <= "0":
     481                #if str(aafpointer) <= "2":
    516482                        print "Permission denied ", str(aafpointer)
    517483                        self["statusbar"].text = _("Sorry, Permission denied")
     
    520486                        self.focus = self.LIST_SOURCE
    521487                        self.read_Boxtyp()
     488
     489                        self.plug = "ipk"
     490
     491                        if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/startservice.cfg"):
     492                                file = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/startservice.cfg","r")
     493                                self.plugin_filter = str(file.readline().strip())
     494                                file.close()
     495                        else:
     496                                self.plugin_filter = "-"  # show all ipk
     497
     498                        if box <> "dm8000":
     499                                evfd.getInstance().vfd_write_string("load PlugList")
     500                        if os.path.exists("/var/etc/ipkg/official-feed.conf") is True:
     501                                file = open("/var/etc/ipkg/official-feed.conf", "r")
     502                                self.feed_base = file.readline().strip()
     503                                self.feed_base = self.feed_base.replace(u"src/gz cross ","")
     504                                self.feed_base = str(self.feed_base) + "/"
     505                        elif os.path.exists("/etc/ipkg/official-feed.conf") is True:
     506                                file = open("/etc/ipkg/official-feed.conf", "r")
     507                                self.feed_base = file.readline().strip()
     508                                self.feed_base = self.feed_base.replace(u"src/gz cross ","")
     509                                self.feed_base = str(self.feed_base) + "/"
    522510                        self.feed_download()
     511
     512        def FavMenu(self):
     513                Filter = "-"
     514                self.session.openWithCallback(self.MenuCallback, FilterPanel,Filter)
     515
     516        def MenuCallback(self):
     517                global menu
     518                print "FavMenu Callback", menu
     519                if menu == "stop":
     520                                menu = "-"
     521                self.plugin_filter = menu
     522                self.feed_finished(self.feedhtml)
     523
    523524
    524525        def BackupRestoreVU(self):
     
    526527
    527528        def BackupRestore(self):
    528                 if self.betacode == True:
    529529                        self.session.open(RestoreConfigScreenVU)
    530 
    531 #----- Beta Download Procedures -------------------------------------------------------
    532         def beta_load(self):
    533                 self.previewtimeout = config.AddonManager.preview_timeout.value
    534                 print "[Addon-Manager] " + str(self.previewtimeout)
    535                 self.downloading(True)
    536                 self.download = self.beta_load
    537                 client.getPage(self.burl).addCallback(self.beta_finished).addErrback(self.beta_failed)
    538 
    539         def beta_failed(self, failure_instance):
    540                 print "[Addon-Manager] [feed_failed] " + str(failure_instance)
    541                 self["infolabel"].text = _("Could not connect to AAF-Plugin Server:") + "\n" + failure_instance.getErrorMessage() + "\n\n" + _("Please check your network settings!")
    542                 self.downloading(False)
    543 
    544         def beta_finished(self, feedhtml):
    545                 print "[Addon-Manager] [feed_finished] " + str(feedhtml)
    546                 self.downloading(False)
    547                 b_version = feedhtml[0:len(feedhtml) -1]
    548                 if str(self.previewtimeout) == str(b_version):
    549                         self.previewtimeout = 600
    550                         self.betacode = True
    551                 else:
    552                         self.betacode = False
    553530
    554531        def downloading(self, state=True):
     
    560537                else:
    561538                        self.download = None
    562                         self["key_red"].text = _("Plugin")
    563                         self["key_green"].text = (_("IPK"))
    564 
    565                         if box == "dm8000":
    566                                 self["key_yellow"].text = (_("Skins"))
    567                                 self["key_1"].text = _("(1) Settings")
    568                                 self["key_2"].text = (_("(2) Picons"))
    569                                 self["key_3"].text = (_("(5) Back/Rest"))
    570                                 self["key_4"].text = (_("        "))
    571                         else:
    572                                 self["key_yellow"].text = (_("EmuConfig"))
    573                                 self["key_1"].text = _("(1) Settings")
    574                                 self["key_2"].text = (_("(2) Bootbilder"))
    575                                 self["key_3"].text = (_("(3) Radiobilder"))
    576 
     539                        self["key_red"].text = _("System")
     540                        self["key_green"].text = (_("Skins"))
     541                        self["key_yellow"].text = (_("Players"))
    577542                        self["key_blue"].text = (_("Emus"))
    578 
    579                         if os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/ufs922") is False:
    580                                 if box <> "dm8000":
    581                                         if self.betacode == True:
    582                                                 self["key_4"].text = (_("(5) Back/Rest"))
    583                                         else:
    584                                                 self["key_4"].text = (_("           "))
    585                                 self.read_Boxtyp()
     543                        self["key_1"].text = _("(1) Bootbilder")
     544                        self["key_2"].text = (_("(2) Select"))
     545                        self["key_3"].text = (_("(3) SWAP all"))
     546                        self["key_4"].text = (_("(4) IPK all"))
    586547
    587548        def switchList(self,to_where=None):
     
    591552                self["job_progressbar"].value = 0
    592553                self["job_progresslabel"].text = ""
    593 
    594                 #self.focus = self.LIST_SOURCE
    595554
    596555                if self.focus is  self.LIST_DEST:
     
    600559                        self["destlist"].show()
    601560
    602 
    603561                if self.focus is self.LIST_SOURCE:
    604562                        self["statusbar"].text = _("Please choose file from AAF Server to download")
    605 
    606                         if self.betacode == True and self.plug == "beta":
    607                                 self["label_top"].text = _("you are in the AAF BETA Zone!")
    608                         else:
    609                                 self["label_top"].text = _("...select file from server  ")+ self.box
    610 
     563                        self["label_top"].text = _("...select file (FAV = Filter)")
    611564                        self["feedlist"].show()
    612565                        self["destlist"].hide()
    613566                        self["label_bottom"].text = _("attached to: ")+ activenam
    614                         #self["key_yellow"].text = (_(" "))
     567
    615568
    616569#----- load Menutext or Picture -------------------------------------------------------
     
    750703                                os.system("mkdir /tmp/aaf")
    751704
    752                 if self.plug == "ipk":
    753                                 ipkurl = command('cat /var/etc/ipkg/official-feed.conf | cut -d "/" -f4')
    754                                 os.system("cd /usr/lib/enigma2/python/Plugins/Extensions/AddonManager/; ./ipkdownload")
    755                                 if os.path.exists("/tmp/aaf/index.txt") is True:
    756                                         feedhtml = open("/tmp/aaf/index.txt").read()
    757                                         self.feed_finished(feedhtml)
    758                 else:
    759                                 client.getPage(self.feed_base + "index.txt").addCallback(self.feed_finished).addErrback(self.feed_failed)
     705                ipkurl = command('cat /var/etc/ipkg/official-feed.conf | cut -d "/" -f4')
     706                os.system("cd /usr/lib/enigma2/python/Plugins/Extensions/AddonManager/; ./ipkdownload")
     707                if os.path.exists("/tmp/aaf/index.txt") is True:
     708                                self.feedhtml = open("/tmp/aaf/index.txt").read()
     709                                self.feed_finished(self.feedhtml)
    760710
    761711
     
    766716
    767717        def feed_finished(self, feedhtml):
    768                 print "[Addon-Manager] [feed_finished] " + str(feedhtml)
     718                #print "[Addon-Manager] [feed_finished] " + str(feedhtml)
    769719                self.downloading(False)
    770720
    771                 if self.plug == "ipk":
    772                                 fileresultmask = re.compile("(?P<name>.*?)\#\#(?P<url>.*?_sh4.ipk)", re.DOTALL)
    773                 elif box == "dm8000":
     721                fileresultmask = re.compile("(?P<name>.*?)\#\#(?P<url>.*?_sh4.ipk)", re.DOTALL)
     722                if box == "dm8000":
    774723                                fileresultmask = re.compile("(?P<name>.*?)\#\#(?P<url>.*?.ipk)", re.DOTALL)
    775                 else:
    776                                 fileresultmask = re.compile("(?P<name>.*?)\#\#(?P<url>.*?.gz)", re.DOTALL)
    777724
    778725                if os.path.exists("/var/etc/uninst") is False:
     
    786733                fd.close()
    787734                inhalt = inhalt.lower()
    788                 inhalt = inhalt.replace("\r\n","")
    789 
     735                inhalt = inhalt.replace("\n","")
     736                inhalt = inhalt.replace("\r","")
    790737                searchresults = fileresultmask.finditer(feedhtml)
    791                 #print searchresults
    792738
    793739                ausblenden = 0
    794                 self.ungenau = config.AddonManager.ungenau.value
     740                #self.ungenau = config.AddonManager.ungenau.value
    795741                self.farbe = config.AddonManager.mark_color.value
    796742
     
    805751                        for x in searchresults:
    806752                                url = x.group("url")
     753
     754                                # filtering the Filename string
     755                                if url.find(self.plugin_filter) > -1:
     756                                        #print "url=", url
     757                                        ausblenden = 0
     758                                else:
     759                                        ausblenden = 1
     760
    807761                                if url[0:7] != "http://":
    808762                                        url = self.feed_base + x.group("url")
     
    811765                                name_lo = name_lo.replace("\n","")
    812766                                name_lo = name_lo.replace("\r","")
    813                                 if self.ungenau == 1:
    814                                                 name_lo = name_lo.split("_")[0]
    815767                                font_s = 0
     768                                name_lo = name_lo.split("_")[0]
     769                                #print "name_lo = ", str(name_lo)
    816770
    817771                                if self.marker_on == True:
    818                                         if inhalt.find(name_lo) > -1:
     772                                        if inhalt.find(name_lo) > -1 and ausblenden == 0:
    819773                                                font_s = 1
    820774                                                if self.marker_off != True:
     
    825779                                if ausblenden == 0:
    826780                                                if font_s == 1:
    827                                                         entry = [[name, url],(eListboxPythonMultiContent.TYPE_TEXT, 0, 0,250, 30, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, name, farbwahl)]
     781                                                        entry = [[name, url],(eListboxPythonMultiContent.TYPE_TEXT, 0, 0,300, 30, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, name, farbwahl)]
    828782                                                else:
    829                                                         entry = [[name, url],(eListboxPythonMultiContent.TYPE_TEXT, 0, 0,250, 30, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, name)]
    830                                                 #print "[Addon-Manager] adding to feedlist: " + str(entry)
     783                                                        entry = [[name, url],(eListboxPythonMultiContent.TYPE_TEXT, 0, 0,300, 30, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, name)]
    831784                                                fileresultlist.append(entry)
    832                                                 #rot = ff0000 16711680
    833                                                 #gruen = 00ff00 65280
    834                                                 # blau = 0000ff 255
    835785                                else:
    836786                                                ausblenden = 0
     787
    837788                        self["feedlist"].l.setList(fileresultlist)
    838789                        self["feedlist"].moveSelection(0)
     
    843794                        self["infolabel"].text = _("Cannot parse feed directory")
    844795
     796                if box <> "dm8000":
     797                                evfd.getInstance().vfd_write_string("AddonManager")
     798
     799
    845800#----- List Download Procedures -------------------------------------------------------
    846801        def list_download(self):
     802                global PreviewPath
     803                global LISTurlText
    847804                if self.showpreview == True:
    848                         print "[Addon-Manager] [check_for_LIST]"
     805                        #print "[Addon-Manager] [check_for_LIST]"
    849806                        if self["feedlist"].isValid():
    850                                 print "[Addon-Manager] PLUGINname: " + self["feedlist"].getPLUGINname()
     807                                #print "[Addon-Manager] PLUGINname: " + self["feedlist"].getPLUGINname()
    851808                                self["job_progressbar"].value = 0
    852809                                self["job_progresslabel"].text = ""
     
    856813                                self["key_green"].text = _("Download")
    857814                                LISTurl = self["feedlist"].getLISTurl()
    858                                 LISTurl = LISTurl+".png"
    859 
    860                                 print "[Addon-Manager] downloading " + LISTurl
     815                                LISTurl1 = LISTurl.split("_")[0]
     816                                UrlLink = LISTurl.split("enigma2-plugin-")[0]
     817                                LISTName = LISTurl1.split("enigma2-plugin-")[1].split("-")[1]
     818                               
     819                                if LISTName.find(".") > -1:
     820                                        LISTName = LISTName.split(".")[0]
     821
     822                                LISTurl = PreviewPath + "/enigma2-pluginpreview-" + LISTName+".png"
     823                                LISTurlText = PreviewPath + "/enigma2-pluginpreview-" + LISTName+".txt"
     824
     825                                #print "[Addon-Manager] downloading " + LISTurl
    861826                                self.download = self.list_download
    862827                                self.downloading(True)
     
    875840
    876841        def list_finished(self,LISTdata=""):
    877                 print "[Addon-Manager] [list_finished] " + str(LISTdata)
     842                #print "[Addon-Manager] [list_finished] " + str(LISTdata)
    878843                self.downloading(False)
    879844                self.LIST = LISTdata
     
    899864                # no pic-file, now look for txt
    900865                self["statusbar"].text = _("Downloading file description...")
    901                 LISTurl = self["feedlist"].getLISTurl()
     866                #LISTurl = self["feedlist"].getLISTurl()
    902867                #client.getPage(LISTurl, headers={"Authorization":authHeader}).addCallback(self.list_finished).addErrback(self.list_failed)
    903                 client.getPage(LISTurl).addCallback(self.list_finished).addErrback(self.list_failed)
     868                global LISTurlText
     869                client.getPage(LISTurlText).addCallback(self.list_finished).addErrback(self.list_failed)
    904870
    905871                self.downloading(False)
     
    937903                        self["Preview"].show()
    938904                        self["Preview"].instance.setPixmapFromFile(self.previewPath)
    939                         #self["key_yellow"].text = (_("Skins"))
    940905                else:
    941906                        self.showpreview = 1
     
    945910
    946911        def read_Boxtyp(self):
    947                         # Boytyp lesen
    948912                        file = open("/proc/stb/info/model", "r")
    949913                        self.box = file.readline().strip()
    950914                        file.close()
    951                         # Topfield "TF7700HDPVR"
    952                         if self.box == "cuberevo" or self.box == "cuberevo-mini" or self.box == "cuberevo-mini2":
    953                                 self.box = "cuberevo"
    954                         #if self.box == "ufs910" or self.box == "UFS922":
    955                         #       self.box = "ufs"
    956 
    957 #----- you press au Menu-key, define the urls----------------------------------
    958         def beta_download(self):
    959                 self.beta_load()
    960                 if self.betacode == True:
    961                         print "[Addon-Manager] you are in AAF-Betasection"
    962                         self.previewtimeout = 600
    963                         if box <> "dm8000":
    964                                 evfd.getInstance().vfd_write_string("BETA-Section")
    965                         self.plug = "beta"
    966                         serverurlbeta = "http://kati910.aaf-board.info/dbase/E2/"
    967                         #serverurlbeta = "http://addons.aaf-board.net/E2/" old server
    968                         self.feed_base = serverurlbeta + "%s/" % self.plug
    969                         self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    970                         self.feed_download()
    971 
    972         def plugins_download(self):
    973                 self.plug = "plugins"
     915
     916        def red_download(self):
    974917                if box <> "dm8000":
    975918                        evfd.getInstance().vfd_write_string("Plugins")
    976                 self.feed_base = serverurl + "%s/" % self.plug
    977                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    978                 self.feed_download()
    979 
    980         def patches_download(self):
    981                 self.plug = "patches"
     919                self.plugin_filter = "system-"
     920                self.feed_finished(self.feedhtml)
     921
     922        def green_download(self):
    982923                if box <> "dm8000":
    983                         evfd.getInstance().vfd_write_string("Patches")
    984                 self.feed_base = serverurl + "%s/" % self.plug
    985                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    986                 self.feed_download()
    987 
    988         def emus_download(self):
    989                 self.plug = "emus"
     924                        evfd.getInstance().vfd_write_string("Settings")
     925                self.plugin_filter = "skins-"
     926                self.feed_finished(self.feedhtml)
     927
     928        def yellow_download(self):
     929                if box <> "dm8000":
     930                        evfd.getInstance().vfd_write_string("EmusConfig")
     931                self.plugin_filter = "players-"
     932                self.feed_finished(self.feedhtml)
     933
     934        def blue_download(self):
    990935                if box <> "dm8000":
    991936                        evfd.getInstance().vfd_write_string("Emus")
    992                 self.feed_base = serverurl + "%s/" % self.plug
    993                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    994                 self.feed_download()
    995 
    996         def emusconfig_download(self):
    997                 self.plug = "emusconfig"
    998                 if box <> "dm8000":
    999                         evfd.getInstance().vfd_write_string("EmusConfig")
    1000                 self.feed_base = serverurl + "%s/" % self.plug
    1001                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    1002                 self.feed_download()
    1003 
    1004         def settings_download(self):
    1005                 self.plug = "settings"
    1006                 if box <> "dm8000":
    1007                         evfd.getInstance().vfd_write_string("Settings")
    1008                 self.feed_base = serverurl + "%s/" % self.plug
    1009                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    1010                 self.feed_download()
    1011 
    1012         def skins_download(self):
    1013                 self["key_yellow"].text = (_("Skins"))
    1014                 self.read_Boxtyp()
    1015                 self.plug = "skins"
    1016                 if self.box == "cuberevo":
    1017                                 self.plug = "skins_cuberevo"
    1018                 if box <> "dm8000":
    1019                         evfd.getInstance().vfd_write_string("Skins")
    1020                 self.feed_base = serverurl + "%s/" % self.plug
    1021                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    1022                 self.feed_download()
    1023 
    1024         def ipks_download(self):
    1025                 self.read_Boxtyp()
    1026                 print "Boxtyp=" + self.box
    1027                 if box == "dm8000":
    1028                         self.ipks_vudownload()
    1029                 else:
    1030                         self.plug = "ipk"
    1031                         if box <> "dm8000":
    1032                                 evfd.getInstance().vfd_write_string("IPK")
    1033                         if os.path.exists("/var/etc/ipkg/official-feed.conf") is True:
    1034                                 file = open("/var/etc/ipkg/official-feed.conf", "r")
    1035                                 self.feed_base = file.readline().strip()
    1036                                 self.feed_base = self.feed_base.replace(u"src/gz cross ","")
    1037                                 self.feed_base = str(self.feed_base) + "/"
    1038                                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    1039                         elif os.path.exists("/etc/ipkg/official-feed.conf") is True:
    1040                                 file = open("/etc/ipkg/official-feed.conf", "r")
    1041                                 self.feed_base = file.readline().strip()
    1042                                 self.feed_base = self.feed_base.replace(u"src/gz cross ","")
    1043                                 self.feed_base = str(self.feed_base) + "/"
    1044                         else:
    1045                                 self.feed_base = serverurl + "%s/" % self.plug
    1046                                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    1047                         self.feed_download()
    1048 
    1049         def ipks_vudownload(self):
    1050                 self.plug = "ipkvu"
    1051                 if box <> "dm8000":
    1052                         evfd.getInstance().vfd_write_string("IPK-VU")
    1053                 self.feed_base = serverurl + "ipk/"
    1054                 self.plugin_filter = ""
    1055                 print "DownTyp=" + self.feed_base
    1056                 self.feed_download()
    1057 
    1058         def bootbilder_download(self):
    1059                 self.plug = "bootbilder"
     937                self.plugin_filter = "emus-"
     938                self.feed_finished(self.feedhtml)
     939
     940
     941# ----- Numbers --------
     942        def eins_download(self):
    1060943                if box <> "dm8000":
    1061944                        evfd.getInstance().vfd_write_string("Bootbilder")
    1062                 self.feed_base = serverurl + "%s/" % self.plug
    1063                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    1064                 self.feed_download()
    1065 
    1066         def radiobilder_download(self):
    1067                 self.plug = "radiobilder"
     945                self.plugin_filter = "bootlogos-"
     946                self.feed_finished(self.feedhtml)
     947
     948        def zwei_download(self):
    1068949                if box <> "dm8000":
    1069950                        evfd.getInstance().vfd_write_string("Radiobilder")
    1070                 self.feed_base = serverurl + "%s/" % self.plug
    1071                 self.plugin_filter = "" # "release" # only show IPKs containing this string, or all if ""
    1072                 self.feed_download()
    1073 
    1074         def spiele_download(self):
    1075                 self.plug = "spiele"
     951                self.plugin_filter = "radiologos-"
     952                self.feed_finished(self.feedhtml)
     953
     954        def drei_download(self):
    1076955                if box <> "dm8000":
    1077                         evfd.getInstance().vfd_write_string("Spiele")
    1078                 self.feed_base = serverurl + "%s/" % self.plug
    1079                 self.plugin_filter = ""
    1080                 self.feed_download()
    1081 
    1082         def picons_download(self):
    1083                 self.plug = "picons"
     956                        evfd.getInstance().vfd_write_string("SWAP all")
     957                self.plugin_filter = "swap"
     958                self.feed_finished(self.feedhtml)
     959
     960        def vier_download(self):
    1084961                if box <> "dm8000":
    1085                         evfd.getInstance().vfd_write_string("Picons")
    1086                 self.feed_base = serverurl + "%s/" % self.plug
    1087                 self.plugin_filter = ""
    1088                 self.feed_download()
     962                        evfd.getInstance().vfd_write_string("IPK all")
     963                self.plugin_filter = "-"
     964                self.feed_finished(self.feedhtml)
     965
     966        def fuenf_download(self):
     967                if box <> "dm8000":
     968                        evfd.getInstance().vfd_write_string("IPK all")
     969                self.plugin_filter = "-"
     970                self.feed_finished(self.feedhtml)
     971
     972
    1089973
    1090974#----- plugin download ------------------------------------------------------------
     
    11531037        def plugin_finished(self, string=""):
    11541038                ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log", "w")
    1155                 ffile.write("BA-Typ:" + self.BAtyp)
    1156                 ffile.write("\n")
    11571039                ffile.write("gedrueckte Kategorie:" + self.plug)
    11581040                ffile.write("\n")
     
    11651047                                ffile.close()
    11661048
    1167                                 # Boxtyp lesen
    1168                                 file = open("/proc/stb/info/model", "r")
    1169                                 self.box = file.readline().strip()
    1170                                 file.close()
    1171 
    1172                                 self["statusbar"].text = _("Decompressing Tar-File...")
    1173                                 os.system("cd /tmp/aaf; tar -xzf downfile.tar.gz; sync")
    1174                                 #os.system("rm /tmp/aaf/downfile.tar.gz")
    1175 
    1176                                 # is it a Flashimage, check for freespace?
    1177                                 #GOst begin
    1178                                 if os.path.exists("/etc/.imagesignature") is True:
    1179                                         file = open("/etc/.imagesignature", "r")
    1180                                         imagetype = file.readline().strip()
    1181                                         imagetype = imagetype.replace("\n","")
    1182                                         file.close()
    1183                                 else:
    1184                                         imagetype = "NONE"
    1185                                 print imagetype
    1186                                 os.system("touch /flashtest.txt")
    1187                                 #GOst end
    1188                                 #GOst  and imagetype is not "flash_gost_e2_ufs922"
    1189                                 if os.path.exists("/flashtest.txt") is False and imagetype != "flash_gost_e2_ufs922":
    1190                                         # is enough freespace on flash?
    1191                                         filesize = 0
    1192                                         freesize = 0
    1193                                         os.system("df /dev/mtdblock3 |grep var|cut -c41-50 >/tmp/free.txt")
    1194                                         if os.path.exists("/tmp/free.txt") is True:
    1195                                                 f = open("/tmp/free.txt", "r" )
    1196                                                 for line in f:
    1197                                                         freesize = line.lstrip()
    1198                                                 f.close
    1199                                                 freesize = freesize.replace("\n","")
    1200                                                 freesize = int(freesize)
    1201                                         print "[Addon-Manager] Flash=", freesize
    1202                                         #GOst ---> cut -c1-4 -nach-> cut -d\t -f1
    1203                                         os.system("du -sc /tmp/aaf |grep total|cut -dt -f1 >/tmp/free2.txt")
    1204                                         if os.path.exists("/tmp/free2.txt") is True:
    1205                                                 f = open("/tmp/free2.txt", "r" )
    1206                                                 for line in f:
    1207                                                         filesize = line.lstrip()
    1208                                                 f.close
    1209                                                 filesize = filesize.replace("\n","")
    1210                                                 filesize = int(filesize)
    1211                                         print "[Addon-Manager] File=", filesize
    1212 
    1213                                         # no Test, while Emu is linked to swap
    1214                                         if os.path.exists("/tmp/aaf/var/emu") is True:
    1215                                                 if self.box == "ufs910":
    1216                                                         print "[Addon-Manager] linked to swap"
    1217                                                         filesize = 1
    1218 
    1219                                         if freesize > filesize:
    1220                                                 print "[Addon-Manager] FreeSpace is ready"
    1221                                                 self["statusbar"].text = _("FreeSpace in Flash is ready!")
    1222                                         # NOT enough memory
    1223                                         else:
    1224                                                 print "[Addon-Manager] FreeSpace Error in Flash!"
    1225                                                 #def __init__(self, session, title = "Console", cmdlist = None, finishedCallback = None, closeOnSuccess = False):
    1226 
    1227                                                 self["statusbar"].text = _("FreeSpace Error!")
    1228                                                 print "[Addon-Manager] frei=", freesize,"File=",filesize
    1229                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1230                                                 ffile.write("FreeSpace Error in Flash!")
    1231                                                 ffile.write("\n")
    1232                                                 ffile.close()
    1233                                                 self.downloading(False)
    1234                                                 message = "%s %s %s %s %s" % (_("Speicherfehler: zu wenig Speicher im Flashimage frei!\n frei="),freesize, _("Kb  benoetigt="), filesize, _("Kb\nBitte deinstallieren sie andere Plugins!"))
    1235                                                 self.session.open(MessageBox,message, MessageBox.TYPE_INFO)
    1236                                                 return
    1237 
    1238                                         # check if Directory /var/emu is correct linked
    1239                                         if os.path.exists("/var/emu") is False:
    1240                                                 os.system("cd /var; ln -s /var/bin emu")
    1241 
    1242                                         # im Flash den emu nach /var/bin installieren
    1243                                         if os.path.exists("/tmp/aaf/var/emu") is True:
    1244                                                 if self.box == "ufs910":
    1245                                                         self.swaptest = False
    1246                                                         if os.path.exists("/var/swap/bin") is True:
    1247                                                                 print "[Addon-Manager] Emu wird im Swap des Flash installiert"
    1248                                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1249                                                                 ffile.write("Emu wird im Swap des Flash installiert")
    1250                                                                 ffile.write("\n")
    1251                                                                 ffile.close()
    1252 
    1253                                                                 os.system("mkdir -p /tmp/aaf/var/swap/bin")
    1254                                                                 os.system("cp /tmp/aaf/var/emu/* /tmp/aaf/var/swap/bin")
    1255                                                                 os.system("rm -r /tmp/aaf/var/emu")
    1256                                                                 self.swaptest = True
    1257                                                                 if os.path.exists("/tmp/aaf/lib") is True:
    1258                                                                         print "[Addon-Manager] Lib wird im Swap des Flash installiert"
    1259                                                                         ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1260                                                                         ffile.write("Lib wird im Swap des Flash installiert")
    1261                                                                         ffile.write("\n")
    1262                                                                         ffile.close()
    1263 
    1264                                                                         os.system("mkdir -p /tmp/aaf/var/swap/lib")
    1265                                                                         os.system("cp /tmp/aaf/lib/* /tmp/aaf/var/swap/lib")
    1266                                                                         os.system("rm -r /tmp/aaf/lib")
    1267                                                         else:
    1268                                                                 print "[Addon-Manager] Emu wird im Flash installiert"
    1269                                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1270                                                                 ffile.write("Emu wird im Flash installiert")
    1271                                                                 ffile.write("\n")
    1272                                                                 ffile.close()
    1273 
    1274                                                                 os.system("mv /tmp/aaf/var/emu /tmp/aaf/var/bin")
    1275 
    1276                                                         # und die inst.sh loeschen, Installation uebernimmt jetzt AM
    1277                                                         if os.path.exists("/tmp/aaf/inst.sh") is True:
    1278                                                                 os.system("rm /tmp/aaf/inst.sh; sync")
    1279 
    1280                                                         # und nun in der ufs910 im Flash den emu installieren
    1281                                                         os.system("rm /tmp/aaf/*.tar.gz ; sync")
    1282                                                         os.system("cp -RP /tmp/aaf/* / ; sync")
    1283                                                         if self.swaptest == True:
    1284                                                                 os.system("cd /usr/lib/enigma2/python/Plugins/Extensions/AddonManager; ./do_link.sh")
    1285                                                                 print "[Addon-Manager] Emu wude nach /var/swap/bin verlinkt"
    1286 
    1287                                 if os.path.exists("/tmp/aaf/inst.sh") is True:
    1288                                         print "[Addon-Manager] Preinst gefunden (inst.sh)"
    1289                                         #os.system("sed -e 's/cp -RP /. \/usr\/lib\/enigma2\/python\/Plugins\/Extensions\/AddonManager\/cp_r.func; cp_r \/tmp\/aaf\//g' -i /tmp/aaf/inst.sh")
    1290                                         #os.system("sed -e 's/cp -RP /cp_r /g' -i /tmp/aaf/inst.sh")
    1291                                         #os.system("cd /tmp/aaf; ./inst.sh" )
    1292                                         os.system("(. /usr/lib/enigma2/python/Plugins/Extensions/AddonManager/cp_r.func; cd /tmp/aaf; ./inst.sh)" )
    1293                                         #os.system("rm -r /tmp/aaf")
    1294                                         #os.system("cd / ; rm *tar.gz ; rm inst.sh")
    1295                                 else:
    1296                                         # Boxtyp lesen
    1297                                         file = open("/proc/stb/info/model", "r")
    1298                                         self.box = file.readline().strip()
    1299                                         file.close()
    1300                                         # Topfield "TF7700HDPVR"
    1301 
    1302                                         #self.box ="dm8000"
    1303                                         ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1304                                         ffile.write("erkannter Boxtyp:" + self.box)
    1305                                         ffile.write("\n")
    1306                                         ffile.close()
    1307 
    1308                                         # is it a Flashimage and you press "plugins"?
    1309                                         os.system("touch /flashtest.txt")
    1310 
    1311                                         if os.path.exists("/flashtest.txt") is False:
    1312                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1313                                                 ffile.write("es ist ein Flashimage")
    1314                                                 ffile.write("\n")
    1315                                                 ffile.close()
    1316 
    1317                                                 if self.box == "cuberevo" or self.box == "cuberevo-mini" or self.box == "cuberevo-mini2":
    1318                                                         self.box = "cuberevo"
    1319 
    1320                                                 if self.box == "ufs910" or self.box == "UFS922" or self.box == "cuberevo":
    1321                                                         if self.plug == "bootbilder" or self.plug == "plugins":
    1322                                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1323                                                                 ffile.write("Bootbild oder Plugin wird installiert")
    1324                                                                 ffile.write("\n")
    1325                                                                 ffile.close()
    1326 
    1327 
    1328                                                                 #/tmp/aaf/usr/lib/enigma2/python/Plugins/Extensions/
    1329                                                                 if os.path.exists("/media/usb/sda1/swapfile") is True:
    1330                                                                         os.system("mount /dev/sda1 /var/swap")
    1331                                                                 if os.path.exists("/media/usb/sdb1/swapfile") is True:
    1332                                                                         os.system("mount /dev/sdb1 /var/swap")
    1333                                                                 if os.path.exists("/media/usb/sdc1/swapfile") is True:
    1334                                                                         os.system("mount /dev/sdc1 /var/swap")
    1335                                                                 if os.path.exists("/media/usb/sdd1/swapfile") is True:
    1336                                                                         os.system("mount /dev/sdd1 /var/swap")
    1337 
    1338                                                                 if os.path.exists("/var/swap/swapfile") is False:
    1339                                                                         message = "%s" % (_("Es ist kein Swapfile eingerichtet!\nBitte Swapstick aktivieren!"))
    1340                                                                         self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
    1341                                                                         return
    1342 
    1343                                                                 swaptarget = "/var/swap/"
    1344                                                                 if os.path.exists(swaptarget + "Extensions") is False:
    1345                                                                         CpString = "mkdir -p " + swaptarget + "Extensions"
    1346                                                                         os.system(CpString)
    1347 
    1348                                                                 if self.plug == "plugins":
    1349                                                                         dir = listdir("/tmp/aaf/usr/lib/enigma2/python/Plugins/Extensions")
    1350                                                                         for x in dir:
    1351                                                                                 if path.isdir("/tmp/aaf/usr/lib/enigma2/python/Plugins/Extensions/" + x) == True:
    1352                                                                                         print x
    1353                                                                                         #name = x.split('/')[-1]
    1354 
    1355                                                                                         ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1356                                                                                         ffile.write("entpacken fuer Flashimage")
    1357                                                                                         ffile.write("\n")
    1358                                                                                         ffile.write("cp -RP /tmp/aaf/usr/lib/enigma2/python/Plugins/Extensions " + swaptarget)
    1359                                                                                         ffile.write("\n")
    1360                                                                                         ffile.close()
    1361 
    1362                                                                                         CpString = "rm -r /usr/lib/enigma2/python/Plugins/Extensions/" + x
    1363                                                                                         os.system(CpString)
    1364                                                                                         CpString = "ln -s " + swaptarget + "Extensions/" + x + " /usr/lib/enigma2/python/Plugins/Extensions/"
    1365                                                                                         os.system(CpString)
    1366 
    1367                                                                                         CpString = "cp -RP /tmp/aaf/usr/lib/enigma2/python/Plugins/Extensions " + swaptarget + "; sync"
    1368                                                                                         os.system(CpString)
    1369                                                                                         os.system("cp -RP /tmp/aaf/var/etc/uninst /var/etc/ ; sync")
    1370 
    1371                                                                 if self.plug == "bootbilder":
    1372                                                                         CpString = "cp -RP /tmp/aaf/boot /var/etc/ ; sync"
    1373                                                                         os.system(CpString)
    1374                                                                         os.system("cp -RP /tmp/aaf/var/etc/uninst /var/etc/ ; sync")
    1375 
    1376                                                         if self.plug == "emusconfig" or self.plug == "patches":
    1377                                                                         ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1378                                                                         ffile.write("es ist ein Flashimage (emusconfig)")
    1379                                                                         ffile.write("\n")
    1380                                                                         ffile.write("cp -RP /tmp/aaf/* / ; sync")
    1381                                                                         ffile.write("\n")
    1382                                                                         ffile.close()
    1383                                                                         print "[Addon-Manager] EmuConfig wird installiert!"
    1384                                                                         os.system("cp -RP /tmp/aaf/* / ; sync")
    1385 
    1386                                                 # es ist ein Flash aber keine ufs910
    1387                                                 else:
    1388                                                         #self.box = "dm8000"
    1389                                                         if box == "dm8000":
    1390                                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1391                                                                 ffile.write("es ist ein Flashimage aber keine ufs910")
    1392                                                                 ffile.write("\n")
    1393                                                                 ffile.write("IPKvu wird entpackt!")
    1394                                                                 ffile.write("\n")
    1395                                                                 ffile.close()
    1396                                                                 self["statusbar"].text = _("Decompressing IPK-File...")
    1397                                                                 os.system("cd /tmp/aaf ; ipkg install /tmp/aaf/downfile.sh4.ipk")
    1398                                                                 #os.system("rm -r /tmp/aaf")
    1399                                                         else:
    1400                                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1401                                                                 ffile.write("es ist ein Flashimage aber keine ufs910")
    1402                                                                 ffile.write("\n")
    1403                                                                 ffile.write("cp -RP /tmp/aaf/* / ; sync")
    1404                                                                 ffile.write("\n")
    1405                                                                 ffile.close()
    1406                                                                 #GOst begin
    1407                                                                 #os.system("cp -RP /tmp/aaf/* / ; sync")
    1408                                                                 os.system("(cd /tmp/aaf; tar -xzf *tar.gz -C / ; sync)")
    1409                                                                 #GOst end
    1410 
    1411                                         # es ist kein Flash
    1412                                         else:
    1413                                                         if box == "dm8000":
    1414                                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1415                                                                 ffile.write("IPKvu wird entpackt!")
    1416                                                                 ffile.write("\n")
    1417                                                                 ffile.close()
    1418                                                                 self["statusbar"].text = _("Decompressing IPK-File...")
    1419                                                                 os.system("cd /tmp/aaf ; ipkg install /tmp/aaf/downfile.sh4.ipk")
    1420                                                                 os.system("rm -r /tmp/aaf")
    1421                                                         else:
    1422                                                                 ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
    1423                                                                 ffile.write("es ist kein Flashimage")
    1424                                                                 ffile.write("\n")
    1425                                                                 ffile.write("cp -RP /tmp/aaf/* / ; sync")
    1426                                                                 ffile.write("\n")
    1427                                                                 ffile.close()
    1428                                                                 #GOst begin
    1429                                                                 #os.system("(. /usr/lib/enigma2/python/Plugins/Extensions/AddonManager/cp_r.func; cp_r /tmp/aaf / ; sync)")
    1430                                                                 os.system("(cd /tmp/aaf; tar -xzf *tar.gz -C / ; sync)")
    1431                                                                 #GOst end
    1432 
    1433                                         os.system("rm -r /tmp/aaf")
    1434                                         os.system("cd / ; rm *tar.gz")
    14351049                else:
    14361050                                ffile = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/inst.log","a")
     
    14411055                                self["statusbar"].text = _("Decompressing IPK-File...")
    14421056                                os.system("cd /tmp/aaf ; ipkg update")
    1443                                 os.system("cd /tmp/aaf ; ipkg install /tmp/aaf/downfile.sh4.ipk")
     1057
     1058                                if config.AddonManager.ungenau.value == 1:
     1059                                        self.CpString = "cd /tmp/aaf ; ipkg install /tmp/aaf/downfile.sh4.ipk"
     1060                                        self.session.open(Console, title = _("IPK Installer"), cmdlist = ["%s" % self.CpString], closeOnSuccess = False)
     1061                                else:
     1062                                        os.system("cd /tmp/aaf ; ipkg install /tmp/aaf/downfile.sh4.ipk")
     1063
    14441064                                os.system("rm -r /tmp/aaf")
    14451065
     
    14491069                #if self.plug == "skins":
    14501070                #       self.session.open(SkinSelector)
    1451 
    1452                 if self.plug == "settings":
    1453                         restartbox = self.session.openWithCallback(self.restartGUI,MessageBox,_("Die Installation hat einen Neustart angefordert!\nBei NEIN muss die Installation wiederholt werden!"), MessageBox.TYPE_YESNO)
    1454                         restartbox.setTitle(_("UFS-Box starten?"))
    1455 
    1456         def restart(self, answer):
    1457                 if answer is True:
    1458                         os.system("sync")
    1459                         os.system("reboot -f")
    14601071
    14611072        def restartGUI(self, answer):
     
    14901101        def closeCB(self):
    14911102                if self.download:
    1492                         #self.download.stop()
    1493                         #self.plugin_failed(None, "Cancelled by user request")
    14941103                        self.downloading(False)
    14951104                else:
     
    15351144        self.list.append(getConfigListEntry(_("Installierte Plugins in Liste farbig markieren"), config.AddonManager.marker_on))
    15361145        self.list.append(getConfigListEntry(_("Markierungsfarbe (0=rot, 1=gruen, 2=blau)"), config.AddonManager.mark_color))
    1537         self.list.append(getConfigListEntry(_("Installierte Plugins feststellen (0=genau, 1=ungenau)"), config.AddonManager.ungenau))
     1146        self.list.append(getConfigListEntry(_("Installations Konsole am Bildschirm (0=Aus, 1=Ein)"), config.AddonManager.ungenau))
    15381147
    15391148        ConfigListScreen.__init__(self, self.list)
     
    15541163                              x[1].save()
    15551164        config.save()
    1556         #config.AddonManager.save()
    15571165        self.showpreview = config.AddonManager.preview_on.value
    15581166        self.previewtimeout = config.AddonManager.preview_timeout.value
     
    15651173                        activesource = "http://kati910.aaf-board.info/dbase"
    15661174                        activenam = "Secondary-Server"
    1567         #if self.betacode == True:
    1568               #  self.previewtimeout = 600
    15691175        #restore()
    15701176        self.close()
     
    16841290                Screen.__init__(self, session)
    16851291
    1686                 #self.focus = None
    16871292                self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ColorActions", "MovieSelectionActions"],
    16881293                {
     
    17681373                self.filename = None
    17691374                self.filename = self.filelist.getFilename()
    1770                 #self.filename = self.currDir + "/" + self.currBox + "/" + self.filename
    17711375                self.fullname = self.currDir + "/" + self.filename
    17721376                print "[AddonManager] Select-Filename=", self.filename
    17731377                self["filelist"].refresh()
    1774 
    17751378                self.CpString = "/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/restore.sh " + self.filename + " boot"
    17761379                self.session.open(Console, title = _("Restore - Settings"), cmdlist = ["%s" % self.CpString], closeOnSuccess = False)
     
    17791382        def Exit(self):
    17801383                self.close()
    1781 #-----------------------------------------------------------------
     1384
     1385# -------------------------------------------------------------------
     1386class FilterPanelList(MenuList):
     1387        def __init__(self, list, font0 = 28, font1 = 16, itemHeight = 60, enableWrapAround = True):
     1388                MenuList.__init__(self, [], False, eListboxPythonMultiContent)
     1389                self.l.setFont(0, gFont("Regular", font0))
     1390                self.l.setFont(1, gFont("Regular", font1))
     1391                self.l.setItemHeight(itemHeight)
     1392
     1393# -------------------------------------------------------------------
     1394class FilterPanel(Screen, HelpableScreen):
     1395        def __init__(self, session, Filter):
     1396                self.session = session
     1397                self.skin = """
     1398                        <screen name="FilterPanel" position="center,center" size="430,440" title="Filterauswahl" backgroundColor="#252525">
     1399                                <widget name="Mlist" position="10,5" size="400,400" zPosition="3" backgroundColor="#252525"  backgroundColorSelected="#565656" scrollbarMode="showOnDemand" />
     1400
     1401                                <eLabel position="0,410" zPosition="2" size="430,1" backgroundColor="#c1cdc1" />
     1402                                <widget source="key_blue" render="Label" position="260,417" zPosition="2" size="200,30" font="Regular;20" valign="center" halign="left" transparent="1" />
     1403                                <ePixmap position="200,420" size="36,20" pixmap="skin_default/buttons/key_blue.png" transparent="1" alphatest="on" />
     1404                                <widget source="key_red" render="Label" position="80,417" zPosition="2" size="150,30" font="Regular;20" valign="center" halign="left" transparent="1" />
     1405                                <ePixmap position="20,420" size="36,20" pixmap="skin_default/buttons/key_red.png" transparent="1" alphatest="on" />
     1406
     1407                        </screen>"""
     1408
     1409                Screen.__init__(self, session)
     1410                self.Mlist = []
     1411
     1412                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('bootlogos'), _("bootlogos"), 'bootlogos')))
     1413                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('browsers'), _("browsers"), 'browsers')))
     1414                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('editors'), _("editors"), 'editors')))
     1415                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('emus'), _("emus"), 'emus')))
     1416                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('epg'), _("epg"), 'epg')))
     1417                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('fonts'), _("fonts"), 'fonts')))
     1418                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('games'), _("games"), 'games')))
     1419                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('infos'), _("infos"), 'infos')))
     1420                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('keymaps'), _("keymaps"), 'keymaps')))
     1421                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('mediacenter'), _("mediacenter"), 'mediacenter')))
     1422                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('picons'), _("picons"), 'picons')))
     1423                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('players'), _("players"), 'players')))
     1424                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('radiologos'), _("radiologos"), 'radiologos')))
     1425                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('settings'), _("settings"), 'settings')))
     1426                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('skins'), _("skins"), 'skins')))
     1427                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('spinner'), _("spinner"), 'spinner')))
     1428                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapbrowsers'), _("swapbrowsers"), 'swapbrowsers')))
     1429                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapeditors'), _("swapeditors"), 'swapeditors')))
     1430                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapemus'), _("swapemus"), 'swapemus')))
     1431                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapepg'), _("swapepg"), 'swapepg')))
     1432                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapgames'), _("swapgames"), 'swapgames')))
     1433                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapinfos'), _("swapinfos"), 'swapinfos')))
     1434                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapmediacenter'), _("swapmediacenter"), 'swapmediacenter')))
     1435                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapnetwork'), _("swapnetwork"), 'swapnetwork')))
     1436                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapplayers'), _("swapplayers"), 'swapplayers')))
     1437                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapscreensaver'), _("swapscreensaver"), 'swapscreensaver')))
     1438                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapskins'), _("swapskins"), 'swapskins')))
     1439                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('swapsystem'), _("swapsystem"), 'swapsystem')))
     1440                self.Mlist.append(self.FilterEntryItem((self.FilterEntryComponent('system'), _("system"), 'system')))
     1441
     1442                self.onChangedEntry = []
     1443                if (getDesktop(0).size().width() == 1280):
     1444                                self["Mlist"] = FilterPanelList([], font0=24, font1=15, itemHeight=40)
     1445                else:
     1446                                self["Mlist"] = FilterPanelList([], font0=24, font1=15, itemHeight=50)
     1447                self["Mlist"].l.setList(self.Mlist)
     1448                self["Mlist"].selectionEnabled(1)
     1449
     1450                self["key_blue"] = StaticText()
     1451                self["key_blue"].text = _("set Start")
     1452                self["key_red"] = StaticText()
     1453                self["key_red"].text = _("search")
     1454
     1455                HelpableScreen.__init__(self)
     1456                self["actions"] = HelpableActionMap(self, "AAFKeyActions",
     1457                        {
     1458                                "cancel": (self.Exit, "Beenden"),
     1459                                "left": (self.left, "Seite hoch"),
     1460                                "right": (self.right, "Seite runter"),
     1461                                "up": (self.up, "Hoch"),
     1462                                "down": (self.down, "Runter"),
     1463                                "ok": (self.ok, "OK"),
     1464                                "blue": (self.blue, "Blau"),
     1465                                "red": (self.virtualKB, "Red"),
     1466                        }, -2)
     1467
     1468        def up(self):
     1469                self["Mlist"].up()
     1470                self["Mlist"].selectionEnabled(1)
     1471
     1472        def down(self):
     1473                self["Mlist"].down()
     1474                self["Mlist"].selectionEnabled(1)
     1475
     1476        def left(self):
     1477                self["Mlist"].pageUp()
     1478
     1479        def right(self):
     1480                self["Mlist"].pageDown()
     1481
     1482        def Exit(self):
     1483                global menu
     1484                menu = "stop"
     1485                self.close()
     1486
     1487        def ok(self):
     1488                global menu
     1489                menu = self['Mlist'].l.getCurrentSelection()[0][2]
     1490                self.close()
     1491
     1492        def blue(self):
     1493                menu = self['Mlist'].l.getCurrentSelection()[0][2]
     1494                fwrite = open("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/startservice.cfg", "w")
     1495                fwrite.write(menu)
     1496                fwrite.close()
     1497                message = "%s %s" % (_("Dieser Filter wurde als Startfilter gesetzt!\n\n                       "), menu)
     1498                self.session.open( MessageBox, message, MessageBox.TYPE_INFO, timeout=5)
     1499
     1500
     1501        def FilterEntryComponent(self,file):
     1502                png = LoadPixmap("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/pics/" + file + ".png")
     1503                if png == None:
     1504                        png = LoadPixmap("/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/pics/info.png")
     1505                res = (png)
     1506                return res
     1507
     1508        def FilterEntryItem(self,entry):
     1509                rot = 16711680
     1510                gruen = 60928
     1511                dgruen = 52480
     1512                drot = 0xf47d19
     1513                mblau = 8900346
     1514                hblau = 11592447
     1515                dblau = 5215437
     1516                weiss = 0xffffff
     1517                orange = 0xf47d19
     1518                grau = 0x565656
     1519
     1520                res = [entry]
     1521                #       return (eListboxPythonMultiContent.TYPE_TEXT, pos[0], pos[1], size[0], size[1], font, flags, text, color, color_sel, backcolor, backcolor_sel, border_width, border_color)
     1522                res.append(MultiContentEntryPixmapAlphaTest(pos=(2, 5), size=(100, 50), png=entry[0]))  # png vorn
     1523                res.append(MultiContentEntryText(pos=(150, 15), size=(220, 35), font=0, text=entry[1], color=mblau, color_sel=mblau, backcolor_sel=grau))
     1524                return res
     1525
     1526        def virtualKB(self):
     1527                        self.search = ""
     1528                        self.session.openWithCallback(lambda x : self.VirtualKeyBoardCallback(x, ''), VirtualKeyBoard, title = (_("Suchstring eingeben:")), text = self.search)
     1529
     1530        def VirtualKeyBoardCallback(self, callback = None, entry = None):
     1531                global menu
     1532                if callback is not None and len(callback):
     1533                        print "[AddonManager] virtual callback",str(callback)
     1534                        menu = callback
     1535                        self.close()
    17821536
    17831537
  • ipk/source/system_addonmanager_2_0/usr/lib/enigma2/python/Plugins/Extensions/AddonManager/ipkdownload

    r2941 r5923  
    22
    33rm /tmp/aaf/*
     4
     5#  cat Packages | grep Filename: | sed "s/Filename: enigma2-plugin-//" | sed "s/.ipk//" | sed "s/_sh4//" | sed "s/_/ V/" >> PlugList
    46
    57if [ -e /var/etc/ipkg/official-feed.conf ]; then
     
    1315fi
    1416
    15 url=$url"/Packages"
     17url=$url"/PlugList"
    1618echo $url
    1719
    1820wget -O /tmp/aaf/test $url
    19 cat /tmp/aaf/test | grep "Filename: " | cut -d '"' -f8 >/tmp/aaf/first.txt
     21
     22# remove first 2 lines and last 2 lines
     23cat /tmp/aaf/test| sed '1,2d'|sed '$d'|sed '$d'| sed -e 's/ V/_/' >/tmp/aaf/first.txt
    2024
    2125for i in /tmp/aaf/first.txt; do
     
    2327        do
    2428       lines="$Zeile"
    25        Titel="`echo $lines | sed -e 's/enigma2-plugin-//'| sed -e 's/Filename: //'`"
    26        Filename="`echo $lines | sed -e 's/Filename: //'`"
    27         echo $Titel"##"$Filename >>/tmp/aaf/index.txt
     29       echo $lines"##enigma2-plugin-"$lines"_sh4.ipk" >>/tmp/aaf/index.txt
    2830   done < $i
    2931done
    3032
    31 cat /tmp/aaf/index.txt
     33#cat /tmp/aaf/index.txt
    3234
Note: See TracChangeset for help on using the changeset viewer.