Example #1
0
    def __init__(self, session, parent, firmware):
        Screen.__init__(self, session)
        self.session = session

        self["key_blue"] = StaticText(_("Download"))

        self["status"] = StaticText(_(" "))
        self["file_list"] = FileList("/", matchingPattern="^.*")

        self["actions"] = ActionMap(
            [
                "OkCancelActions",
                "ShortcutActions",
                "WizardActions",
                "ColorActions",
            ], {
                "ok": self.onClickOk,
                "cancel": self.onClickCancel,
                "blue": self.onClickBlue,
                "up": self.onClickUp,
                "down": self.onClickDown,
                "left": self.onClickLeft,
                "right": self.onClickRight,
            }, -1)

        self.resetGUI()
        self.firmware = firmware

        self.callback = None
        self.timer_downloading = None

        self.downloadLock = False
        self.setTitle(firmware.upper() + " File Browser")
Example #2
0
	def __init__(self, session, args = None):
		Screen.__init__(self, session)
		InfoBarAudioSelection.__init__(self)
		InfoBarAspectSelection.__init__(self)
		InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
		InfoBarNotifications.__init__(self)
		InfoBarBase.__init__(self)
		InfoBarScreenSaver.__init__(self)
		InfoBarSubtitleSupport.__init__(self)
		HelpableScreen.__init__(self)
		InfoBarResolutionSelection.__init__(self)
		self.summary = None
		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
		self.session.nav.stopService()

		self.playlistparsers = {}
		self.addPlaylistParser(PlaylistIOM3U, "m3u")
		self.addPlaylistParser(PlaylistIOPLS, "pls")
		self.addPlaylistParser(PlaylistIOInternal, "e2pls")

		# 'None' is magic to start at the list of mountpoints
		try:
			defaultDir = config.mediaplayer.defaultDir.value
		except:
			Load_defaults()
			defaultDir = config.mediaplayer.defaultDir.value
		self.filelist = FileList(defaultDir, matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|trp|mts|m2ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|flv|mov|dts|3gp|3g2|asf|wmv|wma|webm)", useServiceRef = True, additionalExtensions = "4098:m3u 4098:e2pls 4098:pls")
		self["filelist"] = self.filelist

		self.playlist = MyPlayList()
		self.is_closing = False
		self.hiding = False
		self.delname = ""
		self.playlistname = ""
		self["playlist"] = self.playlist

		self["PositionGauge"] = ServicePositionGauge(self.session.nav)

		self["currenttext"] = Label("")

		self["artisttext"] = Label(_("Artist")+':')
		self["artist"] = Label("")
		self["titletext"] = Label(_("Title")+':')
		self["title"] = Label("")
		self["albumtext"] = Label(_("Album")+':')
		self["album"] = Label("")
		self["yeartext"] = Label(_("Year")+':')
		self["year"] = Label("")
		self["genretext"] = Label(_("Genre")+':')
		self["genre"] = Label("")
		self["coverArt"] = MediaPixmap()
		self["repeat"] = MultiPixmap()

		self.seek_target = None

		try:
			from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
			hotplugNotifier.append(self.hotplugCB)
		except Exception, ex:
			print "[MediaPlayer] No hotplug support", ex
Example #3
0
 def __init__(self, session, currDir, title="Directory browser"):
     print(
         "DirectorySelectorWidget.__init__ -------------------------------")
     Screen.__init__(self, session)
     # for the skin: first try MediaPlayerDirectoryBrowser, then FileBrowser, this allows individual skinning
     #self.skinName = ["MediaPlayerDirectoryBrowser", "FileBrowser" ]
     self["key_red"] = Label(_("Cancel"))
     #self["key_yellow"] = Label(_("Refresh"))
     self["key_blue"] = Label(_("New directory"))
     self["key_green"] = Label(_("Select"))
     self["curr_dir"] = Label(_(" "))
     self.filelist = FileList(directory=currDir,
                              matchingPattern="",
                              showFiles=False)
     self["filelist"] = self.filelist
     self["FilelistActions"] = ActionMap(
         ["SetupActions", "ColorActions"], {
             "green": self.use,
             "red": self.exit,
             "yellow": self.refresh,
             "blue": self.newDir,
             "ok": self.ok,
             "cancel": self.exit
         })
     self.title = title
     self.onLayoutFinish.append(self.layoutFinished)
     self.onClose.append(self.__onClose)
Example #4
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self["actions"] = HelpableActionMap(
         self, "MC_AudioPlayerActions", {
             "ok": (self.KeyOk, "Play selected file"),
             "left": (self.leftUp, "List Top"),
             "right": (self.rightDown, "List Bottom"),
             "up": (self.up, "List up"),
             "down": (self.down, "List down"),
         }, -2)
     self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
                                                 {"cancel": self.close}, -2)
     currDir = config.plugins.mc_ap.lastDir.value
     if not pathExists(currDir):
         currDir = "/"
     inhibitDirs = [
         "/bin", "/boot", "/dev", "/dev.static", "/etc", "/lib", "/proc",
         "/ram", "/root", "/sbin", "/sys", "/tmp", "/usr", "/var"
     ]
     self.filelist = FileList(
         currDir,
         useServiceRef=True,
         showDirectories=True,
         showFiles=True,
         matchingPattern=
         "(?i)^.*\.(m3u|mp2|mp3|wav|wave|pls|wma|m4a|ogg|ra|flac)",
         inhibitDirs=inhibitDirs)
     self["filelist"] = self.filelist
     self["currentfolder"] = Label()
     self["currentfolder"].setText(str(currDir))
Example #5
0
    def __init__(self, session, initDir, plugin_path=None):
        Screen.__init__(self, session)

        if not os.path.isdir(initDir):
            initDir = "/hdd"

        self["folderlist"] = FileList(initDir,
                                      inhibitMounts=False,
                                      inhibitDirs=False,
                                      showMountpoints=False,
                                      showFiles=False)
        self["media"] = Label()
        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions", "SetupActions"], {
                "cancel": self.cancel,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "ok": self.OK,
                "green": self.green,
                "red": self.cancel
            }, -1)
        self["key_red"] = StaticText("Cancel")
        self["key_green"] = StaticText("Ok")
Example #6
0
 def __init__(self, session, args=None):
     self.skin = explorer_main
     Screen.__init__(self, session)
     self.sesion = session
     self.altservice = self.session.nav.getCurrentlyPlayingServiceReference(
     )
     if pathExists(config.plugins.ExFiles.Execute.value):
         StartP = config.plugins.ExFiles.Execute.value
     else:
         StartP = None
     if config.plugins.ExFiles.Filtre.value == 'off':
         self.Filtre = False
         self['myliste'] = FileList(StartP)
     self['key_red'] = Label(_('Delete'))
     self['key_green'] = Label(_('Info'))
     self['key_blue'] = Label(_('Ok'))
     self['actions'] = ActionMap(
         [
             'SetupActions', 'WizardActions', 'DirectionActions',
             'ColorActions', 'MenuActions', 'EPGSelectActions',
             'InfobarActions'
         ], {
             'ok': self.ok,
             'back': self.explExit,
             'red': self.ExecDelete,
             'left': self.left,
             'right': self.right,
             'green': self.about,
             'blue': self.ok,
             'up': self.up,
             'down': self.down
         }, -1)
     return
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        # Show Background MVI
        #system("/usr/bin/showiframe /usr/lib/enigma2/python/Plugins/Extensions/EVOMediaCenter/icons/background.mvi &")

        self["key_red"] = Button("Favorites")
        self["key_green"] = Button("Slide Show")
        self["key_yellow"] = Button("Thumb View")
        self["key_blue"] = Button(_("Settings"))

        self["currentfolder"] = Label("")
        self["currentfavname"] = Label("")
        self.curfavfolder = -1

        self["actions"] = HelpableActionMap(
            self,
            "EVOMC_PictureViewerActions",
            {
                "ok": (self.KeyOk, "Show Picture"),
                #				"cancel": (self.Exit, "Exit Picture Viewer"),
                "left": (self.leftUp, "List Top"),
                "right": (self.rightDown, "List Bottom"),
                "up": (self.up, "List up"),
                "down": (self.down, "List down"),
                "menu": (self.KeyMenu, "File / Folder Options"),
                "info": (self.StartExif, "Show File Info"),
                "nextBouquet": (self.NextFavFolder, "Next Favorite Folder"),
                "prevBouquet":
                (self.PrevFavFolder, "Previous Favorite Folder"),
                "red": (self.FavoriteFolders, "Favorite Folders"),
                "green": (self.startslideshow, "Start Slideshow"),
                "yellow": (self.StartThumb, "Thumb View"),
                "blue": (self.Settings, "Settings"),
            },
            -2)

        self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", {
            "cancel": (self.Exit, "Exit Picture Viewer"),
        }, -2)

        self.aspect = getAspect()
        currDir = config.plugins.EVOMC_pp.lastDir.value
        if not pathExists(currDir):
            currDir = "/"

        self["currentfolder"].setText(str(currDir))

        self.filelist = FileList(
            currDir, matchingPattern="(?i)^.*\.(jpeg|jpg|jpe|png|bmp)")
        self["filelist"] = self.filelist
        self["thumbnail"] = Pixmap()
        evfd.getInstance().vfd_write_string("EVO-PICVIEWER")
        self.ThumbTimer = eTimer()
        self.ThumbTimer.callback.append(self.showThumb)
        self.ThumbTimer.start(500, True)

        self.picload = ePicLoad()
Example #8
0
    def __init__(self, session, text = '', filename = '', currDir = None, location = None, userMode = False, windowTitle = _('Choose backup location'), minFree = None, autoAdd = False, editDir = False, inhibitDirs = [], inhibitMounts = []):
        Screen.__init__(self, session)
        self.skin_path = resolveFilename(SCOPE_PLUGINS, "Extensions/PurePrestige")
        HelpableScreen.__init__(self)
        self['text'] = StaticText(_('Selected memory place:'))
        self['oktext'] = StaticText(_('for select sublist!'))
        self.text = text
        self.filename = filename
        self.minFree = minFree
        self.reallocation = location
        if not (location and location.value[:]):
            self.location = []
            self.userMode = userMode
            self.autoAdd = autoAdd
            self.editDir = editDir
            self.inhibitDirs = inhibitDirs
            self.inhibitMounts = inhibitMounts
            inhibitDirs = ['/bin',
             '/boot',
             '/dev',
             '/lib',
             '/proc',
             '/sbin',
             '/sys',
             '/mnt',
             '/var',
             '/home',
             '/tmp',
             '/srv',
             '/etc',
             '/share',
             '/usr',
             '/ba',
             '/MB_Images']
            inhibitMounts = ['/mnt', '/ba', '/MB_Images']
            self['filelist'] = FileList(currDir, showDirectories=True, showFiles=False, inhibitMounts=inhibitMounts, inhibitDirs=inhibitDirs)
            self['mountlist'] = MenuList(mountedDevs)
            self['key_green'] = Button(_('Save'))
            self['key_red'] = Button(_('Close'))
            self['green'] = Pixmap()
            self['red'] = Pixmap()
            self['target'] = Label()
            self.userMode and self.usermodeOn()

        class BackupLocationActionMap(HelpableActionMap):

            def __init__(self, parent, context, actions = {}, prio = 0):
                HelpableActionMap.__init__(self, parent, context, actions, prio)

        self['WizardActions'] = BackupLocationActionMap(self, 'WizardActions', {'left': self.left,
         'right': self.right,
         'up': self.up,
         'down': self.down,
         'ok': (self.ok, _('Select')),
         'back': (self.cancel, _('Cancel'))}, -2)
        self['ColorActions'] = BackupLocationActionMap(self, 'ColorActions', {'red': self.cancel,
         'green': self.select}, -2)
        self.setWindowTitle()
        self.onLayoutFinish.append(self.switchToFileListOnStart)
Example #9
0
	def __init__(self, session):
		# XXX: implement bookmarks
		LocationBox.__init__(self, session)

		self.skinName = [ "TorrentLocationBox", "LocationBox" ]

		# non-standard filelist which shows .tor(rent) files
		self["filelist"] = FileList(None, showDirectories = True, showFiles = True, matchingPattern = "^.*\.tor(rent)?")
Example #10
0
    def __init__(self, session, path_left=None):
        if path_left is None:
            if os_path_isdir(config.plugins.filebrowser.path_left.value
                             ) and config.plugins.filebrowser.savedirs.value:
                path_left = config.plugins.filebrowser.path_left.value
            else:
                path_left = "/"

        if os_path_isdir(config.plugins.filebrowser.path_right.value
                         ) and config.plugins.filebrowser.savedirs.value:
            path_right = config.plugins.filebrowser.path_right.value
        else:
            path_right = "/"

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

        self["list_left"] = FileList(path_left, matchingPattern="^.*")
        self["list_right"] = FileList(path_right, matchingPattern="^.*")
        self["red"] = Label(_("delete"))
        self["green"] = Label(_("move"))
        self["yellow"] = Label(_("copy"))
        self["blue"] = Label(_("rename"))

        self["actions"] = ActionMap(
            [
                "ChannelSelectBaseActions", "WizardActions",
                "DirectionActions", "MenuActions", "NumberActions",
                "ColorActions"
            ], {
                "ok": self.ok,
                "back": self.exit,
                "menu": self.goMenu,
                "nextMarker": self.listRight,
                "prevMarker": self.listLeft,
                "up": self.goUp,
                "down": self.goDown,
                "left": self.goLeft,
                "right": self.goRight,
                "red": self.goRed,
                "green": self.goGreen,
                "yellow": self.goYellow,
                "blue": self.goBlue,
                "0": self.doRefresh,
            }, -1)
        self.onLayoutFinish.append(self.listLeft)
Example #11
0
    def getFileList(self, param):
        if param["path"] == "playlist":
            mp = self.tryOpenMP()
            # TODO: Fix dummy return if unable to load mp
            if mp is None:
                return (("empty", True, "playlist"), )

            if mp.playlist:
                return [(serviceRef.getPath(), False, "playlist")
                        for serviceRef in mp.playlist.getServiceRefList()]
            else:
                return (("empty", True, "playlist"), )

        # try to extract current pattern from media player and use it over our hardcoded one as default
        try:
            matchingPattern = mp.filelist.matchingPattern
        except Exception:
            matchingPattern = "(?i)^.*\.(mp2|mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|divx|m4v|mkv|mp4|m4a|dat|flac|mov|m2ts)"  #MediaPlayer-Match

        useServiceRef = False
        if param["types"] == "audio":
            matchingPattern = "(?i)^.*\.(mp3|ogg|wav|wave|m3u|pls|e2pls)"
            useServiceRef = True
        elif param["types"] == "video":
            matchingPattern = "(?i)^.*\.(ts|avi|mpeg|m3u|pls|e2pls|mpg|vob)"
            useServiceRef = True
        elif param["types"] == "any":
            matchingPattern = ".*"
        elif param["types"]:
            matchingPattern = param["types"]

        path = param["path"]
        if path is not None:
            if path.lower() == "filesystems":
                path = None
            elif not os_path.isdir(path):
                # TODO: returning something is better than just dying but is this return sane?
                return ((None, True, path), )

        filelist = FileList(path,
                            showDirectories=True,
                            showFiles=True,
                            matchingPattern=matchingPattern,
                            useServiceRef=useServiceRef,
                            isTop=False)
        list = filelist.getFileList()
        if useServiceRef is True:
            returnList = [(x[0][0].toString(), x[0][1],
                           path) if x[0][1] is False else
                          (x[0][0], x[0][1], path) for x in list]
        else:
            returnList = [(param["path"] + x[0][0], x[0][1],
                           path) if x[0][1] is False else
                          (x[0][0], x[0][1], path) for x in list]

        return returnList
Example #12
0
 def openPicturePlayerThumbDir(self, option):
     if option is None:
         return
     from Plugins.Extensions.PicturePlayer.ui import Pic_Thumb
     from Components.FileList import FileList
     path = option[1] + "/"
     filelist = FileList(
         path, matchingPattern="(?i)^.*\.(jpeg|jpg|jpe|png|bmp|gif)")
     self.session.open(Pic_Thumb, filelist.getFileList(), 0,
                       filelist.getCurrentDirectory())
Example #13
0
    def __init__(self, session, dir="/"):
        Screen.__init__(self, session)

        self["key_green"] = Label(_("Select"))

        try:
            self["filelist"] = FileList(dir,
                                        showDirectories=True,
                                        showFiles=False)
        except:
            self["filelist"] = FileList("/", showDirectories, showFiles)

        self["actions"] = ActionMap(["ColorActions", "OkCancelActions"], {
            "ok": self.okClicked,
            "cancel": self.exit,
            "green": self.select
        }, -1)

        self.onLayoutFinish.append(self.updateDirectoryName)
Example #14
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self['filelist'] = FileList('/tmp', matchingPattern='(?i)^.*\\.(ipk|tar\\.gz|tgz|tar.bz2|zip|rar)')
     self['FilelistActions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'ok': self.ok,
      'red': self.ok,
      'cancel': self.exit,
      'blue': self.exit})
     self['key_green'] = Button('')
     self['key_red'] = Button(_('OK'))
     self['key_blue'] = Button(_('Exit'))
     self['key_yellow'] = Button('')
     self.onLayoutFinish.append(self.layoutFinished)
Example #15
0
    def getFileList(self, param):
        print "getFileList:", param

        if param["path"] == "playlist":
            # TODO: Fix dummy return if unable to load mp
            if not self.tryOpenMP():
                return (("empty", "True", "playlist"), )

            mp = self.session.mediaplayer
            if mp.playlist:
                return [(serviceRef.toString(), "True", "playlist")
                        for serviceRef in mp.playlist.getServiceRefList()]
            else:
                return (("empty", "True", "playlist"), )

        returnList = []

        matchingPattern = "(?i)^.*\.(mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob)"  #MediaPlayer-Match
        useServiceRef = False
        if param["types"] == "audio":
            matchingPattern = "(?i)^.*\.(mp3|ogg|wav|wave|m3u|pls|e2pls)"
            useServiceRef = True
        elif param["types"] == "video":
            matchingPattern = "(?i)^.*\.(ts|avi|mpeg|m3u|pls|e2pls|mpg|vob)"
            useServiceRef = True
        elif param["types"] == "any":
            matchingPattern = ".*"
        else:
            matchingPattern = param["types"]

        filelist = FileList(param["path"],
                            showDirectories=True,
                            showFiles=True,
                            matchingPattern=matchingPattern,
                            useServiceRef=useServiceRef,
                            isTop=False)
        list = filelist.getFileList()
        for x in list:
            if useServiceRef == True:
                if x[0][1] == False:  #isDir
                    returnList.append(
                        (x[0][0].toString(), x[0][1], param["path"]))
                else:
                    returnList.append((x[0][0], x[0][1], param["path"]))
            else:
                if x[0][1] == False:  #isDir
                    returnList.append(
                        (param["path"] + x[0][0], x[0][1], param["path"]))
                else:
                    returnList.append((x[0][0], x[0][1], param["path"]))

        return returnList
Example #16
0
    def loadEmuList(self):
        emu = []
        crd = []
        emu.append('None')
        crd.append('None')
        self.emu_list = {}
        self.crd_list = {}
        self.emu_list['None'] = 'None'
        self.crd_list['None'] = 'None'
        emufilelist = FileList('/usr/emuscript', matchingPattern='_em.*')
        srvfilelist = FileList('/usr/emuscript', matchingPattern='_cs.*')
        for x in emufilelist.getFileList():
            if x[0][1] != True:
                emuName = t.readEmuName(x[0][0][:-6])
                emu.append(emuName)
                self.emu_list[emuName] = x[0][0][:-6]

        softcam = ConfigSelection(default=t.readEmuName(t.readEmuActive()),
                                  choices=emu)
        for x in srvfilelist.getFileList():
            if x[0][1] != True:
                srvName = t.readSrvName(x[0][0][:-6])
                crd.append(srvName)
                self.crd_list[srvName] = x[0][0][:-6]

        cardserver = ConfigSelection(default=t.readSrvName(t.readSrvActive()),
                                     choices=crd)
        del self.list[:]
        self.list.append(
            getConfigListEntry(
                _('SoftCams (%s) :') % str(len(emu) - 1), softcam))
        self.list.append(
            getConfigListEntry(
                _('CardServers (%s) :') % str(len(crd) - 1), cardserver))
        self.list.append(
            getConfigListEntry(_('About ItalySat'), ConfigNothing()))
        self['config'].list = self.list
        self['config'].l.setList(self.list)
Example #17
0
    def getFileList(self, param):
        if param["path"] == "playlist":
            mp = self.tryOpenMP()
            # TODO: Fix dummy return if unable to load mp
            if mp is None:
                return (("empty", True, "playlist"), )

            if mp.playlist:
                return [(serviceRef.getPath(), False, "playlist")
                        for serviceRef in mp.playlist.getServiceRefList()]
            else:
                return (("empty", True, "playlist"), )

        matchingPattern = "(?i)^.*\.(mp3|ogg|ts|wav|wave|m3u|pls|e2pls|mpg|vob)"  #MediaPlayer-Match
        useServiceRef = False
        if param["types"] == "audio":
            matchingPattern = "(?i)^.*\.(mp3|ogg|wav|wave|m3u|pls|e2pls)"
            useServiceRef = True
        elif param["types"] == "video":
            matchingPattern = "(?i)^.*\.(ts|avi|mpeg|m3u|pls|e2pls|mpg|vob)"
            useServiceRef = True
        elif param["types"] == "any":
            matchingPattern = ".*"
        elif param["types"]:
            matchingPattern = param["types"]

        path = param["path"]
        if path == "Filesystems":
            path = None
        elif path is not None and not os_path.isdir(path):
            # TODO: returning something is better than just dying but is this return sane?
            return ((None, True, path), )

        filelist = FileList(path,
                            showDirectories=True,
                            showFiles=True,
                            matchingPattern=matchingPattern,
                            useServiceRef=useServiceRef,
                            isTop=False)
        list = filelist.getFileList()
        if useServiceRef is True:
            returnList = [(x[0][0].toString(), x[0][1],
                           path) if x[0][1] is False else
                          (x[0][0], x[0][1], path) for x in list]
        else:
            returnList = [(param["path"] + x[0][0], x[0][1],
                           path) if x[0][1] is False else
                          (x[0][0], x[0][1], path) for x in list]

        return returnList
Example #18
0
	def __init__(self, session, downloadDir):
		Screen.__init__(self, session)
		self.skinName = ['YouTubeDirBrowser', 'FileBrowser']
		self['key_red'] = StaticText(_('Cancel'))
		self['key_green'] = StaticText(_('Use'))
		self.filelist = FileList(downloadDir, showFiles = False)
		self['filelist'] = self.filelist
		self['FilelistActions'] = ActionMap(['SetupActions', 'ColorActions'],
			{
				'cancel': self.cancel,
				'red': self.cancel,
				'ok': self.ok,
				'green': self.use
			}, -2)
		self.onLayoutFinish.append(self.layoutFinished)
Example #19
0
	def copyDirectory(self, directory, recursive = True):
		print("[MediaPlayer] copyDirectory", directory)
		if directory == '/':
			print("[MediaPlayer] refusing to operate on /")
			return
		filelist = FileList(directory, useServiceRef = True, showMountpoints = False, isTop = True)

		for x in filelist.getFileList():
			if x[0][1] == True: #isDir
				if recursive:
					if x[0][0] != directory:
						self.copyDirectory(x[0][0])
			elif filelist.getServiceRef() and filelist.getServiceRef().type == 4097:
				self.playlist.addFile(x[0][0])
		self.playlist.updateList()
Example #20
0
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        self["key_green"] = Button("Slide Show")
        self["key_yellow"] = Button("Thumb View")
        self["currentfolder"] = Label("")
        self["currentfavname"] = Label("")
        self["actions"] = HelpableActionMap(
            self, "MC_PictureViewerActions", {
                "ok": (self.KeyOk, "Show Picture"),
                "cancel": (self.Exit, "Exit Picture Viewer"),
                "left": (self.leftUp, "List Top"),
                "right": (self.rightDown, "List Bottom"),
                "up": (self.up, "List up"),
                "down": (self.down, "List down"),
                "info": (self.StartExif, "Show File Info"),
                "green": (self.startslideshow, "Start Slideshow"),
                "yellow": (self.StartThumb, "Thumb View"),
                "blue": (self.Settings, "Settings"),
            }, -2)

        self.aspect = getAspect()
        currDir = config.plugins.mc_pp.lastDir.value
        if not pathExists(currDir):
            currDir = "/"
        self["currentfolder"].setText(str(currDir))
        self.filelist = []
        self["filelist"] = []
        inhibitDirs = [
            "/bin", "/boot", "/dev", "/dev.static", "/etc", "/lib", "/proc",
            "/ram", "/root", "/sbin", "/sys", "/tmp", "/usr", "/var"
        ]
        self.filelist = FileList(
            currDir,
            showDirectories=True,
            showFiles=True,
            showMountpoints=True,
            isTop=False,
            matchingPattern="(?i)^.*\.(jpeg|jpg|jpe|png|bmp)",
            inhibitDirs=inhibitDirs)
        self["filelist"] = self.filelist
        self["filelist"].show()
        self["thumbnail"] = Pixmap()
        self.ThumbTimer = eTimer()
        self.ThumbTimer.callback.append(self.showThumb)
        self.ThumbTimer.start(500, True)

        self.picload = ePicLoad()
Example #21
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.session = session
        Screen.setTitle(self, _("FPGA Upgrade"))

        self["key_red"] = StaticText(_("Close"))
        self["key_green"] = StaticText(_("Upgrade"))
        self["key_yellow"] = StaticText(" ")
        self["key_blue"] = StaticText(_("Download"))

        self["status"] = StaticText(" ")
        self["file_list"] = FileList("/", matchingPattern="^.*")

        self["actions"] = ActionMap(
            [
                "OkCancelActions",
                "ShortcutActions",
                "WizardActions",
                "ColorActions",
            ], {
                "red": self.onClickRed,
                "green": self.onClickGreen,
                "blue": self.onClickBlue,
                "back": self.onClickRed,
                "ok": self.onClickOk,
                "up": self.onClickUp,
                "down": self.onClickDown,
                "left": self.onClickLeft,
                "right": self.onClickRight,
            }, -1)
        self.onLayoutFinish.append(self.doLayoutFinish)

        self.ERROR_MSG = ''
        self.ERROR_CODE = 0
        self.SOURCELIST = self["file_list"]
        self.STATUS_BAR = self["status"]
        self.STATUS_BAR.setText(_(self.SOURCELIST.getCurrentDirectory()))

        self.DEVICE_LIST = '/dev/fpga_dp;/dev/dp;/dev/misc/dp;'
        self.DOWNLOAD_TAR_PATH = '/tmp/'
        self.DOWNLOAD_FILE_NAME = 'TS_PRO.dat'
        self.DOWNLOAD_URL = ''
        self.doLoadConf()
        self.FPGA = FPGAUpgradeManager()
        print self.DEVICE_LIST
        print self.DOWNLOAD_TAR_PATH
        print self.DOWNLOAD_FILE_NAME
        print self.DOWNLOAD_URL
Example #22
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ColorActions", "DirectionActions",
                "MenuActions"
            ], {
                "cancel": self.KeyExit,
                "red": self.KeyExit,
                "green": self.KeyGreen,
                "yellow": self.KeyYellow,
                "menu": self.KeyMenu,
                "ok": self.KeyOk
            }, -1)

        self["key_red"] = StaticText(_("Close"))
        self["key_green"] = StaticText(_("Thumbnails"))
        self["key_yellow"] = StaticText("")
        self["label"] = StaticText("")
        self["thn"] = Pixmap()

        currDir = config.pic.lastDir.value
        if not pathExists(currDir):
            currDir = "/"

        self.oldService = self.session.nav.getCurrentlyPlayingServiceReference(
        )
        self.session.nav.stopService()
        # Show Background MVI
        import os
        try:
            os.system("/usr/bin/showiframe /usr/share/enigma2/black.mvi &")
        except:
            pass

        self.filelist = FileList(
            currDir, matchingPattern="(?i)^.*\.(jpeg|jpg|jpe|png|bmp|gif)")
        self["filelist"] = self.filelist
        self["filelist"].onSelectionChanged.append(self.selectionChanged)

        self.ThumbTimer = eTimer()
        self.ThumbTimer.callback.append(self.showThumb)

        self.picload = ePicLoad()
        self.picload.PictureData.get().append(self.showPic)

        self.onLayoutFinish.append(self.setConf)
Example #23
0
	def copyDirectory(self, directory, recursive = True):
		print "copyDirectory", directory
		if directory == '/':
			print "refusing to operate on /"
			return
		filelist = FileList(directory, useServiceRef = True, showMountpoints = False, isTop = True)
		#filelist = FileList(directory, matchingPattern = "(?i)^.*\.(mp2|mp3|ts|wav|wave|m3u|pls|e2pls|mpg|vob|avi|mkv|mp4|m4a|dat|m2ts|wma)", useServiceRef = True, showMountpoints = False, isTop = True)
		
		for x in filelist.getFileList():
			if x[0][1] == True: #isDir
				if recursive:
					if x[0][0] != directory:
						self.copyDirectory(x[0][0])
			else:
				self.playlist.addFile(x[0][0])
		self.playlist.updateList()
Example #24
0
 def __init__(self, session, args = None):
     Screen.__init__(self, session)
     if screenWidth and screenWidth == 1920:
         self.skin = skin_fhd_filelist
     elif screenWidth and screenWidth == 1280:
         self.skin = skin_hd_filelist
     else:
         self.skin = skin_sd_filelist
     self.setTitle(_('Select the image'))
     self.session = session
     hide = ['/bin', '/boot', '/dev', '/dev.static', '/etc', '/lib',
      '/proc', '/ram', '/root', '/sbin', '/sys', '/tmp', '/usr', '/var']
     extensions='(?i)^.*\\.(img|tar|gz|bz2)'
     self['filelist'] = FileList(ConfigDirectory().getValue(), showMountpoints=True, matchingPattern=extensions, inhibitDirs=hide)
     self['actions'] = ActionMap(['WizardActions'], {'ok': self.ok, 'back': self.back, 'up': self.up,
      'down': self.down, 'left': self.left, 'right': self.right}, -1)
Example #25
0
    def __init__(self,
                 session,
                 showDirectories=True,
                 showFiles=True,
                 showMountpoints=True,
                 matchingPattern=None,
                 useServiceRef=False,
                 inhibitDirs=False,
                 inhibitMounts=False,
                 isTop=False,
                 enableWrapAround=False,
                 additionalExtensions=None,
                 closeOnSelection=False):
        Screen.__init__(self, session)
        self.skinName = "FileBrowser_Generic"

        defaultDir = None  # TODO Fix / Config value
        self._closeOnSelection = closeOnSelection
        self._filelist = FileList(defaultDir,
                                  showDirectories=showDirectories,
                                  showFiles=showFiles,
                                  showMountpoints=showMountpoints,
                                  matchingPattern=matchingPattern,
                                  useServiceRef=useServiceRef,
                                  inhibitDirs=inhibitDirs,
                                  inhibitMounts=inhibitMounts,
                                  isTop=isTop,
                                  enableWrapAround=enableWrapAround,
                                  additionalExtensions=additionalExtensions)

        self["filelist"] = self._filelist
        self["status"] = MultiColorLabel("")

        self["key_green"] = Button(_("Add"))
        self["green"] = Pixmap()

        self["actions"] = ActionMap(
            ["ListboxActions", "OkCancelActions", "ColorActions"], {
                "ok": self.ok,
                "cancel": self.close,
                "moveUp": self.moveUp,
                "moveDown": self.moveDown,
                "pageUp": self.pageUp,
                "pageDown": self.pageDown,
                "green": self.selectCurrent,
            })
        self.onShown.append(self._onShown)
Example #26
0
    def __init__(self,
                 session,
                 startdir,
                 message="",
                 showDirectories=True,
                 showFiles=True,
                 showMountpoints=True,
                 matchingPattern="",
                 useServiceRef=False,
                 inhibitDirs=False,
                 inhibitMounts=False,
                 isTop=False,
                 enableWrapAround=False,
                 additionalExtensions=None):
        Screen.__init__(self, session)

        HelpableScreen.__init__(self)
        Screen.setTitle(self, _("Please select medium"))

        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText()
        self["message"] = StaticText(message)

        self.filelist = FileList(startdir,
                                 showDirectories=showDirectories,
                                 showFiles=showFiles,
                                 showMountpoints=showMountpoints,
                                 matchingPattern=matchingPattern,
                                 useServiceRef=useServiceRef,
                                 inhibitDirs=inhibitDirs,
                                 inhibitMounts=inhibitMounts,
                                 isTop=isTop,
                                 enableWrapAround=enableWrapAround,
                                 additionalExtensions=additionalExtensions)
        self["filelist"] = self.filelist

        self["FilelistActions"] = ActionMap(
            ["SetupActions", "ColorActions"], {
                "green": self.use,
                "red": self.exit,
                "ok": self.ok,
                "cancel": self.exit
            })

        hotplugNotifier.append(self.hotplugCB)
        self.onShown.append(self.updateButton)
        self.onClose.append(self.removeHotplug)
    def setupSkin(self):
        self.skin = None
        InitSkin(self)

        self['menu_list'] = FileList(self.initDir,
                                     inhibitMounts=False,
                                     inhibitDirs=False,
                                     showMountpoints=False,
                                     showFiles=False)
        self['menu_list'].show()
        self['title'].hide()
        self['path'].show()

        self['text_red'].setText("Verzeichnis löschen")
        self['text_green'].setText("Speichern")
        self['text_ok'].setText("Auswahl")
        self['text_yellow'].setText("Zurücksetzen")
        self['text_blue'].setText("Verzeichnis anlegen")

        self.num_bt_text = ([buttonText_na, buttonText_na, "Abbrechen"], [
            buttonText_na, buttonText_na, buttonText_na
        ], [buttonText_na, buttonText_na,
            buttonText_na], [buttonText_na, buttonText_na, "Hilfe"],
                            [buttonText_na, buttonText_na, buttonText_na])

        if not config.plugins.serienRec.showAllButtons.value:
            self['text_0'].setText("Abbrechen")
            self['text_1'].setText("About")

            self['bt_red'].show()
            self['bt_green'].show()
            self['bt_ok'].show()
            self['bt_yellow'].show()
            self['bt_blue'].show()
            self['bt_exit'].show()
            self['bt_text'].show()

            self['text_red'].show()
            self['text_green'].show()
            self['text_ok'].show()
            self['text_yellow'].show()
            self['text_blue'].show()
            self['text_0'].show()
            self['text_1'].show()
            self['text_2'].show()
            self['text_3'].show()
            self['text_4'].show()
Example #28
0
    def __init__(self, session):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)
        #		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
        #		self.session.nav.stopService()
        self["key_red"] = Button(_("Favorites"))
        self["key_yellow"] = Button("")
        self["key_blue"] = Button(_("Settings"))
        self["currentfolder"] = Label("")
        self["currentfavname"] = Label("")
        self.curfavfolder = -1

        self["actions"] = HelpableActionMap(
            self, "MC_VideoPlayerActions", {
                "ok": (self.KeyOk, "Play selected file"),
                "cancel": (self.Exit, "Exit Video Player"),
                "left": (self.leftUp, "List Top"),
                "right": (self.rightDown, "List Bottom"),
                "up": (self.up, "List up"),
                "down": (self.down, "List down"),
                "menu": (self.KeyMenu, "File / Folder Options"),
                "info": (self.showFileInfo, "Show File Info"),
                "nextBouquet": (self.NextFavFolder, "Next Favorite Folder"),
                "prevBouquet":
                (self.PrevFavFolder, "Previous Favorite Folder"),
                "red": (self.FavoriteFolders, "Favorite Folders"),
                "blue": (self.KeySettings, "Settings"),
            }, -2)
        self.aspect = getAspect()
        currDir = config.plugins.mc_vp.lastDir.value
        if not pathExists(currDir):
            currDir = "/"
        self["currentfolder"].setText(str(currDir))
        self.filelist = FileList(
            currDir,
            useServiceRef=True,
            showDirectories=True,
            showFiles=True,
            matchingPattern=
            "(?i)^.*\.(ts|vob|mpg|mpeg|avi|mkv|dat|iso|mp4|flv|divx)")
        self["filelist"] = self.filelist
        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={
                iPlayableService.evUser + 11: self.__evDecodeError,
                iPlayableService.evUser + 12: self.__evPluginError
            })
Example #29
0
    def __init__(self, session, scope, configRef):
        Screen.__init__(self, session)
        # for the skin: first try FileBrowser_DVDBurn, then FileBrowser, this allows individual skinning
        self.skinName = ["FileBrowser_DVDBurn", "FileBrowser"]

        HelpableScreen.__init__(self)
        self.scope = scope
        pattern = ""
        self.configRef = configRef
        currDir = "/"
        if self.scope == "project":
            currDir = self.getDir()
            pattern = "(?i)^.*\.(ddvdp\.xml)"
        elif self.scope == "menutemplate":
            currDir = self.getDir()
            pattern = "(?i)^.*\.(ddvdm\.xml)"
        if self.scope == "menubg":
            currDir = self.getDir(configRef.getValue())
            pattern = "(?i)^.*\.(jpeg|jpg|jpe|png|bmp)"
        elif self.scope == "menuaudio":
            currDir = self.getDir(configRef.getValue())
            pattern = "(?i)^.*\.(mp2|m2a|ac3)"
        elif self.scope == "vmgm":
            currDir = self.getDir(configRef.getValue())
            pattern = "(?i)^.*\.(mpg|mpeg)"
        elif self.scope == "font_face":
            currDir = self.getDir(configRef.getValue(),
                                  resolveFilename(SCOPE_FONTS))
            pattern = "(?i)^.*\.(ttf)"
        elif self.scope == "isopath":
            currDir = configRef.getValue()
        elif self.scope == "image":
            currDir = resolveFilename(SCOPE_HDD)
            pattern = "(?i)^.*\.(iso)"

        self.filelist = FileList(currDir, matchingPattern=pattern)
        self["filelist"] = self.filelist

        self["FilelistActions"] = ActionMap(["SetupActions"], {
            "save": self.ok,
            "ok": self.ok,
            "cancel": self.exit
        })
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))
        self.onLayoutFinish.append(self.layoutFinished)
Example #30
0
	def __init__(self, session, currDir):
		Screen.__init__(self, session)
		self.skinName = ["EMCFileBrowser"]
		HelpableScreen.__init__(self)
		self["cancel"] = Button(_("Cancel"))
		self["open"] = Button(_("Open"))
		self.filelist = FileList(currDir, showFiles=True, matchingPattern=".(e2pls|m3u)")
		self["filelist"] = self.filelist
		self.lastDir = currDir
		self["FilelistActions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"green": self.use,
				"red": self.exit,
				"ok": self.ok,
				"cancel": self.exit
			})
		self.onLayoutFinish.append(self.layoutFinished)