[c91031]: script.xbmc.subtitles / default.py Maximize Restore History

Download this file

default.py    64 lines (47 with data), 2.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import sys
import os
import xbmc
import string
__scriptname__ = "XBMC Subtitles"
__scriptid__ = "script.xbmc.subtitles"
__author__ = "Amet"
__url__ = "http://code.google.com/p/xbmc-subtitles/"
__credits__ = ""
__version__ = "1.60b"
__XBMC_Revision__ = "28764"
if not xbmc.getCondVisibility('Player.Paused') : xbmc.Player().pause() #Pause if not paused
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( os.getcwd(), 'resources', 'lib' ) )
sys.path.append (BASE_RESOURCE_PATH)
__language__ = xbmc.Language( os.getcwd() ).getLocalizedString
_ = sys.modules[ "__main__" ].__language__
__settings__ = xbmc.Settings( id=__scriptid__ )
#############-----------------Is script runing from OSD? -------------------------------###############
if not xbmc.getCondVisibility('videoplayer.isfullscreen') :
__settings__.openSettings()
if xbmc.getCondVisibility('Player.Paused'): xbmc.Player().pause() # if Paused, un-pause
else:
skin = "main"
skin1 = str(xbmc.getSkinDir().lower())
skin1 = skin1.replace("-"," ")
skin1 = skin1.replace("."," ")
skin1 = skin1.replace("_"," ")
if ( skin1.find( "eedia" ) > -1 ):
skin = "MiniMeedia"
elif ( skin1.find( "tream" ) > -1 ):
skin = "MediaStream"
elif ( skin1.find( "edux" ) > -1 ):
skin = "MediaStream_Redux"
elif ( skin1.find( "aeon" ) > -1 ):
skin = "Aeon"
elif ( skin1.find( "alaska" ) > -1 ):
skin = "Alaska"
elif ( skin1.find( "confluence" ) > -1 ):
skin = "confluence"
print " XBMC Subtitles version [ %s ]\nSkin Folder: [ %s ]\nXBMC Subtitles skin XML: [ %s ]" % (__version__,skin1,skin,)
if ( __name__ == "__main__" ):
import gui
ui = gui.GUI( "script-XBMC-Subtitles-%s.xml" % skin , os.getcwd(), "Default")
ui.doModal()
if xbmc.getCondVisibility('Player.Paused'): xbmc.Player().pause() # if Paused, un-pause
del ui
sys.modules.clear()