diff options
| author | acid-burn <acidburn@opendreambox.org> | 2009-02-13 08:13:40 +0100 |
|---|---|---|
| committer | acid-burn <acidburn@opendreambox.org> | 2009-02-13 08:13:40 +0100 |
| commit | 9015ce354743d7a3a73400c8b91cd85a6ceaeb96 (patch) | |
| tree | 5036e309d2299238e345327ce7e5e752daae2909 /lib/python/Plugins | |
| parent | 64281edbf808514b65c333f134f2f824a2dcae36 (diff) | |
| download | enigma2-9015ce354743d7a3a73400c8b91cd85a6ceaeb96.tar.gz enigma2-9015ce354743d7a3a73400c8b91cd85a6ceaeb96.zip | |
remove IPKGInstaller and ConfigurationBackup
start working on Softwaremanager
Diffstat (limited to 'lib/python/Plugins')
16 files changed, 2 insertions, 323 deletions
diff --git a/lib/python/Plugins/Extensions/IpkgInstaller/.cvsignore b/lib/python/Plugins/Extensions/IpkgInstaller/.cvsignore deleted file mode 100644 index 138b9cc2..00000000 --- a/lib/python/Plugins/Extensions/IpkgInstaller/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -*.pyc -*.pyo -Makefile -Makefile.in diff --git a/lib/python/Plugins/Extensions/IpkgInstaller/Makefile.am b/lib/python/Plugins/Extensions/IpkgInstaller/Makefile.am deleted file mode 100644 index ece0698f..00000000 --- a/lib/python/Plugins/Extensions/IpkgInstaller/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -installdir = $(LIBDIR)/enigma2/python/Plugins/Extensions/IpkgInstaller - -install_PYTHON = \ - __init__.py \ - plugin.py diff --git a/lib/python/Plugins/Extensions/IpkgInstaller/__init__.py b/lib/python/Plugins/Extensions/IpkgInstaller/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/lib/python/Plugins/Extensions/IpkgInstaller/__init__.py +++ /dev/null diff --git a/lib/python/Plugins/Extensions/IpkgInstaller/plugin.py b/lib/python/Plugins/Extensions/IpkgInstaller/plugin.py deleted file mode 100644 index 4893dc47..00000000 --- a/lib/python/Plugins/Extensions/IpkgInstaller/plugin.py +++ /dev/null @@ -1,67 +0,0 @@ -from Components.ActionMap import ActionMap -from Components.Ipkg import IpkgComponent -from Components.Label import Label -from Components.SelectionList import SelectionList -from Plugins.Plugin import PluginDescriptor -from Screens.Ipkg import Ipkg -from Screens.Screen import Screen - -class IpkgInstaller(Screen): - skin = """ - <screen position="100,100" size="550,400" title="..." > - <widget name="red" halign="center" valign="center" position="0,0" size="140,60" backgroundColor="red" font="Regular;21" /> - <widget name="green" halign="center" valign="center" position="140,0" text="Install selected" size="140,60" backgroundColor="green" font="Regular;21" /> - <widget name="yellow" halign="center" valign="center" position="280,0" size="140,60" backgroundColor="yellow" font="Regular;21" /> - <widget name="blue" halign="center" valign="center" position="420,0" size="140,60" backgroundColor="blue" font="Regular;21" /> - <widget name="list" position="0,60" size="550,360" /> - </screen> - """ - - def __init__(self, session, list): - self.skin = IpkgInstaller.skin - Screen.__init__(self, session) - - self.list = SelectionList() - self["list"] = self.list - for listindex in range(len(list)): - self.list.addSelection(list[listindex], list[listindex], listindex, True) - - self["red"] = Label() - self["green"] = Label() - self["yellow"] = Label() - self["blue"] = Label() - - self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], - { - "ok": self.list.toggleSelection, - "cancel": self.close, - "green": self.install - }, -1) - - def install(self): - list = self.list.getSelectionsList() - cmdList = [] - for item in list: - cmdList.append((IpkgComponent.CMD_INSTALL, { "package": item[1] })) - print cmdList - self.session.open(Ipkg, cmdList = cmdList) - -def filescan_open(list, session, **kwargs): - filelist = [x.path for x in list] - session.open(IpkgInstaller, filelist) # list - -def filescan(**kwargs): - from Components.Scanner import Scanner, ScanPath - return \ - Scanner(mimetypes = ["application/x-debian-package"], - paths_to_scan = - [ - ScanPath(path = "ipk", with_subdirs = True), - ScanPath(path = "", with_subdirs = False), - ], - name = "Ipkg", - description = "Install software updates...", - openfnc = filescan_open, ) - -def Plugins(**kwargs): - return [ PluginDescriptor(name="Ipkg", where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan) ] diff --git a/lib/python/Plugins/Extensions/Makefile.am b/lib/python/Plugins/Extensions/Makefile.am index 9f3737aa..edbd2084 100644..100755 --- a/lib/python/Plugins/Extensions/Makefile.am +++ b/lib/python/Plugins/Extensions/Makefile.am @@ -1 +1 @@ -SUBDIRS = TuxboxPlugins FileManager CutListEditor PicturePlayer MediaScanner MediaPlayer IpkgInstaller GraphMultiEPG SocketMMI DVDPlayer DVDBurn +SUBDIRS = TuxboxPlugins FileManager CutListEditor PicturePlayer MediaScanner MediaPlayer GraphMultiEPG SocketMMI DVDPlayer DVDBurn diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/.cvsignore b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/.cvsignore deleted file mode 100644 index 138b9cc2..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -*.pyc -*.pyo -Makefile -Makefile.in diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/LICENSE b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/LICENSE deleted file mode 100644 index 99700593..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -This plugin is licensed under the Creative Commons -Attribution-NonCommercial-ShareAlike 3.0 Unported -License. To view a copy of this license, visit -http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative -Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - -Alternatively, this plugin may be distributed and executed on hardware which -is licensed by Dream Multimedia GmbH. - -This plugin is NOT free software. It is open source, you are allowed to -modify it (if you keep the license), but it may not be commercially -distributed other than under the conditions noted above. diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/Makefile.am b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/Makefile.am deleted file mode 100644 index d50236d8..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -installdir = $(LIBDIR)/enigma2/python/Plugins/SystemPlugins/ConfigurationBackup - -install_PYTHON = \ - __init__.py \ - plugin.py red.png yellow.png green.png blue.png backup.png - -install_DATA = LICENSE - diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/__init__.py b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/__init__.py +++ /dev/null diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/backup.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/backup.png Binary files differdeleted file mode 100644 index 4962a058..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/backup.png +++ /dev/null diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/blue.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/blue.png Binary files differdeleted file mode 100644 index a392bbe6..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/blue.png +++ /dev/null diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/green.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/green.png Binary files differdeleted file mode 100644 index f168e4d0..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/green.png +++ /dev/null diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py deleted file mode 100644 index 7a918da6..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py +++ /dev/null @@ -1,221 +0,0 @@ -from Screens.Screen import Screen -from Screens.MessageBox import MessageBox -from Screens.Console import Console -from Components.ActionMap import ActionMap, NumberActionMap -from Components.Pixmap import Pixmap -from Components.Label import Label -from Components.MenuList import MenuList -from Components.config import ConfigSelection, ConfigSubsection, KEY_LEFT, KEY_RIGHT, KEY_0, getConfigListEntry -from Components.ConfigList import ConfigList -from Plugins.Plugin import PluginDescriptor - -from Tools.Directories import * -from os import path, makedirs, listdir -from time import localtime -from datetime import date - -plugin_path = "" - -# FIXME: harddiskmanager has a better overview about available mointpoints! -BackupPath = { - "hdd" : "/media/hdd/backup", - "usb" : "/media/usb/backup", - "cf" : "/media/cf/backup" - } - -MountPoints = { - "hdd" : "/media/hdd", - "usb" : "/media/usb", - "cf" : "/media/cf" - } - -class BackupSetup(Screen): - skin = """ - <screen position="135,144" size="450,300" title="Backup and Restore" > - <widget name="config" position="10,10" size="430,240" /> - <widget name="cancel" position="10,255" size="100,40" pixmap="~/red.png" transparent="1" alphatest="on" /> - <widget name="canceltext" position="0,0" size="0,0" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" foregroundColor="black" /> - <widget name="ok" position="120,255" size="100,40" pixmap="~/green.png" transparent="1" alphatest="on" /> - <widget name="oktext" position="0,0" size="0,0" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" foregroundColor="black" /> - <widget name="restore" position="230,255" size="100,40" pixmap="~/yellow.png" transparent="1" alphatest="on" /> - <widget name="restoretext" position="0,0" size="0,0" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" foregroundColor="black" /> - <widget name="backup" position="340,255" size="100,40" pixmap="~/blue.png" transparent="1" alphatest="on" /> - <widget name="backuptext" position="0,0" size="0,0" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" foregroundColor="black" /> - </screen>""" - - def keyLeft(self): - self["config"].handleKey(KEY_LEFT) - - def keyRight(self): - self["config"].handleKey(KEY_RIGHT) - - def keyNumberGlobal(self, number): - print "You pressed number", number - if (self["config"].getCurrent()[1].parent.enabled == True): - self["config"].handleKey(KEY_0+number) - - def keyCancel(self): - for x in self["config"].list: - x[1].cancel() - self.close() - - def keySave(self): - for x in self["config"].list: - x[1].save() - self.close() - - def __init__(self, session, args = None): - Screen.__init__(self, session) - self.skin_path = plugin_path - - self["oktext"] = Label(_("OK")) - self["canceltext"] = Label(_("Cancel")) - self["backuptext"] = Label(_("Backup")) - self["restoretext"] = Label(_("Restore")) - self["restore"] = Pixmap() - self["backup"] = Pixmap() - self["ok"] = Pixmap() - self["cancel"] = Pixmap() - - self.path = "" - self.list = [] - self["config"] = ConfigList(self.list) - self.createSetup() - - self["actions"] = NumberActionMap(["SetupActions"], - { - "ok": self.keySave, - "cancel": self.keyCancel, - "left": self.keyLeft, - "right": self.keyRight - }, -1) - - self["shortcuts"] = ActionMap(["ShortcutActions"], - { - "red": self.keyCancel, - "green": self.keySave, - "blue": self.Backup, - "yellow": self.Restore, - }) - - - def createSetup(self): - print "Creating BackupSetup" - self.list = [ ] - self["config"] = ConfigList(self.list) - self.backup = ConfigSubsection() - self.backup.type = ConfigSelection(choices = [("settings", _("enigma2 and network")), ("var", _("/var directory")), ("skin", _("/usr/share/enigma2 directory"))], default="settings") - self.backup.location = ConfigSelection(choices = [("hdd", _("Harddisk")), ("usb", _("USB Stick")), ("cf", _("CF Drive"))]) - self.list.append(getConfigListEntry(_("Backup Mode"), self.backup.type)) - self.list.append(getConfigListEntry(_("Backup Location"), self.backup.location)) - - def createBackupfolders(self): - self.path = BackupPath[self.backup.location.value] - print "Creating Backup Folder if not already there..." - if (path.exists(self.path) == False): - makedirs(self.path) - - def Backup(self): - print "this will start the backup now!" - self.session.openWithCallback(self.runBackup, MessageBox, _("Do you want to backup now?\nAfter pressing OK, please wait!")) - - def Restore(self): - print "this will start the restore now!" - self.session.open(RestoreMenu, self.backup) - - def runBackup(self, result): - if result: - if path.ismount(MountPoints[self.backup.location.value]): - self.createBackupfolders() - d = localtime() - dt = date(d.tm_year, d.tm_mon, d.tm_mday) - self.path = BackupPath[self.backup.location.value] - if self.backup.type.value == "settings": - print "Backup Mode: Settings" - self.session.open(Console, title = "Backup running", cmdlist = ["tar -czvf " + self.path + "/" + str(dt) + "_settings_backup.tar.gz /etc/enigma2/ /etc/network/interfaces /etc/wpa_supplicant.conf"]) - elif self.backup.type.value == "var": - print "Backup Mode: var" - self.session.open(Console, title = "Backup running", cmdlist = [ "tar -czvf " + self.path + "/" + str(dt) + "_var_backup.tar.gz /var/"]) - elif self.backup.type.value == "skin": - print "Backup Mode: skin" - self.session.open(Console, title ="Backup running", cmdlist = [ "tar -czvf " + self.path + "/" + str(dt) + "_skin_backup.tar.gz /usr/share/enigma2/"]) - else: - self.session.open(MessageBox, _("Sorry your Backup destination does not exist\n\nPlease choose an other one."), MessageBox.TYPE_INFO) - -class RestoreMenu(Screen): - skin = """ - <screen position="135,144" size="450,300" title="Restore Backups" > - <widget name="filelist" position="10,10" size="430,240" scrollbarMode="showOnDemand" /> - <widget name="cancel" position="120,255" size="100,40" pixmap="~/red.png" transparent="1" alphatest="on" /> - <widget name="canceltext" position="0,0" size="0,0" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" foregroundColor="black" /> - <widget name="restore" position="230,255" size="100,40" pixmap="~/yellow.png" transparent="1" alphatest="on" /> - <widget name="restoretext" position="0,0" size="0,0" valign="center" halign="center" zPosition="2" font="Regular;20" transparent="1" foregroundColor="black" /> - </screen>""" - - def __init__(self, session, backup): - Screen.__init__(self, session) - self.skin_path = plugin_path - self.backup = backup - - self["canceltext"] = Label(_("Cancel")) - self["restoretext"] = Label(_("Restore")) - self["restore"] = Pixmap() - self["cancel"] = Pixmap() - - self.sel = [] - self.val = [] - self.entry = False - self.exe = False - - self.path = "" - - self["actions"] = NumberActionMap(["SetupActions"], - { - "ok": self.KeyOk, - "cancel": self.keyCancel - }, -1) - - self["shortcuts"] = ActionMap(["ShortcutActions"], - { - "red": self.keyCancel, - "yellow": self.KeyOk, - }) - self.flist = [] - self["filelist"] = MenuList(self.flist) - self.fill_list() - - def fill_list(self): - self.flist = [] - self.path = BackupPath[self.backup.location.value] - if (path.exists(self.path) == False): - makedirs(self.path) - for file in listdir(self.path): - if (file.endswith(".tar.gz")): - self.flist.append((file)) - self.entry = True - self["filelist"].l.setList(self.flist) - - def KeyOk(self): - if (self.exe == False) and (self.entry == True): - self.sel = self["filelist"].getCurrent() - self.val = self.path + self.sel - self.session.openWithCallback(self.startRestore, MessageBox, _("are you sure you want to restore\nfollowing backup:\n" + self.sel + "\nEnigma2 will restart after the restore")) - - def keyCancel(self): - self.close() - - def startRestore(self, ret = False): - if (ret == True): - self.exe = True - self.session.open(Console, title = "Restore running", cmdlist = ["tar -xzvf " + self.path + "/" + self.sel + " -C /", "killall -9 enigma2"]) - - def Exit(self): - self.close() - -def BackupMain(session, **kwargs): - session.open(BackupSetup) - -def Plugins(path, **kwargs): - global plugin_path - plugin_path = path - return PluginDescriptor(name="Backup/Restore", description="Backup and Restore your Settings", icon="backup.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=BackupMain) diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/red.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/red.png Binary files differdeleted file mode 100644 index 8096045f..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/red.png +++ /dev/null diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/yellow.png b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/yellow.png Binary files differdeleted file mode 100644 index dacb80e6..00000000 --- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/yellow.png +++ /dev/null diff --git a/lib/python/Plugins/SystemPlugins/Makefile.am b/lib/python/Plugins/SystemPlugins/Makefile.am index 4491eafc..be12378c 100644..100755 --- a/lib/python/Plugins/SystemPlugins/Makefile.am +++ b/lib/python/Plugins/SystemPlugins/Makefile.am @@ -1 +1 @@ -SUBDIRS = SoftwareUpdate FrontprocessorUpgrade PositionerSetup ConfigurationBackup Satfinder SkinSelector SatelliteEquipmentControl Videomode VideoTune Hotplug DefaultServicesScanner NFIFlash DiseqcTester +SUBDIRS = SoftwareUpdate FrontprocessorUpgrade PositionerSetup Satfinder SkinSelector SatelliteEquipmentControl Videomode VideoTune Hotplug DefaultServicesScanner NFIFlash DiseqcTester |
