Kodi Community Forum
Release KodiDevKit: SublimeText3 plugin to support kodi skinning / scripting - 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 KodiDevKit: SublimeText3 plugin to support kodi skinning / scripting (/showthread.php?tid=221682)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - bossanova808 - 2015-04-24

Are you planning to add this to package manager for auto installs/updates anytime soon?


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-24

yes I will take a look at that, but I first want to get everything in a solid state. Still have lot to learn how to deal best with that API.


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - BigNoid - 2015-04-24

You can add phil65's repository to package control. Then you can install the package and it will automatically update.


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-25

next one:
fuzzy search through all available translation labels + inserting it with $LOCALIZE[]:
Image


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - sualfred - 2015-04-25

Wut? Awesome! That's really the best feature and it's working like a charm Thx mate!


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - bossanova808 - 2015-04-25

Ok so I tired adding the git repo, which worked and I installed it.

I have settings:

Code:
{
    "kodi_path": "C:/XBMC/Helix/Kodi/language/English (Australia)/",
    "portable_mode": true
}

(created after using the command 'set Kodi language folder')

It will not open the log, it seems to be ignoring the portable setting:

Code:
reloading /C/Utilities/Sublime Text/Data/Packages/User/sublimekodi.sublime-settings
Unable to open /C/Users/XX/AppData/Roaming/kodi/kodi.log

(the log is actually at C:\XBMC\Helix\Kodi\portable_data\kodi.log of course)

Trying to reload language file:
Code:
SublimeKodi: kodi path: C:/XBMC/Helix/Kodi/language/English (Australia)/
SublimeKodi: use default language: English
Traceback (most recent call last):
  File "C:\Utilities\Sublime Text\sublime_plugin.py", line 389, in on_window_command
    res = callback.on_window_command(window, name, args)
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 36, in on_window_command
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 132, in update_labels
AttributeError: 'SublimeKodi' object has no attribute 'builtin_id_list'


On a fresh startup (using Win64 portable build 3084) - I see errors actually:
Code:
SublimeKodi: kodi path: C:/XBMC/Helix/Kodi/language/
SublimeKodi: use default language: English
Traceback (most recent call last):
  File "C:\Utilities\Sublime Text\sublime_plugin.py", line 312, in on_activated_async
    callback.on_activated_async(v)
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 65, in on_activated_async
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 132, in update_labels
AttributeError: 'SublimeKodi' object has no attribute 'builtin_id_list'

Obviously this is still very much in dev but I thought you might want some pointers to issues Smile

(For me I am looking for log highlighting (will this be done the standard syntax file way?) - and ideally completions and/or docs for xbmc python addon programming).


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - bossanova808 - 2015-04-25

(NB - manually opening the log now gives me syntax highlighting, so ignore that bit!)


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-25

(2015-04-25, 07:45)bossanova808 Wrote: Ok so I tired adding the git repo, which worked and I installed it.

I have settings:

Code:
{
    "kodi_path": "C:/XBMC/Helix/Kodi/language/English (Australia)/",
    "portable_mode": true
}

(created after using the command 'set Kodi language folder')

It will not open the log, it seems to be ignoring the portable setting:

Code:
reloading /C/Utilities/Sublime Text/Data/Packages/User/sublimekodi.sublime-settings
Unable to open /C/Users/XX/AppData/Roaming/kodi/kodi.log

(the log is actually at C:\XBMC\Helix\Kodi\portable_data\kodi.log of course)

Trying to reload language file:
Code:
SublimeKodi: kodi path: C:/XBMC/Helix/Kodi/language/English (Australia)/
SublimeKodi: use default language: English
Traceback (most recent call last):
  File "C:\Utilities\Sublime Text\sublime_plugin.py", line 389, in on_window_command
    res = callback.on_window_command(window, name, args)
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 36, in on_window_command
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 132, in update_labels
AttributeError: 'SublimeKodi' object has no attribute 'builtin_id_list'


On a fresh startup (using Win64 portable build 3084) - I see errors actually:
Code:
SublimeKodi: kodi path: C:/XBMC/Helix/Kodi/language/
SublimeKodi: use default language: English
Traceback (most recent call last):
  File "C:\Utilities\Sublime Text\sublime_plugin.py", line 312, in on_activated_async
    callback.on_activated_async(v)
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 65, in on_activated_async
  File "sublimekodi in C:\Utilities\Sublime Text\Data\Installed Packages\SublimeKodi.sublime-package", line 132, in update_labels
AttributeError: 'SublimeKodi' object has no attribute 'builtin_id_list'

Obviously this is still very much in dev but I thought you might want some pointers to issues Smile

(For me I am looking for log highlighting (will this be done the standard syntax file way?) - and ideally completions and/or docs for xbmc python addon programming).

Kodi_path should point to the kodi folder, not some language folder.
portable_mode setting is not used yet, so showing log from portable installs does not work yet.
when kodi is is non-portable mode everything should work fine.
log highlighting is done via .sublime-syntax file.


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-25

...and now "Open log" should work with portable, too.


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - bossanova808 - 2015-04-26

Indeed it does.

(Note, I tried the actual kodi path there first, only added the language stuff when I noticed it said 'path to kodi language folder' or similar in the tip a the bottom when running the command - and I only tried the portable setting because it was there!).

Anyway, very nice work & thanks.


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-26

you´re right, I didnt choose the best suited label. Changed "Set Kodi folder for language file" to just "Set Kodi folder" now.


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-26

false positives for translations should be gone for most parts now. (bit tricky esp. for python, I now just check for some keywords in the same line, like "string", "label", "localize". I hope that´s good enough.)


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-27

some bigger change:
to really get some more advanced stuff with XML going I have to be able to use something better than the default XML libs because those are too limited. ( --> no sourceline attribute for XMLElements, no preserving of attribute order, only partly implemented XPath and also performance reasons)
What seems to be the best solution is lxml, which is a relatively powerful python XML lib implemented in C.
Since adding C libs in ST seems to be a PITA and I have no experience with embedding pre-compiled python libs for multiple platforms I would need some testing, esp. for 32 bit platforms. Anyone in that boat?
If yes, please try the lxml branch. You will get a new feature there, pressing shift+enter jumps to variable definition if focus is inside $VAR[] brackets. (requires that variables are placed inside a file named Variables.xml for now)
I expect Linux x64 and Windows x64 to work, for the rest I have no idea Smile

BTW: if all works out then you can expect some more fun features in the future. I would also probably tackle to merge the XMLConverter tool into this plugin then so that it is usable on all platforms.


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-28

...and if I got everything right then goto (shift+enter) will now work for all variables and includes when using lxml branch. Smile


RE: SublimeKodi: SublimeText3 plugin to help with kodi skinning / scripting - phil65 - 2015-04-29

since noone wants to test you will have to deal with the fallout. Pushed everything to master.