Problems with my first program - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Problems with my first program (/showthread.php?tid=26092) |
Problems with my first program - El Piranna - 2007-05-01 Really, first and a half :p Well, i tried what Nuka1195 and Asteron suggested me with almost no results... but at least i could be able to found some bugs (i has had some classes def ended with '()' that XBMC Phyton 2.4.3 doesn't tolerated so well as PC Phyton 2.5) and another interesting things, as that XBMC Python console is auto-updated but it doesn't work (fully), so let's go with it: I'm aiming to do XUT, Xbox Unix Tools. This is a set of python apps to allow to have a shell on the XBox to be able to use it by us the old-school guys It have PySH (Python SHell, a bask-like/Windows shell mixture written in phyton. Yes, i know there are similar proyects and in fact there is another PySH, but they want python compatibility, I don't: just bash), xTerm (xbox Terminal, a local console) and xTTY (xbox TTY, a remote console). xTTY is the most incomplete since by now only work almost correctly in a unidireccional way and sending raw data, but i aim to make it telnet compatible (or integrate it into medusa, who would be the better opcion...), but at least it write to the XBMC Python console, so i know it work at the same state as PC version :p PySH work correctly in PC and after repair some little problems compounding paths in XBMC too (i know it thanks to xTTY). It doesn't have too much commands, but at least it can navigate over the directory tree and show you things. The more problematic and the real point for this message is xTerm. I can launch it, i can be able to input data with the onscreen keyboard... but it doesn't show me nothing. It should show a big controlLabel at all over the screen and update its content with the console text, but it only shows me the content of scripts folder as background. Yes, i know: labels background is transparent, but i should be able to see letters written over it, isn't it? Here i have uploaded the 'XUT 0.1 alpha dangerous.it.beat.you' code if someone can help me with that Download XUT.zip - Asteron - 2007-05-01 In regard to your question from the other thread Quote:At the readme (http://xbmc.svn.sourceforge.net/view...xt?view=markup) it says that modules as xbmc.py and xbmcgui.py should be installed on Lib directory, but that directory doesn't exist. I have been looking for all the XBMC source tree without success, so where is that code? Where i can go to see it and try to expand it? The xbmc and xbmcgui modules are implemented only in the cpp code. The objects are programmed into the interpreter programmaticly using the C interface. To see where this is done look here: http://xbmc.svn.sourceforge.net/viewvc/xbmc/trunk/XBMC/xbmc/lib/libPython/xbmcmodule/ Also if you are ever on irc feel free to stop by irc://irc.freenode.net/xbmc-scripting as lots of us hang out there. In the future please just paste the code (with the "CODE" tag) or use a pastebin like http://www.pastebin.ca .. That putstuff website is kinda annoying... EDIT: This code is actually kinda fun... For a 'first program' its very nice I cant tell you exactly whats wrong with it yet but a few things caught my eye Code: def onAction(self, action): Code: if car == '\n': - El Piranna - 2007-05-01 Asteron Wrote:In regard to your question from the other thread Thanks, remembered that i have see a "windowsXML.cpp" somewhere... Ok: are hardcoded inside libPython, not an external module. Now i know where to start... telling it on the wiki :p IRC... well, i hate chat I must to use it at the ARDE directives reunions but i preffer e-mail or foums. In any case, thanks for the offer. And yes, i'll try to use PasteBin or similar, or at least not put urls on the fly Asteron Wrote:EDIT: There is a lot of Copy&Paste and something about "copy from the book" But yes, i have been programming since some years ago... :p Asteron Wrote:I cant tell you exactly whats wrong with it yet but a few things caught my eye I'll go to see for it. In any case i'm thinking it was for the first trying, but in any case at this point it is yet redirected to the xTerm class, so there would have no problems... Asteron Wrote: Yeah, it's true... I need to put all the routine to add a row (the code to remove it too), so i have created a CR (CarriadgeReturn) function and call it from both sides. Thanks a lot!!! P.D.: I hate when the forum rules don't allow me to put as smileis as i want... - Nuka1195 - 2007-05-01 add Quote:self.show()to __init__() - El Piranna - 2007-05-02 Nuka1195 Wrote:add Hooray, we g0t r00t!!! Yes, self.show() gave me an error on python scripts emulator but it worked on my XBox I have got a little problem with label width showing me three dots (curious: a high demanded solution for others is a problem for me :p), i'll go now to get actual resolution and put it on label size, and maybe i'll think a routine to get an adaptative console size (a constant wide font would be really fine for this...). Now, the important question is... what commands do you want on it? :p Remember that i have designed xTerm for "theorically" could be able to run terminal programs without adapt them (if you look inside PySH code you wouldn't found any reference to xTerm or xTTY or any "strange" import line...). Maybe add a "real" shell as "authentic" PySH, PyShell or IPhyton? I think the best would be a custom made shell fully integrated on XBMC and add some interesting ideas from those others (i will canibalize original PySH since is almost dead but is who has most common ideas with what i want: almost only a bash compatible shell made in python...) - El Piranna - 2007-05-02 Well, as promised, here is the code PySH Code: import xbmc, os, string xTerm Code: # xTerm - Xbox Terminal I have found a little bug on xTerm on XBMC (not on python emulator) when you send it a lot of data (i have it with "set" command to show all system variables) making that don't make return carriages, goes out by the right and you can see more info. I really don't know why it happens... Oh, and... err... there is defined a monospace font on XBMC or i have to include it with the terminal? Fosphore green console is not enough 633|<... :p |