Menu
  • HOME
  • TAGS

Python - How to delete rest of string after a specific word/character

python,kodi

FileName.split(']')[1].split('(')[0].strip() + ".strm"

Search for specific text in an element of XML with DOM (Python)

python,xml,dom,kodi

This working example demonstrates one possible way to search element containing specific text using minidom module* : from xml.dom.minidom import parseString def getText(nodelist): rc = [] for node in nodelist: if node.nodeType == node.TEXT_NODE: rc.append(node.data) return ''.join(rc) xml = """<root> <shortcut> <label>33060</label> <label2>Common Shortcut</label2> </shortcut> <shortcut> <label>Test</label> </shortcut> </root>""" xmldoc...

Java - Nested JSON objects

json,sockets,xbmc,kodi

Create another JSONObject for the params, set it up, and add it to the parent JSONObject with the key params.

XBMC/KODI error adding addon “structure incorrect”

add-on,xbmc,kodi

You will need to set it up like this: zip (name doesn't matter) folder with plugin name (ie plugin.program.hello.world) plugin files including addon.xml, LICENSE.txt, changelog.txt, icon.png, etc You don't need a special tool but you may be inadvertently compressing the zip. You could try Keka (or on SourceForge)....

How to make sure that while will stop in every respect

python,xbmc,kodi

The error occurred not at get(), but with target in apply_async(). This solution have therefore only made it possible to stop the process again. The conclusion being that. The loop will continue although there is a fault with Pool, and therefore you can always exit the loop. def browse(separate, page):...

Python - shutil How to select multiple directories for deletion with similar names

python,glob,xbmc,shutil,kodi

import glob import shutil deldirs = glob.glob("path/to/master/test.directory.*") for dir_ in deldirs: shutil.rmtree(dir_) ...

A simple Script to extracting a zip file

python,unzip,zipfile,xbmc,kodi

Try to do it this way import zipfile fh = open(targetzip, 'rb') z = zipfile.ZipFile(fh) for name in z.namelist(): z.extract(name, extractto) fh.close() ...

ImportError (encodings) when calling video player with python script from parent media center Kodi

python,python-3.x,homebrew,kodi

In the meantime I found it out by myself: Kodi has a built-in Python 2 interpreter and is - even in the upcoming version 15 - still not using the Python 3 interpreter introduced in December 2008. Obviously the script, which needs Python 3, will not run when called from...