Python script testing without Xbox

Discussion of plugin / script development for XBMC4Xbox
Post Reply
Basje
Posts: 46
Joined: Sun Aug 19, 2012 9:17 pm
Been thanked: 3 times

Python script testing without Xbox

Post by Basje »

Hi there,

I was wondering if there is any possibility to test add-ons (and their Python script) without having an Xbox? I moved to rPi's but would still like to keep my add-on (XBMC Online TV) compatible with XBMC4Xbox.

So is this possible? Perhaps with the Win32 build?
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Python script testing without Xbox

Post by skatulskijean »

Basje wrote:Hi there,

I was wondering if there is any possibility to test add-ons (and their Python script) without having an Xbox? I moved to rPi's but would still like to keep my add-on (XBMC Online TV) compatible with XBMC4Xbox.

So is this possible? Perhaps with the Win32 build?
no its give momently no Solution to test a addon for compatible to xbmc4xbox without a xbox self.
But with the integrated python 2.7.5 since not nany thinks what you must do to have a compatible addon for xbmc4xbox.

First you can def a xbox variable for do thinks working differend to mainxbmc!
xbox = xbmc.getCondVisibility("System.Platform.xbox")

then you can easy address this variable for differend solutions for mainxbmc or xbmc4xbox!
as example the pfade on xbmc4xbox and mainxbmc since differend and when you want for your addon a Solution to access a function from your otr a differend addon you can this to over a if else here is a example to access the youtube addon to play a video.

if xbox:
url = "plugin://video/YouTube/?path=/root/video&action=play_video&videoid=" + id
else:
url = "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=" + id

But that is not a nice solution better is your def your different pfade example:

def getPluginUrl():
if xbox:
return "plugin://video/"+addon.getAddonInfo('name')

else:
return "plugin://"+addonID

and your access the video over

getPlugin()+"/?path=/root/video&action=play_video&videoid=" + id

and you must not have a look on the addon xml to access the name for the addon self.


Next what since different is:

addon = xbmcaddon.Addon()
works on main xbmc but on xbmc4xbox not we have momently the addon functionality not embed on source .
we access all the functionality over the scriptmodule xbmcaddon and we want for this the addon id to have a luck what for addon it is an emulate than the addon functionality for it

addonID = 'plugin.video.clipfish'
addon = xbmcaddon.Addon(id=addonID) is working on xbmc4xbox and mainxbmc as example.

here working examples what works on mainxbmc and xbmc4xbox:

addonDir = xbmc.translatePath(addon.getAddonInfo('path')) locate the addonDir

addonUserDataFolder = xbmc.translatePath(addon.getAddonInfo('profile')) locate the UserdataFolder

addonfavs=os.path.join(addonUserDataFolder, addonID+".favorites") path for addon favs under userdata

icontest = os.path.join(addonDir, 'icontest.png')


When you want the xbmcvfs on you addon look on the scriptmodule.xbmcfvs what for fuctions since working on it (is a scriptmodule on xbmc4xbox)
when you want the storageserver on your addon pleace add a working storageserver dummy and a try except or if else to access the storageserver ot the storageserverdummy .
the commonplugin cache is a service addon we can not address a service addon so we handle the storageserver over the storageserver dummy


look first on the extern scriptmodules what your want for youre addon.

the requests scriptmodule works on the nightly from xbmc4xbox to and handle all what you can do over the urllib2 module but with simpler code and faster as the urllib2 with unicode support access jason url without import from json and many more.


Regards Jan and have fun
Basje
Posts: 46
Joined: Sun Aug 19, 2012 9:17 pm
Been thanked: 3 times

Re: Python script testing without Xbox

Post by Basje »

Thanks for the extensive reply, I am however a very skilled (so I am told) Python and XBMC add-on coder, so I already know what you wrote.

The main question was that I wanted to be able to double check that I did not break stuff on XBMC4Xbox while continuing development focused on XBMC. And without an Xbox that does seem to be an issue now.
User avatar
Dom DXecutioner
Posts: 587
Joined: Thu Jul 05, 2012 11:59 pm
Location: California
Has thanked: 249 times
Been thanked: 226 times
Contact:

Re: Python script testing without Xbox

Post by Dom DXecutioner »

I'm afraid there isn't any specific method; however, as long as you don't use "services", most items should work, but you can always post here for someone to test.

The skinning engine (with the exception of addon labels), thanks, to BuZz, is getting closer to mainline , and I'm not aware of any major changes from the python side.

I could be mistaken... Oh, of course the database is different.
Image
Basje
Posts: 46
Joined: Sun Aug 19, 2012 9:17 pm
Been thanked: 3 times

Re: Python script testing without Xbox

Post by Basje »

Dom DXecutioner wrote:I'm afraid there isn't any specific method; however, as long as you don't use "services", most items should work, but you can always post here for someone to test.

The skinning engine (with the exception of addon labels), thanks, to BuZz, is getting closer to mainline , and I'm not aware of any major changes from the python side.

I could be mistaken... Oh, of course the database is different.
The main thing that I wanted to test was my custom implementation of updating via my XBMC repository. I assume (perhaps I am incorrect) that XBMC4Xbox does not support Add-on repositories.
User avatar
BuZz
Site Admin
Posts: 1891
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 66 times
Been thanked: 423 times
Contact:

Re: Python script testing without Xbox

Post by BuZz »

it doesn't and location is like old xbmc (plugins/video plugins/music etc). Right now it's all a bit put together with sticky tape with a program plugin to install from addon repositories (into the folders mentions). No easy way to test I'm afraid with the hardware.
Basje
Posts: 46
Joined: Sun Aug 19, 2012 9:17 pm
Been thanked: 3 times

Re: Python script testing without Xbox

Post by Basje »

BuZz wrote:it doesn't and location is like old xbmc (plugins/video plugins/music etc). Right now it's all a bit put together with sticky tape with a program plugin to install from addon repositories (into the folders mentions). No easy way to test I'm afraid with the hardware.
I guess I will need to go digg up and dust off my old Xbox and cables.
Post Reply