Sqlite in python plugins/scripts

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
galvanash Offline
Senior Member
Posts: 102
Joined: Jan 2010
Reputation: 0
Location: Mostly my couch
Post: #1
I have a plugin that uses pysqlite2. I have platform libraries for win32, xbox, Linux, and OSX for older xbmc distributions, and Dharma started including script.module.pysqlite in the base install, at least for the common platforms.

On iOS, I see the script.module.pysqlite folder, but it only contains the addon.xml, and I cannot find the .pyd anywhere. Is this available? If not, are there any alternatives that would allow using sqlite from python on iOS?
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,564
Joined: Oct 2003
Reputation: 138
Post: #2
It will need building for iOS. I'm not sure how easy that will be - I'll let the iOS devs know.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
anarchintosh Offline
Fan
Posts: 302
Joined: Jul 2010
Reputation: 4
Post: #3
hey, i also have an addon that uses this and had a lot of ATV users complain about not being able to use this.
thanks for the heads-up jonathon
find quote
FenceMan Offline
Member
Posts: 59
Joined: Jan 2010
Reputation: 0
Post: #4
Were not really complaining, appreciate the effort, just hoping we can get the best add on working on atv2.

Anything that can be done is appreciated, ATV/Xbmc is awesome but it's now missing the hands down best add-on.
find quote
FenceMan Offline
Member
Posts: 59
Joined: Jan 2010
Reputation: 0
Post: #5
sraue Wrote:Hi,



this comes from using python-2.6 and newer (used in OpenELEC and the ATV2 builds). Python 2.6 and newer has an included sqlite module (sqlite3) and there is no need for pysqlite2. This can simply solved by a check if sqlite3 is installed, if it fails fallback to pysqlite2 like:

Code:
try:
    from sqlite3 import dbapi2 as sqlite
    logFile.info("Loading sqlite3 as DB engine")
except:
    from pysqlite2 import dbapi2 as sqlite
    logFile.info("Loading pysqlite2 as DB engine")

From other thread, maybe this can solve others issues also?
find quote
ppic Offline
Skilled Python Coder
Posts: 2,688
Joined: Feb 2009
Reputation: 10
Location: France idf
Post: #6
if it's for reading the xbmc database content, why not use the json or http api instead?

[Image: widget]
Passion-XBMC Repository Download your SVN skins and addons
TvTunes Addon Download Play your theme while browsing library
TVshow Next Aired display next aired infos from tvrage.com
Logo Downloader Script download Logo/clearart/show thumbs/poster/banner
Bande-Annonce Allociné plugin watch trailers in french and vo
SportLive Script Live score match info in XBMC (not compatible dharma)
find quote
galvanash Offline
Senior Member
Posts: 102
Joined: Jan 2010
Reputation: 0
Location: Mostly my couch
Post: #7
ppic Wrote:if it's for reading the xbmc database content, why not use the json or http api instead?

I dont know about the others, but in the case of my plugin it is not reading the xbmc database - it is a custom database which supplies the plugin with its data.
find quote
galvanash Offline
Senior Member
Posts: 102
Joined: Jan 2010
Reputation: 0
Location: Mostly my couch
Post: #8
FenceMan Wrote:From other thread, maybe this can solve others issues also?

Spot on. This worked perfectly. Thanks!
find quote