@@ -769,9 +769,9 @@ def __init__(self, session=None, subsPath=None, defaultPath=None, forceDefaultPa
769
769
770
770
self .onClose .append (self .exitSubs )
771
771
772
- if defaultPath is not None and os .path .isdir (toString ( defaultPath ) ):
773
- self .__defaultPath = toString ( defaultPath )
774
- self .__subsDir = toString ( defaultPath )
772
+ if defaultPath is not None and os .path .isdir (defaultPath ):
773
+ self .__defaultPath = defaultPath
774
+ self .__subsDir = defaultPath
775
775
776
776
if subsPath is not None and self .__autoLoad :
777
777
self .loadSubs (subsPath )
@@ -791,7 +791,6 @@ def loadSubs(self, subsPath, newService=True):
791
791
self .__subsDir = None
792
792
793
793
if subsPath is not None :
794
- subsPath = toString (subsPath )
795
794
if not subsPath .startswith ('http' ):
796
795
if self .__defaultPath is not None and self .__forceDefaultPath :
797
796
self .__subsDir = self .__defaultPath
@@ -1458,7 +1457,7 @@ def setSubtitle(self, sub):
1458
1457
if color == "default" :
1459
1458
color = self .font [sub ['style' ]]['color' ]
1460
1459
self .setColor (color )
1461
- self ["subtitles" ].setText (toString ( sub ['text' ]) )
1460
+ self ["subtitles" ].setText (sub ['text' ])
1462
1461
self .subShown = True
1463
1462
1464
1463
def hideSubtitle (self ):
@@ -1910,7 +1909,7 @@ def initSubInfo(self):
1910
1909
self ["subfile_label" ].setText (_ ("Embedded Subtitles" ))
1911
1910
self ["subfile_label" ].instance .setForegroundColor (parseColor ("#ffff00" ))
1912
1911
elif self .subfile is not None :
1913
- self ["subfile_label" ].setText (toString ( os .path .split (self .subfile )[1 ]) )
1912
+ self ["subfile_label" ].setText (os .path .split (self .subfile )[1 ])
1914
1913
self ["subfile_label" ].instance .setForegroundColor (parseColor ("#DAA520" ))
1915
1914
1916
1915
if self .newSelection :
@@ -2244,9 +2243,9 @@ def buildMenu(self):
2244
2243
def FileEntryComponent (name , absolute = None , isDir = False ):
2245
2244
res = [(absolute , isDir )]
2246
2245
if isFullHD ():
2247
- res .append ((eListboxPythonMultiContent .TYPE_TEXT , 35 , 1 , 770 , 30 , 1 , RT_HALIGN_LEFT , toString ( name ) ))
2246
+ res .append ((eListboxPythonMultiContent .TYPE_TEXT , 35 , 1 , 770 , 30 , 1 , RT_HALIGN_LEFT , name ))
2248
2247
else :
2249
- res .append ((eListboxPythonMultiContent .TYPE_TEXT , 35 , 1 , 570 , 30 , 0 , RT_HALIGN_LEFT , toString ( name ) ))
2248
+ res .append ((eListboxPythonMultiContent .TYPE_TEXT , 35 , 1 , 570 , 30 , 0 , RT_HALIGN_LEFT , name ))
2250
2249
if isDir :
2251
2250
png = LoadPixmap (resolveFilename (SCOPE_CURRENT_SKIN , "extensions/directory.png" ))
2252
2251
else :
@@ -2579,7 +2578,7 @@ class InfoScreen(Screen):
2579
2578
2580
2579
def __init__ (self , session , subtitle ):
2581
2580
Screen .__init__ (self , session )
2582
- self ["path" ] = StaticText (_ (toString ( subtitle ['fpath' ]) ))
2581
+ self ["path" ] = StaticText (_ (subtitle ['fpath' ]))
2583
2582
2584
2583
skin = """
2585
2584
<screen position="center,center" size="700,520" zPosition="3" resolution="1280,720">
@@ -2662,14 +2661,14 @@ def updateSubsList(self):
2662
2661
imgDict = {'unk' : loadPNG (os .path .join (os .path .dirname (__file__ ), 'img' , 'countries' , 'UNK.png' ))}
2663
2662
subtitleListGUI = []
2664
2663
for sub in self .subtitles [:]:
2665
- fpath = toString ( sub ['fpath' ])
2664
+ fpath = sub ['fpath' ]
2666
2665
if not os .path .isfile (fpath ):
2667
2666
self .subtitles .remove (sub )
2668
2667
continue
2669
2668
if sub .get ('country' , 'unk' ) not in imgDict :
2670
2669
countryImgPath = os .path .join (os .path .dirname (__file__ ), 'img' , 'countries' , sub ['country' ] + '.png' )
2671
2670
if os .path .isfile (countryImgPath ):
2672
- imgDict [sub ['country' ]] = loadPNG (toString ( countryImgPath ) )
2671
+ imgDict [sub ['country' ]] = loadPNG (countryImgPath )
2673
2672
countryPng = imgDict [sub ['country' ]]
2674
2673
else :
2675
2674
countryPng = imgDict ['unk' ]
@@ -2679,7 +2678,7 @@ def updateSubsList(self):
2679
2678
color = 0xffffff
2680
2679
date = datetime .fromtimestamp (os .path .getctime (fpath )).strftime ("%d-%m-%Y %H:%M" )
2681
2680
name = os .path .splitext (os .path .basename (fpath ))[0 ]
2682
- subtitleListGUI .append ((countryPng , toString ( name ), toString ( sub ['provider' ]) , date , color ),)
2681
+ subtitleListGUI .append ((countryPng , name , sub ['provider' ], date , color ),)
2683
2682
imgDict = None
2684
2683
self ['subtitles' ].list = subtitleListGUI
2685
2684
@@ -2719,14 +2718,14 @@ def removeEntryCB(doRemove=False):
2719
2718
subtitle = self .subtitles [self ["subtitles" ].index ]
2720
2719
if self .historySettings .removeAction .value == 'file' :
2721
2720
if self .historySettings .removeActionAsk .value :
2722
- message = _ ("Subtitle" ) + " '" + toString ( subtitle ['name' ]) + "' " + _ ("will be removed from file system" )
2721
+ message = _ ("Subtitle" ) + " '" + subtitle ['name' ] + "' " + _ ("will be removed from file system" )
2723
2722
message += "\n \n " + _ ("Do you want to proceed?" )
2724
2723
self .session .openWithCallback (removeEntryCB , MessageBox , message , type = MessageBox .TYPE_YESNO )
2725
2724
else :
2726
2725
removeEntryCB (True )
2727
2726
else :
2728
2727
if self .historySettings .removeActionAsk .value :
2729
- message = _ ("Subtitle" ) + " '" + toString ( subtitle ['name' ]) + "' " + _ ("will be removed from list" )
2728
+ message = _ ("Subtitle" ) + " '" + subtitle ['name' ] + "' " + _ ("will be removed from list" )
2730
2729
message += "\n \n " + _ ("Do you want to proceed?" )
2731
2730
self .session .openWithCallback (removeEntryCB , MessageBox , message , type = MessageBox .TYPE_YESNO )
2732
2731
else :
@@ -3115,7 +3114,7 @@ def __init__(self, session, title, configTextWithSuggestions, positionX, titleCo
3115
3114
Screen .__init__ (self , session )
3116
3115
self .list = []
3117
3116
self ["suggestionslist" ] = List (self .list )
3118
- self ["suggestionstitle" ] = StaticText (toString ( title ) )
3117
+ self ["suggestionstitle" ] = StaticText (title )
3119
3118
self .configTextWithSuggestion = configTextWithSuggestions
3120
3119
3121
3120
def update (self , suggestions ):
@@ -3126,7 +3125,7 @@ def update(self, suggestions):
3126
3125
suggestions .reverse ()
3127
3126
self .list = []
3128
3127
for s in suggestions :
3129
- self .list .append ((toString ( s ['name' ]) ,))
3128
+ self .list .append ((s ['name' ],))
3130
3129
self ["suggestionslist" ].setList (self .list )
3131
3130
self ["suggestionslist" ].setIndex (0 )
3132
3131
print (suggestions )
@@ -3570,15 +3569,15 @@ def editFnameCB(callback=None):
3570
3569
self .buildMenu ()
3571
3570
self .updateFName ()
3572
3571
from Screens .VirtualKeyBoard import VirtualKeyBoard
3573
- self .session .openWithCallback (editFnameCB , VirtualKeyBoard , _ ("Edit Filename" ), text = toString ( self .fname .strip () ))
3572
+ self .session .openWithCallback (editFnameCB , VirtualKeyBoard , _ ("Edit Filename" ), text = self .fname .strip ())
3574
3573
3575
3574
def editDPath (self ):
3576
3575
def editDPathCB (callback = None ):
3577
3576
if callback is not None and len (callback ):
3578
3577
self .dpath = callback
3579
3578
self .configSaveTo .value = "custom"
3580
3579
self ["config" ].invalidate (self .configSaveTo )
3581
- self .session .openWithCallback (editDPathCB , LocationBox , _ ("Edit download path" ), currDir = toString ( self .dpath .strip () ))
3580
+ self .session .openWithCallback (editDPathCB , LocationBox , _ ("Edit download path" ), currDir = self .dpath .strip ())
3582
3581
3583
3582
def confirm (self ):
3584
3583
if not self .fname .strip ():
@@ -3670,7 +3669,7 @@ def left(self):
3670
3669
self ["context_menu" ].selectPrevious ()
3671
3670
3672
3671
def updateGUI (self , subtitle , options ):
3673
- self ["subtitle_release" ].text = toString ( subtitle ['filename' ])
3672
+ self ["subtitle_release" ].text = subtitle ['filename' ]
3674
3673
self ["context_menu" ].list = [(o [0 ],) for o in options ]
3675
3674
self .options = options
3676
3675
@@ -3933,8 +3932,8 @@ def updateSubsList(self): # TODO get country imgages from default skin
3933
3932
else :
3934
3933
countryPng = imgDict ['unk' ]
3935
3934
syncPng = sync and imgDict ['sync' ] or None
3936
- subtitleListGUI .append ((countryPng , _ (toString ( sub ['language_name' ]) ),
3937
- toString ( sub ['filename' ]), toString ( sub ['provider' ]) , syncPng ),)
3935
+ subtitleListGUI .append ((countryPng , _ (sub ['language_name' ]),
3936
+ sub ['filename' ], sub ['provider' ], syncPng ),)
3938
3937
imgDict = None
3939
3938
self ['subtitles' ].list = subtitleListGUI
3940
3939
@@ -4194,7 +4193,7 @@ def delayCB(seconds, resultCB):
4194
4193
SubsSearchProcess ().start (params , callbacks )
4195
4194
4196
4195
def downloadSubsSuccess (self , subFile ):
4197
- print ('[SubsSearch] download success %s' % toString ( subFile ) )
4196
+ print ('[SubsSearch] download success %s' % subFile )
4198
4197
dsubtitle = {
4199
4198
"name" : toUnicode (os .path .basename (subFile )),
4200
4199
"country" : toUnicode (self .__downloadingSubtitle ['country' ]),
@@ -4509,7 +4508,7 @@ def updateProvidersList(self):
4509
4508
else :
4510
4509
providerState = _ ("disabled" )
4511
4510
providerStateColor = 0xffff00
4512
- providerListGUI .append ((toString ( providerName ) , providerLangs , providerState , providerStateColor ))
4511
+ providerListGUI .append ((providerName , providerLangs , providerState , providerStateColor ))
4513
4512
self ['providers' ].list = providerListGUI
4514
4513
4515
4514
def setConfigFocus (self ):
@@ -4938,7 +4937,7 @@ def removeSuggestionWindows(self):
4938
4937
4939
4938
class SubsSearchProviderMenu (BaseMenuScreen ):
4940
4939
def __init__ (self , session , provider ):
4941
- title = toString ( provider .provider_name ) + " " + _ ("settings" )
4940
+ title = provider .provider_name + " " + _ ("settings" )
4942
4941
BaseMenuScreen .__init__ (self , session , title )
4943
4942
self .provider = provider
4944
4943
0 commit comments