Skip to content

Commit

Permalink
Plugins/Extensions/MediaScanner py3
Browse files Browse the repository at this point in the history
  • Loading branch information
tony whalley authored and Huevos committed Apr 12, 2021
1 parent 5d7b9f4 commit f4606e9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
16 changes: 10 additions & 6 deletions lib/python/Plugins/Extensions/PicturePlayer/plugin.py
@@ -1,25 +1,29 @@
from Plugins.Plugin import PluginDescriptor
from __future__ import print_function
from __future__ import absolute_import

from enigma import getDesktop
from Plugins.Plugin import PluginDescriptor

#------------------------------------------------------------------------------------------

def Pic_Thumb(*args, **kwa):
import ui
from . import ui
return ui.Pic_Thumb(*args, **kwa)

def picshow(*args, **kwa):
import ui
from . import ui
return ui.picshow(*args, **kwa)

def main(session, **kwargs):
from ui import picshow
from .ui import picshow
session.open(picshow)

def filescan_open(list, session, **kwargs):
# Recreate List as expected by PicView
filelist = [((file.path, False), None) for file in list]
from ui import Pic_Full_View
session.open(Pic_Full_View, filelist, 0, file.path)
from .ui import Pic_Full_View
p = filelist[0][0][0]
session.open(Pic_Full_View, filelist, 0, p)

def filescan(**kwargs):
from Components.Scanner import Scanner, ScanPath
Expand Down
24 changes: 13 additions & 11 deletions lib/python/Plugins/Extensions/PicturePlayer/ui.py
@@ -1,3 +1,5 @@
from __future__ import print_function

from boxbranding import getMachineBrand

from enigma import ePicLoad, eTimer, getDesktop, gMainDC, eSize
Expand Down Expand Up @@ -87,7 +89,7 @@ def showPic(self, picInfo=""):
self["thn"].instance.setPixmap(ptr.__deref__())
self["thn"].show()

text = picInfo.split('\n',1)
text = picInfo.split('\n', 1)
self["label"].setText(text[1])
self["key_yellow"].setText(_("Exif"))

Expand Down Expand Up @@ -239,7 +241,7 @@ def __init__(self, session, exiflist):
exifdesc = [_("filename")+':', "EXIF-Version:", "Make:", "Camera:", "Date/Time:", "Width / Height:", "Flash used:", "Orientation:", "User Comments:", "Metering Mode:", "Exposure Program:", "Light Source:", "CompressedBitsPerPixel:", "ISO Speed Rating:", "X-Resolution:", "Y-Resolution:", "Resolution Unit:", "Brightness:", "Exposure Time:", "Exposure Bias:", "Distance:", "CCD-Width:", "ApertureFNumber:"]
list = []

for x in range(len(exiflist)):
for x in list(range(len(exiflist))):
if x>0:
list.append((exifdesc[x], exiflist[x]))
else:
Expand All @@ -264,7 +266,7 @@ def __init__(self, session, piclist, lastindex, path):

self.textcolor = config.pic.textcolor.value
self.color = config.pic.bgcolor.value
self.spaceX, self.picX, self.spaceY, self.picY, textsize, thumtxt = skin.parameters.get("PicturePlayerThumb",(35, 190, 30, 200, 20, 14))
self.spaceX, self.picX, self.spaceY, self.picY, textsize, thumtxt = skin.parameters.get("PicturePlayerThumb", (35, 190, 30, 200, 20, 14))

pic_frame = resolveFilename(SCOPE_ACTIVE_SKIN, "icons/pic_frame.png")

Expand All @@ -278,7 +280,7 @@ def __init__(self, session, piclist, lastindex, path):
skincontent = ""

posX = -1
for x in range(self.thumbsC):
for x in list(range(self.thumbsC)):
posY = x / self.thumbsX
posX += 1
if posX >= self.thumbsX:
Expand Down Expand Up @@ -311,7 +313,7 @@ def __init__(self, session, piclist, lastindex, path):
}, -1)

self["frame"] = MovingPixmap()
for x in range(self.thumbsC):
for x in list(range(self.thumbsC)):
self["label"+str(x)] = StaticText()
self["thumb"+str(x)] = Pixmap()

Expand Down Expand Up @@ -369,7 +371,7 @@ def paintFrame(self):
def newPage(self):
self.Thumbnaillist = []
#clear Labels and Thumbnail
for x in range(self.thumbsC):
for x in list(range(self.thumbsC)):
self["label"+str(x)].setText("")
self["thumb"+str(x)].hide()
#paint Labels and fill Thumbnail-List
Expand All @@ -382,7 +384,7 @@ def newPage(self):
self.showPic()

def showPic(self, picInfo=""):
for x in range(len(self.Thumbnaillist)):
for x in list(range(len(self.Thumbnaillist))):
if self.Thumbnaillist[x][0] == 0:
if self.picload.getThumbnail(self.Thumbnaillist[x][2]) == 1: #zu tun probier noch mal
self.ThumbTimer.start(500, True)
Expand Down Expand Up @@ -554,7 +556,7 @@ def finish_decode(self, picInfo=""):
if ptr is not None:
text = ""
try:
text = picInfo.split('\n',1)
text = picInfo.split('\n', 1)
text = "(" + str(self.index+1) + "/" + str(self.maxentry+1) + ") " + text[0].split('/')[-1]
except:
pass
Expand All @@ -568,7 +570,7 @@ def start_decode(self):
self.picload.startDecode(self.filelist[self.index])
self["point"].show()

def next(self):
def __next__(self):
self.index += 1
if self.index > self.maxentry:
self.index = 0
Expand All @@ -579,8 +581,8 @@ def prev(self):
self.index = self.maxentry

def slidePic(self):
print "slide to next Picture index=" + str(self.lastindex)
if config.pic.loop.value==False and self.lastindex == self.maxentry:
print("slide to next Picture index=" + str(self.lastindex))
if config.pic.loop.value == False and self.lastindex == self.maxentry:
self.PlayPause()
self.shownow = True
self.ShowPicture()
Expand Down

0 comments on commit f4606e9

Please sign in to comment.