Release script.skinshortcuts - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12) +---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300) +---- Thread: Release script.skinshortcuts (/showthread.php?tid=178294) Pages:
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
RE: script.skinshortcuts - BobCratchett - 2016-03-12 Great stuff - and lets also give credit to Jayz2K, for coming up with the wonderful method of assigning a unique ID to each item. There's one other situation I know of where widgets can start to disappear - when the window is closed whilst Kodi is loading the widget. Kodi won't try to load it again until the URI changes. If you want to start getting ready for the next repo version of the script, and I'm sure this method itself will evolve when you skilled skinners start playing with it, I'm using the following in my templates to work around this particular problem... New template:- Code: <other include="widgetReloadTrick"> The propertyGroup is one of the new features, and just allows me to only define the <property /> elements once for multiple templates. In that propertyGroup there are the following... Code: <property name="id" tag="mainmenuid" /> Code: <content target="$SKINSHORTCUTS[target]">$SKINSHORTCUTS[path]$PYTHON[$SKINSHORTCUTS[autoreload]]</content> Which all comes together as... if the widget is loading, or hasn't any items, when the window is closed it's specific refresh property is updated on the home window. The widgetPath property - if the widget is a plugin - has that refresh property added to it, with a little Python snippet used so that a '?' or a '&' is used correctly to add it to the URI, so will reload when the home screen is next accessed. Though maybe have a break before looking into this RE: script.skinshortcuts - braz - 2016-03-12 (2016-03-12, 21:45)BobCratchett Wrote: Though maybe have a break before looking into thisGot the day off, will try to push through. This looks straight-forward enough, the only question I have is where the propertyGroup goes. Inside the first template, outside of the templates? RE: script.skinshortcuts - BobCratchett - 2016-03-12 The property group is defined outside of an individual template, and referenced within the template with <propertyGroup>[name]</propertyGroup>. Link to the relevant docs. (It, and the python snippets, are both features of v1.0.8 and so not yet available on the repo). RE: script.skinshortcuts - braz - 2016-03-12 (2016-03-12, 22:18)BobCratchett Wrote: The property group is defined outside of an individual template, and referenced within the template with <propertyGroup>[name]</propertyGroup>. Link to the relevant docs. (It, and the python snippets, are both features of v1.0.8 and so not yet available on the repo).Ah, I hadn't updated skinshortcuts from github! After updating to 1.08, however, I get an error that the menu can't be built. I don't think I'm missing any dependencies, ideas? Here's my log... http://goo.gl/DcXGXV Thanks! RE: script.skinshortcuts - BobCratchett - 2016-03-12 You haven't defined the property 'path' Either <property name="path" tag="property" attribute="name|widgetPath" />, or update path in the python snippet to whatever you've named the property you keep the widgetPath in - so if it's called widgetPath, for example, the snippet would be:- Code: <property name="autoreload">autoreloadStringAnd %( id ) if widgetPath in 'plugin' and widgetPath in '?' else autoreloadStringQuestion %( id ) if widgetPath in 'plugin' else ''</property> RE: script.skinshortcuts - braz - 2016-03-12 Hmm, I have path defined, but probably have placement wrong... Is the propertyGroup in the wrong place? Code: <template> RE: script.skinshortcuts - BobCratchett - 2016-03-12 That looks correct, though it's never easy to be sure from a snippet. Are you still getting the same error in the log? For reference, the error in the previous log was: Code: NameNotDefined: 'path' is not defined for expression 'autoreloadStringAnd %( id ) if path in 'plugin' and path in '?' else autoreloadStringQuestion %( id ) if path in 'plugin' else ''' If it helps, here's the property group in my own template.xml, one place I pull it into a template and one where I use the snippet. RE: script.skinshortcuts - braz - 2016-03-12 Still the same error. In the following code, what is igConq? The name of your skin? Is there something specific I need to use there? Code: <property name="autoreloadStringAnd">&igConq=$INFO[Window.Property(refresh8011%s)]</property> RE: script.skinshortcuts - BobCratchett - 2016-03-13 Yes, just the name of my skin mod. It shouldn't matter what you use there, so long as it doesn't interfere with any properties the plugin might actually be expecting to receive. RE: script.skinshortcuts - BobCratchett - 2016-03-13 Just quickly added it to the fork of Mimic on my own git (updated against your Master), and it all seems to build fine. If that doesn't work for you, then I can only conclude there's some differences in how simpleeval (the library that skin shortcuts is using to evaluate these python snippets) works on different platforms... (I have only tested Mac + Linux) RE: script.skinshortcuts - braz - 2016-03-13 I'm on Windows, I got it to work by adding the following to my propertyGroup... Code: <propertyGroup name="mainmenuWidgets"> But now I get the following ExtendedInfo error for one of my widget paths. Code: 14:29:58 T:5556 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://script.extendedinfo/?info=youtubeusersearch&&id=Eurogamer&mimic= I see it added &mimic= to the end of the path, which is the identifier used in my autoreloadStringAnd property. Not sure what the empty path and target properties I added to the propertyGroup do. Going to take a look at your commit now. RE: script.skinshortcuts - BobCratchett - 2016-03-13 Ah, that makes sense. These two both pull out the relevant property from the menu item. If the menu item doesn't have the property, they won't be set. Code: <property name="path" tag="property" attribute="name|widgetPath" /> Whereas these set the relevant properties to an empty string, if they haven't already been set. Code: <property name="path"></property> So you must have templates that are building where the widgetPath isn't actually set (and so the python snippet is quite correctly saying that 'path' doesn't exist). The property fallbacks you've added are absolutely the right way to go about it. The double && in the path looks wrong, but that really shouldn't be caused by anything you're doing with the snippet... RE: script.skinshortcuts - braz - 2016-03-13 I see in your igConq template.xml you used: Code: $PYTHON[$SKINSHORTCUTS[autoreload]] But in the Mimic template you used: Code: $PYTHON[autoreload] Do they both work? RE: script.skinshortcuts - braz - 2016-03-13 You're right, I need to take a break...off to lunch. Couldn't get the autoreload stuff to work with plugin paths no matter what I tried. Worked fine with local library paths though. RE: script.skinshortcuts - BobCratchett - 2016-03-13 They do both work, but don't follow my example in igConq I'm still learning what these python snippets can do and how to use them (they were actually added because a skinner requested a way to do simple maths but, as it often goes, doing that in a safe and secure manner meant the easiest way was to use the simpleeval library which has opened up a lot of other possibilities), so the $PYTHON[$SKINSHORTCUTS[]] is a remnant of an early attempt. As I say it does work, but it has more potential issues - for example if there's a square bracket in the $SKINSHORTCUTS[] property (which is to say, the value associated with that property) it will cause a build failure. Accessing the property directly by name should be a lot less unexpected-error-prone. Enjoy your lunch, I'm off to bed myself |