Python Dev Tool: XBMC Emulator scripts
#46
(teknojuce @ oct. 21 2005,10:47 Wrote:http://cvs.sourceforge.net/viewcvs....tor.rar

found the files laying on my hdd hope they are of some use...  they will be up'd there to that link in a few days... :fixed:
thank you so much for posting this emulator.. i have also been looking for it without success for weeks. i've been trying to write a script that i need cookie support for, and testing it on the xbox has proven troublesome at the least.

one issue i'm having though - this version of the emulator doesn't appear to support xbmcgui.dialogprogress(), but from looking at the cachedhttp.py code, the emulator did at some point. is there a later version of the emulator someplace?

at any rate, thanks again for taking the time to post that archive!
Reply
#47
as far as i no it never supported that
read the xbmc online-manual, faq and search the forums before posting! do not e-mail the xbmc-team asking for support!
read/follow the forum rules! note! team-xbmc never have and never will host or distribute ms-xdk binaries/executables!
Reply
#48
i am considering updating alexpoet's emulator scripts, but i'd like to gather information on how useful this would be to others. i don't know if anyone even uses these emulators anymore, since they've been allowed to generally die out when alexpoet's website went offline.

please post some support if you would get usage out of updated xbmc/xbmcgui emulator scripts.
Reply
#49
i am interested ! :o

as my xbox is way to far from my computer, i usually test the non-gui part of the script on the computer (linux os with python 2.4 installed), then a final test/tuning with the gui directly on the xbox.

so i am very interested in a new version of that emulator.
in fact, i modified some stuff in xbmcgui.py to avoid big errors (new functions, new parameters in functions, and in the function, only a "pass" command), but i am not good enough in tk language programming to go further than that... Blush
Reply
#50
i am with lassie on this one. my xbox is a good walk from my dev machine.

i have tweaked my xbmcgui.py file a fair nit as well to avoid erorrs. also added windowdialog support by copying the window class and renaming it so i could test those functions.

would be great to see some updates to the script as i too have no idea about tk
Reply
#51
i've released a new version of the emulator files. i used makedoc.py out of xbmc cvs to generate docs on my xbmc install dated 2005-11-14, and brought the emulator up to date as per those docs.

most of the added functions are simply stubbed out, and i haven't tried these files on very many scripts yet, so please let me know if there is a problem in this version that was not in the old version.

xbmc.xbmcgui.emulator-0.2-20nov2005.zip

unless there are some major issues that i feel justify another release of this tkinter codebase, this will be the last version using tkinter. it is provided at this point intended to be updated to the latest xbmc requirements, but is not intended to be functional beyond anything that alexpoet's last version provided.

i am going to rewrite most of the gui code in the emulator, as i am not happy with the quality of the pil imaging or the look of the tkinter windows. i will probably be using wxpython in the next release.

additionally, i hope to implement some of the other functions that have been ignored, such as cpu information, etc.

one other goal is to remove the requirement to add any additional code to scripts, making these scripts true emulators, but we'll see on that one.

thanks for showing interest, and please let me know if anyone has any ideas to improve this emulator.
Reply
#52
good job ! :thumbsup:
it looks like the mooload.com server is down right now (cannot download the zip file)... i'll try later, and test this new version tonight...
thanks a lot ! :kickass:



Reply
#53
thanks man,
very good job

:joker:
For my bad English, sorry. I am French Canadian.
Admin @ Passion-XBMC.org
Reply
#54
i've been modifying the emu as i've been deving a few scripts.
i'd like to be able to compare the new additions with my own but am unable to dl from mooload.com. could someone send me a copy please ?

much appreciated

bbb
Reply
#55
hi,
you can get a copy of it on gueux-forum.net (french forum about xbmc python scripting), in this topic. thanks frost ! :thumbsup:

i did quick test, and it looks like there are some tk errors on some recent scripts, like this one for example (script getting french movies informations on the web... great script... :bowdown: ).
didn't have time to investigate further on the new version of this emulator... No
Reply
#56
@Killarny, i have tried your modified emulator, but i already get errors when i use setlabel.

falling back.
Reply
#57
(bakman @ dec. 01 2005,07:53 Wrote:@Killarny, i have tried your modified emulator, but i already get errors when i use setlabel.

falling back.
if you could specify the errors you are getting, it would help me with the next version i'm working on.
Reply
#58
thanks for the link.

i've compared the new changes to my own modified emu and infact we'd added almost exactly the same stuff (his is nicly documented thou)

a couple of minor mods of my own that you might be interested in:
in controllabel this code accomodates the 2nd label column that listitems now have:

Quote: def additem(self, item):
"""
additem(item) -- add a new item to this control list.

item can be a string / unicode string or a listitem.
"""
if isinstance (item, str):
newitem = listitem(item)
else:
newitem = item
pos = self.tklist.size()
label = newitem.getlabel()
label2 = newitem.getlabel2()
if label2 and len(label2) > 0:
label += " - " + label2
self.tklist.insert(pos, label)
self.items.append(newitem)

and my controlcheckmark displays a togglig [x] on a button after each press. its just helps show current checkmark state:

Quote:class controlcheckmark( control ):
"""
controlcheckmark(x, y, width, height, label, focustexture, nofocustexture,
checkwidth, checkheight, alignment, font, textcolor, disabledcolor )

x : integer x coordinate of control
y : integer y coordinate of control
width : integer width of control
height : integer height of control
label : string or unicode string (opt)
focustexture : filename for focus texture (opt)
nofocustexture : filename for no focus texture (opt)
checkwidth : width of checkmark (opt)
checkheight : height of checkmark (opt)
alignment : alignment of checkmark label (opt)
font : name of font e.g. 'font13' (opt)
textcolor : color of text e.g. '0xffffffff' (opt)
disabledcolor : disabled color of text e.g. '0xffffffff' (opt)
"""
def ( self,
x, y, width, height,
label = '',
focustexture = none, nofocustexture = none,
checkwidth = 0, checkheight = 0,
alignment = 0, # investigate
font = 'font13', # investigate
textcolor = '0xffffffff', # investigate
disabledcolor = '0xffffffff' # investigate
):
type = "button"
width = int(width / 9)
height = int(height / 17)
control.(self, type, x, y, width, height)
self.text = label
self.selected = true

def getselected( self ):
"""
getselected() -- returns the selected value for the check mark.
"""
return self.selected

def setdisabledcolor( self, hexcolor ):
"""
setdisabledcolor(string hexcolor) -- .

hexcolor : hexstring (example, '0xffff3300')
"""
pass

def setlabel( self, label, font, textcolor, disabledcolor ):
"""
setlabel(label, font, textcolor, disabledcolor)

method to set the text for this button.

label : string or unicode string
font : name of font for button text (opt)
textcolor : color of text (opt)
disabledcolor : disabled color of text (opt)
"""
self.text = txt
if self.selected:
text = txt + ' [x]'
else:
text = txt + ' [ ]'
self.tkobj.config(text = text)

def setselected( self, ison ):
"""
setselected(bool ison) -- sets the check mark on or off.

ison : true if selected, false if not selected
"""
self.selected = state
self.setlabel(self.text)


def create(self, win):
self.tkobj = button(win.canvas, text = self.text, command = (lambda: win.oncontrol(self)))
self.tkobj.config(font = ('arial', 10, 'normal'), width = self.width, height = self.height)
self.tkobj.pack()

thanks to killarny for bringing it upto date.
bbb
Reply
#59
i can confirm that the new xbmcgui.py runs 100% with my 'mytv' script which uses just about every function possible, incl. setlabel.
if that helps ?
Reply
#60
hi killarny and thanks for the update!

this one might be a bit tricky but a fix would really help me a lot.
the problem i have is updating xbmcgui graphics from a timer/thread. placing the following in the class xxx(xbmcgui.window) works perfectly well in xbmc.

Quote:...
def starttimer(self):
self.t = none
self.t = timer(0.3, self.refresh)
self.t.start()
...
def refresh(self):
global connstatus, updatescreen
if connstatus != self.connstatus or updatescreen:
if emulating:
print "status changed: " + str(connstatus)
else:
self.showstatus(connstatus)
self.starttimer()

if self.showstatus uses any xbmcgui functions it must be avoided when emulating otherwise the pc goes into an endless loop.

fore the sake of interest im programming a xbmc web viewer using a xbmc controlled pc as gw. the pc does the browsing and sends windows and links to xbmc. it looks very promissing but threaded sockets, timers and screen updates are a bit tricky to get 100% without lots of testing...

thanks,

matz
Reply

Logout Mark Read Team Forum Stats Members Help
Python Dev Tool: XBMC Emulator scripts0