PK L # script.skinshortcuts/.gitattributes# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
PK 'Mu script.skinshortcuts/addon.xml
Template improvements and bug fixesДобавка за облици, която осигурява просто управление и списък с потребителски преки пътища (изисква поддръжка от облика)Add-on für Skins für einfache Bearbeitung und Auflistung von benutzerdefinierten Verknüpfungen (erfordert Skin-Unterstützung)Πρόσθετο για κελύφη, το οποίο παρέχει έναν απλό τρόπο διαχείρισης και κατηγοριοποίησης των συντομεύσεων του χρήστη (πρέπει να υποστηρίζεται από το κέλυφος)Add-on for skins to provide simple managing and listing of user shortcuts (requires skin support)Add-on for skins to provide simple managing and listing of user shortcuts (requires skin support)Add-on for skins to provide simple managing and listing of user shortcuts (requires skin support)Complemento para las pieles para proporcionar una gestión sencilla y lista de atajos de usuario (requiere que la piel lo soporte)Addiciel pour habillages qui fournit une gestion simple et un listage des raccourcis utilisateurs (exige la prise en charge de l'habillage)Complemento que fornece aos temas dunha xestión sinxela dos atallos dos usuarios (require soporte do tema)Dodatak za presvlake koja omogućava jednostavno upravljanje i prikaz korisnikovih prečaca (zahtijeva podršku presvlake) Felszín kiegészítő amely könnyen kezelhetővé és listázhatóvá teszi a felhasználói parancsikonokat (Felszín támogatás szükséges)Viðbót fyrir viðmót til að halda utan um flýtivísa og fá yfirlit yfir þá (þarfnast stuðnings frá viðmóti)Add-on per gli skin per consentire un facile gestione ed elenco delle scorciatoie utente (richiede che lo skin lo supporti)Priedas teminėms išvaizdoms, kad jos turėtų galimybę paprastai tvarkyti ir atvaizduoti vartotojo sukurtas nuorodas (reikalingas teminės išvaizdos palaikymas)Add-on voor skins om te voorzien in het eenvoudig beheren en sorteren van gebruikers snelkoppelingen (vereist skin ondersteuning)Tillegg for enkel administrering og opplisting av bruker-snarveier i tema (krever støtte i tema)Wtyczka dla skór, która zapewnia proste zarządzanie i tworzenie list skrótów użytkownika (wymaga wsparcia skóry)Um add-on que permite que os temas tenham recursos simples para gerir e listar atalhos de utilizadores (é necessário suporte do tema)Add-on para que as skins possam prover gerenciamento de lista de atalhos para o menu principal (requer suporte da skin)Дополнение для обложек, предоставляющее простой способ управления списками пользовательских ярлыков (требуется поддержка обложкой)Skinntillägg som tillhandahåller enkel hantering och översikt av användargenvägar (om skinnet stöder det)插件为皮肤提供了简单的管理和用户连接方式列表 (需要皮肤支持)allGNU General Public License, v2http://forum.xbmc.org/showthread.php?tid=178294nkvoronov@gmail.comicon.pngfanart.jpg
PK L!$ $ " script.skinshortcuts/changelog.txtv1.0.13
- Fix for context menu add-on
- Remove SuperFavourites workaround
- Honour skin warnings when disabling a menu item
- Switch to using new Kodi Log Uploader on menu build/save failure
- Various PVR visibility updates
- Adjust processing of visibilityoverrides so that other overrides are then applied to them
- Template improvements
- Minor fixes, including to loading additional submenu's
v1.0.10
- Support context menu in management dialog (Krypton only)
- Support disabling menu items
- Icons for all available shortcuts
- Krypton changes and fixes
- Icon overrides now respected for available shortcut nodes
- Only build main menu into single mode include
- Minor fixes
v1.0.8
- Ability to set item properties from outside management dialog
- Ability for skin to specify it doesn't share menu's
- Ability to specify single/multi background browse options
- Ability to specify 'none' option for thumbnails
- New 'visibleoverride'
- New 'noGroups' build option
- Template improvements
- Automatically add a reload parameter to GUI 312 selected widgets
- Minor fixes
v1.0.7
- Krypton support
- More accurately display build progress
- Additional properties available via window properties in management dialog
- Fix for add-on shortcut visibility conditions
v1.0.6
- Option not to share menus between skins; never hide PVR shortcuts
- Icons and thumbs are saved on a per-skin basis
- mtime of files is used to determine if they have changed
- New icon element for background overrides
- Support building variables in templates
- Add conditional custom property fallback override
- Add requires and templateOnly elements to properties
- Various language changes
- Speed improvements
- Minor fixes
v1.0.2
- Fix for music addon shortcuts on Isengard
- New artwork - thanks schimi2k
- Template improvements
- Management dialog improvements
- Minor fixes
v1.0.0
- Enable 'Get More...' installation of widget providers
- Return to using json to enable/disable Kodi debug logging
- Jarvis shortcut changes
- Load skin-playlists from subdirectories
- Ability to set custom property fallback value
- Cleanup
- Minor fixes
v0.6.6
- Template improvements
- Widget selection improvements
- Custom property selection improvements
- Fix properties being applied to wrong profile
- Just Select Widget method
- [aqab0N] Unicode fix
- Ability to restore deleted shortcut via 308
- Global override adjustments
- Fix clonebackground/clonewidgets; add cloneproperties
- [tomer953] Remove requirement for ::ACTION:: in action override to be the only text in element
- [tomer953] Management dialog - Insert new menu in the current location instead of add them at the end
- [tomer953] RTL Support - reverse string before inserting them to the keyboard dialog as a workaround to a kodi bug.
- Minor bug fixes
v0.6.0
- Version bump for Isengard repo.
v0.5.4
- Rollback for Helix repo - fixes incompatiblitly with some Helix skins.
v0.5.3
- [HitcherUK] Add shutdown timer functions
- Support for conditional group overrides
- [bambi73] Add default thumbnail browse option
- [bambi73] Add support for
- Templates
- Path property for using shortcut as widgets
- Switch to audio nodes for Isengard
- Change action function
- New widget selection options
- Global overrides
- [roee88] Unicode fixes
- Speed improvements
- Minor bug fixes
v0.4.5
- [marcelveldt] fixed issues with assign thumbnail dialog.
v0.4.4
- [phate89] Use files.getDirectory to list playlists
- Just Select method - option to show 'None'
- New management dialog button 311 - select from defined thumbnails
- Conditions for available widgets and backgrounds
- Ability to check for shortcuts
- Speed improvements loading management dialog
- Fixes
- Updated language files from Transifex (from 8th December 2014)
v0.4.2
- [robweber] Fix for profiles shared via path substitution
- Integration with plugin.program.video.node.editor
- Change how submenuVisibility property is generated
- Skin and script default shortcuts now loaded from defaultID property
- Ability to set background and widget defaults based on defaultID
- Ability to skip warning when resetting all shortcuts
- Skin settings set to identify which backgrounds and widgets have been selected by user
- Window property to identify when additional management dialog has been launched
- Custom visibility properties are now honoured by management dialog
- Shortcuts always use video nodes (where appropriate) rather than library links
- Updated language files from Transifex (from 19th October 2014)
v0.4.0
- New localisation code
- New XML data store
- Removal of Gotham list-filling methods
- [bambi73] - Ability to replace label with widgetName
- Ability to create shortcuts to library sources not showing content from source selected
- Ability to choose random version of auto-generated source playlists as widget or background
- Ability to clone widget and background properties from main menu to submenu items
- Ability to force Settings link in menu
- Ability to return thumbnail as icon for available shortcuts
- New management dialog controls to show management dialog for additional sub-menus
- New available shortcut grouping - picture sources
- Improved labelID's for add-ons
- Indicator for default background and widget
- Menu rebuilt on changes to script-skinshortcuts-includes.xml file
- Auto-enable debug logging and offer to upload debug log on menu build failure (requires XBMC Log Uploader on system)
- Code cleanup
- Fixes
> Fix for setting skin thumbnail property when using Just Select method
> Fix for menus failing to build when the action for a shortcut contains a unicode character
> Dirty fix for situations where a playlist in a menu will cause that menu to appear empty
> Return skin playlists via special:// protocol (current skin only)
- Updated language files from Transifex (from 11th June 2014)
v0.3.4
- XML files are formatted (includes.xml, auto-generated playlists), includes now have an id property
- New 'Settings' available shortcut grouping
- Ability to override available shortcuts type, widget type
- Ability to build main menu and standalone menus
- A couple of small fixes and improvements
- Fix: Work around XBMC translating numering labelID's to their localised string, causing sub-menus not to show
v0.3.3
- Available shortcuts in management dialog improvements:
> Improved and customisable groupings
> Control over location and visibility of skin-provided shortcuts
> UPnP and video sources explorer, including linking to library limited-by-source
> More PVR options including playing individual channels
> When using select dialog, now displays label2's and thumbnails
> Correct thumbnail/icon usage
> Addition of skin-required shortcuts which can't be deleted
> Ability to warn user before deleting shortcuts to select actions
- Improved labelID generation
- Add option to tell management dialog not to fill label's on management dialog controls, additional label 500 for window title
- Ability to override shortcut actions based on XBMC version
- Skinners can now only override icons, not thumbnails
- Fix for crash when no profiles.xml file
- Fix for single-list xml method to return to main menu item when hiding submenu
- Fix for action sometimes not showing in label2 in management dialog
- Updated language files from Transifex
v0.3.1
- Fixes: No favourites showing in management dialog
Script crash on choosing empty group in skin-managed selection dialog
Remove visibility condition for Eject Tray shortcut
v0.3.0
- Fix escaping of main menu items (includes method)
- Fix for custom nodes when using profiles
- Fix for includes method when using multiple profiles
- Load skin-provided playlists and playlists from sub-folders
- Ability to browse a plugin from the management dialog
- Ability to provide recommended shortcuts in management dialog
- Ability to choose to play or display a playlist
- Improved method of managing additional properties
- Method to list menu and submenus in a single include
- Ability to allow a user to select a shortcut, then pass this to the skin to manage
- Library/playlists/addon/favourites loading code moved to separate module, loaded threaded
- Menu now be rebuilt on skin or script version and profile changes (includes method)
- Updated language files from Transifex
v0.2.4
- Fix listing individual groups with method
- Parse favourites.xml directly
- Add XBMC Commands shortcut group
- Updated language files from Transifex
v0.2.2
- New optional method of listing shortcuts via includes file
- Option to allow user to browse for image or use playlist as background
- Option to allow user to choose playlist as widget
- Overrides and defaults now limitable by groupname
- Fix for custom video nodes
- Bug fixes and stability improvements
- Updated language files from Transifex
v0.2.0
- Removed check for settings shortcut (skins are now recommended to always provide alternative settings access)
- Video library shortcuts are loaded from video library node files (test)
- Video and music playlists are now grouped together
- Live TV renamed to PVR
- Support for managing widgets, backgrounds, custom properties
- Shortcuts with overriden images and override files are kept in memory to speed up listings
- Submenu shortcuts are now all loaded at once, with visibility conditions for switching lists
- Improved utf-8 support
- Bug fixes
v0.1.0
- Initial release
PK LzL zL script.skinshortcuts/default.py# coding=utf-8
import os, sys
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, urllib, xbmcvfs
import xml.etree.ElementTree as xmltree
import cPickle as pickle
import pstats
import random
import time
import calendar
import thread
from time import gmtime, strftime
from datetime import datetime
from traceback import print_exc
# Uncomment when profiling performance
# import cProfile
if sys.version_info < (2, 7):
import simplejson
else:
import json as simplejson
ADDON = xbmcaddon.Addon()
ADDONID = ADDON.getAddonInfo('id').decode( 'utf-8' )
ADDONVERSION = ADDON.getAddonInfo('version')
LANGUAGE = ADDON.getLocalizedString
CWD = ADDON.getAddonInfo('path').decode("utf-8")
ADDONNAME = ADDON.getAddonInfo('name').decode("utf-8")
RESOURCE = xbmc.translatePath( os.path.join( CWD, 'resources', 'lib' ) ).decode("utf-8")
DATAPATH = os.path.join( xbmc.translatePath( "special://profile/" ).decode( 'utf-8' ), "addon_data", ADDONID )
MASTERPATH = os.path.join( xbmc.translatePath( "special://masterprofile/" ).decode( 'utf-8' ), "addon_data", ADDONID )
sys.path.append(RESOURCE)
import xmlfunctions, datafunctions, library, nodefunctions
XML = xmlfunctions.XMLFunctions()
DATA = datafunctions.DataFunctions()
LIBRARY = library.LibraryFunctions()
NODE = nodefunctions.NodeFunctions()
ISEMPTY = "IsEmpty"
if int( xbmc.getInfoLabel( "System.BuildVersion" ).split(".")[0] ) >= 17:
ISEMPTY = "String.IsEmpty"
hashlist = []
def log(txt):
if ADDON.getSetting( "enable_logging" ) == "true":
if isinstance (txt,str):
txt = txt.decode('utf-8')
message = u'%s: %s' % (ADDONID, txt)
xbmc.log(msg=message.encode('utf-8'), level=xbmc.LOGDEBUG)
class Main:
# MAIN ENTRY POINT
def __init__(self):
self._parse_argv()
self.WINDOW = xbmcgui.Window(10000)
# Create data and master paths if not exists
if not xbmcvfs.exists(DATAPATH):
xbmcvfs.mkdir(DATAPATH)
if not xbmcvfs.exists(MASTERPATH):
xbmcvfs.mkdir(MASTERPATH)
# Perform action specified by user
if not self.TYPE:
line1 = "This addon is for skin developers, and requires skin support"
xbmcgui.Dialog().ok(ADDONNAME, line1)
if self.TYPE=="buildxml":
XML.buildMenu( self.MENUID, self.GROUP, self.LEVELS, self.MODE, self.OPTIONS, self.MINITEMS )
if self.TYPE=="launch":
xbmcplugin.setResolvedUrl( handle=int( sys.argv[1]), succeeded=False, listitem=xbmcgui.ListItem() )
self._launch_shortcut( self.PATH )
if self.TYPE=="launchpvr":
xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "id": 0, "method": "Player.Open", "params": { "item": {"channelid": ' + self.CHANNEL + '} } }')
if self.TYPE=="manage":
self._manage_shortcuts( self.GROUP, self.DEFAULTGROUP, self.NOLABELS, self.GROUPNAME )
if self.TYPE=="hidesubmenu":
self._hidesubmenu( self.MENUID )
if self.TYPE=="resetlist":
self._resetlist( self.MENUID, self.NEXTACTION )
if self.TYPE=="shortcuts":
# We're just going to choose a shortcut, and save its details to the given
# skin labels
# Load library shortcuts in thread
thread.start_new_thread( LIBRARY.loadAllLibrary, () )
if self.GROUPING is not None:
selectedShortcut = LIBRARY.selectShortcut( "", grouping = self.GROUPING, custom = self.CUSTOM, showNone = self.NONE )
else:
selectedShortcut = LIBRARY.selectShortcut( "", custom = self.CUSTOM, showNone = self.NONE )
# Now set the skin strings
if selectedShortcut is not None and selectedShortcut.getProperty( "Path" ):
path = selectedShortcut.getProperty( "Path" )
if selectedShortcut.getProperty( "chosenPath" ):
path = selectedShortcut.getProperty( "chosenPath" )
if path.startswith( "pvr-channel://" ):
path = "RunScript(script.skinshortcuts,type=launchpvr&channel=" + path.replace( "pvr-channel://", "" ) + ")"
if self.LABEL is not None and selectedShortcut.getLabel() != "":
xbmc.executebuiltin( "Skin.SetString(" + self.LABEL + "," + selectedShortcut.getLabel() + ")" )
if self.ACTION is not None:
xbmc.executebuiltin( "Skin.SetString(" + self.ACTION + "," + path + " )" )
if self.SHORTCUTTYPE is not None:
xbmc.executebuiltin( "Skin.SetString(" + self.SHORTCUTTYPE + "," + selectedShortcut.getLabel2() + ")" )
if self.THUMBNAIL is not None and selectedShortcut.getProperty( "icon" ):
xbmc.executebuiltin( "Skin.SetString(" + self.THUMBNAIL + "," + selectedShortcut.getProperty( "icon" ) + ")" )
if self.THUMBNAIL is not None and selectedShortcut.getProperty( "thumbnail" ):
xbmc.executebuiltin( "Skin.SetString(" + self.THUMBNAIL + "," + selectedShortcut.getProperty( "thumbnail" ) + ")" )
if self.LIST is not None:
xbmc.executebuiltin( "Skin.SetString(" + self.LIST + "," + DATA.getListProperty( path ) + ")" )
elif selectedShortcut is not None and selectedShortcut.getLabel() == "::NONE::":
# Clear the skin strings
if self.LABEL is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.LABEL + ")" )
if self.ACTION is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.ACTION + " )" )
if self.SHORTCUTTYPE is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.SHORTCUTTYPE + ")" )
if self.THUMBNAIL is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.THUMBNAIL + ")" )
if self.THUMBNAIL is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.THUMBNAIL + ")" )
if self.LIST is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.LIST + ")" )
if self.TYPE=="widgets":
# We're just going to choose a widget, and save its details to the given
# skin labels
# Load library shortcuts in thread
thread.start_new_thread( LIBRARY.loadAllLibrary, () )
# Check if we should show the custom option (if the relevant widgetPath skin string is provided and isn't empty)
showCustom = False
if self.WIDGETPATH and xbmc.getCondVisibility( "!%s(Skin.String(%s))" %( ISEMPTY, self.WIDGETPATH ) ):
showCustom = True
if self.GROUPING:
if self.GROUPING.lower() == "default":
selectedShortcut = LIBRARY.selectShortcut( "", custom = showCustom, showNone = self.NONE )
else:
selectedShortcut = LIBRARY.selectShortcut( "", grouping = self.GROUPING, custom = showCustom, showNone = self.NONE )
else:
selectedShortcut = LIBRARY.selectShortcut( "", grouping = "widget", custom = showCustom, showNone = self.NONE )
# Now set the skin strings
if selectedShortcut is None:
# The user cancelled
return
elif selectedShortcut.getProperty( "Path" ) and selectedShortcut.getProperty( "custom" ) == "true":
# The user updated the path - so we just set that property
xbmc.executebuiltin( "Skin.SetString(%s,%s)" %( self.WIDGETPATH, urllib.unquote( selectedShortcut.getProperty( "Path" ) ) ) )
elif selectedShortcut.getProperty( "Path" ):
# The user selected the widget they wanted
if self.WIDGET:
if selectedShortcut.getProperty( "widget" ):
xbmc.executebuiltin( "Skin.SetString(%s,%s)" %( self.WIDGET, selectedShortcut.getProperty( "widget" ) ) )
else:
xbmc.executebuiltin( "Skin.Reset(%s)" %( self.WIDGET ) )
if self.WIDGETTYPE:
if selectedShortcut.getProperty( "widgetType" ):
xbmc.executebuiltin( "Skin.SetString(%s,%s)" %( self.WIDGETTYPE, selectedShortcut.getProperty( "widgetType" ) ) )
else:
xbmc.executebuiltin( "Skin.Reset(%s)" %( self.WIDGETTYPE ) )
if self.WIDGETNAME:
if selectedShortcut.getProperty( "widgetName" ):
xbmc.executebuiltin( "Skin.SetString(%s,%s)" %( self.WIDGETNAME, selectedShortcut.getProperty( "widgetName" ) ) )
else:
xbmc.executebuiltin( "Skin.Reset(%s)" %( self.WIDGETNAME ) )
if self.WIDGETTARGET:
if selectedShortcut.getProperty( "widgetTarget" ):
xbmc.executebuiltin( "Skin.SetString(%s,%s)" %( self.WIDGETTARGET, selectedShortcut.getProperty( "widgetTarget" ) ) )
else:
xbmc.executebuiltin( "Skin.Reset(%s)" %( self.WIDGETTARGET ) )
if self.WIDGETPATH:
if selectedShortcut.getProperty( "widgetPath" ):
xbmc.executebuiltin( "Skin.SetString(%s,%s)" %( self.WIDGETPATH, urllib.unquote( selectedShortcut.getProperty( "widgetPath" ) ) ) )
else:
xbmc.executebuiltin( "Skin.Reset(%s)" %( self.WIDGETPATH ) )
elif selectedShortcut.getLabel() == "::NONE::":
# Clear the skin strings
if self.WIDGET is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.WIDGET + ")" )
if self.WIDGETTYPE is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.WIDGETTYPE + " )" )
if self.WIDGETNAME is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.WIDGETNAME + ")" )
if self.WIDGETTARGET is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.WIDGETTARGET + ")" )
if self.WIDGETPATH is not None:
xbmc.executebuiltin( "Skin.Reset(" + self.WIDGETPATH + ")" )
if self.TYPE=="context":
# Context menu addon asking us to add a folder to the menu
if not xbmc.getCondVisibility( "Skin.HasSetting(SkinShortcuts-FullMenu)" ):
xbmcgui.Dialog().ok(ADDONNAME, ADDON.getLocalizedString(32116))
else:
NODE.addToMenu( self.CONTEXTFILENAME, self.CONTEXTLABEL, self.CONTEXTICON, self.CONTEXTCONTENT, self.CONTEXTWINDOW, DATA )
if self.TYPE=="setProperty":
# External request to set properties of a menu item
NODE.setProperties( self.PROPERTIES, self.VALUES, self.LABELID, self.GROUPNAME, DATA )
if self.TYPE=="resetall":
# Tell XBMC not to try playing any media
try:
xbmcplugin.setResolvedUrl( handle=int( sys.argv[1]), succeeded=False, listitem=xbmcgui.ListItem() )
except:
log( "Not launched from a list item" )
self._reset_all_shortcuts()
def _parse_argv( self ):
try:
params = dict( arg.split( "=" ) for arg in sys.argv[ 1 ].split( "&" ) )
self.TYPE = params.get( "type", "" )
except:
#print_exc()
try:
params = dict( arg.split( "=" ) for arg in sys.argv[ 2 ].split( "&" ) )
self.TYPE = params.get( "?type", "" )
except:
self.TYPE = ""
params = {}
self.GROUP = params.get( "group", "" )
self.GROUPNAME = params.get( "groupname", None )
self.GROUPING = params.get( "grouping", None )
self.PATH = params.get( "path", "" )
self.MENUID = params.get( "mainmenuID", "0" )
self.NEXTACTION = params.get( "action", "0" )
self.LEVELS = params.get( "levels", "0" )
self.MODE = params.get( "mode", None )
self.CHANNEL = params.get( "channel", None )
# Properties when using LIBRARY._displayShortcuts
self.LABEL = params.get( "skinLabel", None )
self.ACTION = params.get( "skinAction", None )
self.SHORTCUTTYPE = params.get( "skinType", None )
self.THUMBNAIL = params.get( "skinThumbnail", None )
self.LIST = params.get( "skinList", None )
self.CUSTOM = params.get( "custom", "False" )
self.NONE = params.get( "showNone", "False" )
self.WIDGET = params.get( "skinWidget", None )
self.WIDGETTYPE = params.get( "skinWidgetType", None )
self.WIDGETNAME = params.get( "skinWidgetName", None )
self.WIDGETTARGET = params.get( "skinWidgetTarget", None )
self.WIDGETPATH = params.get( "skinWidgetPath", None )
if self.CUSTOM == "True" or self.CUSTOM == "true":
self.CUSTOM = True
else:
self.CUSTOM = False
if self.NONE == "True" or self.NONE == "true":
self.NONE = True
else:
self.NONE = False
self.NOLABELS = params.get( "nolabels", "false" ).lower()
self.OPTIONS = params.get( "options", "" ).split( "|" )
self.MINITEMS = int( params.get( "minitems", "0" ) )
self.WARNING = params.get( "warning", None )
self.DEFAULTGROUP = params.get( "defaultGroup", None )
# Properties from context menu addon
self.CONTEXTFILENAME = urllib.unquote( params.get( "filename", "" ) )
self.CONTEXTLABEL = params.get( "label", "" )
self.CONTEXTICON = params.get( "icon", "" )
self.CONTEXTCONTENT = params.get( "content", "" )
self.CONTEXTWINDOW = params.get( "window", "" )
# Properties from external request to set properties
self.PROPERTIES = urllib.unquote( params.get( "property", "" ) )
self.VALUES = urllib.unquote( params.get( "value", "" ) )
self.LABELID = params.get( "labelID", "" )
# -----------------
# PRIMARY FUNCTIONS
# -----------------
def _launch_shortcut( self, path ):
action = urllib.unquote( self.PATH )
if action.find("::MULTIPLE::") == -1:
# Single action, run it
xbmc.executebuiltin( action )
else:
# Multiple actions, separated by |
actions = action.split( "|" )
for singleAction in actions:
if singleAction != "::MULTIPLE::":
xbmc.executebuiltin( singleAction )
def _manage_shortcuts( self, group, defaultGroup, nolabels, groupname ):
homeWindow = xbmcgui.Window( 10000 )
if homeWindow.getProperty( "skinshortcuts-loading" ) and int( calendar.timegm( gmtime() ) ) - int( homeWindow.getProperty( "skinshortcuts-loading" ) ) <= 5:
return
homeWindow.setProperty( "skinshortcuts-loading", str( calendar.timegm( gmtime() ) ) )
import gui
ui= gui.GUI( "script-skinshortcuts.xml", CWD, "default", group=group, defaultGroup=defaultGroup, nolabels=nolabels, groupname=groupname )
ui.doModal()
del ui
# Update home window property (used to automatically refresh type=settings)
homeWindow.setProperty( "skinshortcuts",strftime( "%Y%m%d%H%M%S",gmtime() ) )
# Clear window properties for this group, and for backgrounds, widgets, properties
homeWindow.clearProperty( "skinshortcuts-" + group )
homeWindow.clearProperty( "skinshortcutsWidgets" )
homeWindow.clearProperty( "skinshortcutsCustomProperties" )
homeWindow.clearProperty( "skinshortcutsBackgrounds" )
def _reset_all_shortcuts( self ):
log( "### Resetting all shortcuts" )
dialog = xbmcgui.Dialog()
shouldRun = None
if self.WARNING is not None and self.WARNING.lower() == "false":
shouldRun = True
# Ask the user if they're sure they want to do this
if shouldRun is None:
shouldRun = dialog.yesno( LANGUAGE( 32037 ), LANGUAGE( 32038 ) )
if shouldRun:
isShared = DATA.checkIfMenusShared()
for files in xbmcvfs.listdir( DATAPATH ):
# Try deleting all shortcuts
if files:
for file in files:
deleteFile = False
if file == "settings.xml":
continue
if isShared:
deleteFile = True
elif file.startswith( xbmc.getSkinDir() ) and ( file.endswith( ".properties" ) or file.endswith( ".DATA.xml" ) ):
deleteFile = True
#if file != "settings.xml" and ( not isShared or file.startswith( "%s-" %( xbmc.getSkinDir() ) ) ) or file == "%s.properties" %( xbmc.getSkinDir() ):
if deleteFile:
file_path = os.path.join( DATAPATH, file.decode( 'utf-8' ) ).encode( 'utf-8' )
if xbmcvfs.exists( file_path ):
try:
xbmcvfs.delete( file_path )
except:
print_exc()
log( "### ERROR could not delete file %s" % file )
else:
log( "Not deleting file %s" %[ file ] )
# Update home window property (used to automatically refresh type=settings)
xbmcgui.Window( 10000 ).setProperty( "skinshortcuts",strftime( "%Y%m%d%H%M%S",gmtime() ) )
# Functions for providing whoe menu in single list
def _hidesubmenu( self, menuid ):
count = 0
while xbmc.getCondVisibility( "!%s(Container(%s).ListItem(%i).Property(isSubmenu))" %( ISEMPTY, menuid, count ) ):
count -= 1
if count != 0:
xbmc.executebuiltin( "Control.Move(" + menuid + "," + str( count ) + " )" )
xbmc.executebuiltin( "ClearProperty(submenuVisibility, 10000)" )
def _resetlist( self, menuid, action ):
count = 0
while xbmc.getCondVisibility( "!%s(Container(%s).ListItemNoWrap(%i).Label)" %( ISEMPTY, menuid, count ) ):
count -= 1
count += 1
if count != 0:
xbmc.executebuiltin( "Control.Move(" + menuid + "," + str( count ) + " )" )
xbmc.executebuiltin( urllib.unquote( action ) )
if ( __name__ == "__main__" ):
log('script version %s started' % ADDONVERSION)
# Uncomment when profiling performance
#filename = os.path.join( DATAPATH, strftime( "%Y%m%d%H%M%S",gmtime() ) + "-" + str( random.randrange(0,100000) ) + ".log" )
#cProfile.run( 'Main()', filename )
#stream = open( filename + ".txt", 'w')
#p = pstats.Stats( filename, stream = stream )
#p.sort_stats( "cumulative" )
#p.print_stats()
# Comment out the following line when profiling performance
Main()
log('script stopped')
PK Ls" " script.skinshortcuts/fanart.jpg JFIF H H
Exif MM * b j( 1 r2 ~i H H GIMP 2.8.10 2015:12:18 11:55:10 0210 0100 8 " *( 2 H H JFIF C
$.' ",#(7),01444'9=82<.342 C
2!!22222222222222222222222222222222222222222222222222 n "
} !1AQa"q2#BR$3br
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz
w !1AQaq"2B #3Rbr
$4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ? )hQS*״x-S@=v{Th@lgMP;=S5+ϥ8EVDu"JTCRicV.qJ*=Uҭ\T,qQ*,*V}8R!*nRU j`"\E'R(>>aTY7ZUC>gMH@#UV_/c4oZJt0_Mȑ]wK8ǩ֭\o"9$; g#)9Ǹ).)\*tj3wvwW7W j<8 RCPcuvTnI).m.elTxf]GD8QY&
^HRr `A8){~S>8=ncg*
=Y}ڔ!N19HvgRdQL3y\s