xboxscene.org forums

Author Topic: Script Browser?  (Read 146 times)

GAT

  • Archived User
  • Newbie
  • *
  • Posts: 14
Script Browser?
« on: April 20, 2005, 02:39:00 PM »

I have been trying to figure this one out if any one uses it please explain how
to setup and modify py. file


                                Thanks
                                Gary
Logged

spongy

  • Archived User
  • Full Member
  • *
  • Posts: 109
Script Browser?
« Reply #1 on: May 08, 2005, 11:31:00 AM »

I have tried this script a few times since it came out. Without a single success.

  After reading your post, I decided to get it running once and for all.

   The steps I took
1.  I deleted all scripts, and made sure I had the latest python and latest library.
2.  I included only scriptbrowser and one script. A script that was confirmed working and had no problems launching from within it's own folder.
3.  Tried to launch. Without success.
4.  Pressed the white button on the controler to get error log.

Here is what mine said
QUOTE
                     Scripts Output

-->Python Initialized<--
Traceback [most recent call last]:
   File "Q:\scripts\scriptbrowser\scriptbrowser.py", line 106, in ?
     sb = mainClass[]
   File "Q:\scripts\scriptbrowser\scriptbrowser.py", line 61, in__init__
     self.newsel[]
   File "Q:\scripts\scriptbrowser\scriptbrowser.py", line 96, in newsel
     sleep[0.01]
NameError: global name 'sleep' is not defined

 5.  Knowing my error "global name 'sleep' is not defined". I searched the xml and found this section.
QUOTE
   def newSel(self):
  sleep(0.01)
  self.infolabel.setLabel(self.getSelItem())
  self.debuglabel.setLabel(self.getScriptPath() + self.getSelItem() + ".py")

  self.removeControl(self.infoimage)
  del self.infoimage
  self.infoimage = xbmcgui.ControlImage(75,125,100,100,self.getScriptPath() + "\\icon.jpg")
  self.addControl(self.infoimage)

6.  I then deleted this line from the xml.
QUOTE
  sleep(0.01)

It works  :D
7.  Spent two hours setting up all my scripts to work with it / making icons etc.
8.  Used it
9.  Deleted it, replaced with backup.
10. Went back to using scriptionary.

Things I didn't like about scriptbrowser.
Script list ran off the page. Can't see highlighted script when scrolled down.
Script name/icon on the left often didn't match the script highlighted on the right.
Listed items I didn't want listed.(autoexec,HttpCache).


Note: I know nothing about python, scripting, or what this section of the xml does and why.(may have introduced bugs)

Use your white button to get your error msg. If the same, try deleting that line. If different, post error msg here or the official forums. Maybe someone that knows what they're doing will help.

      Good luck
Logged

spongy

  • Archived User
  • Full Member
  • *
  • Posts: 109
Script Browser?
« Reply #2 on: May 08, 2005, 02:46:00 PM »

Scriptionary can be found here.


I meant the .py not .xml in my first post. :uhh:
Logged

nuka1195

  • Archived User
  • Sr. Member
  • *
  • Posts: 290
Script Browser?
« Reply #3 on: May 08, 2005, 03:32:00 PM »

GAT,

I forgot I did add the following to get this working. I just don't use it anymore. You do need the sleep for the script to be more stable.

Put the following just below the import statement at the top of the file.

from time import sleep

QUOTE
Script name/icon on the left often didn't match the script highlighted on the right.

EDIT: @Spongy, Using he triggers may have caused your problem, also the sleep will help with that.

This post has been edited by nuka1195: May 8 2005, 10:34 PM
Logged

spongy

  • Archived User
  • Full Member
  • *
  • Posts: 109
Script Browser?
« Reply #4 on: May 08, 2005, 04:07:00 PM »

QUOTE(nuka1195 @ May 8 2005, 12:31 PM)
I just don't use it anymore.
*


What do you use to browse scripts ? Submenu ?


Thanks for the proper fix for my error.  :beer:  

I will try it later. Hopefully it will fix the bugs I had.

Is there any way too ignore certain files/folders in scriptbrowser ?
I don't use autoexec, so I just deleted it. but I do have some folders I would like ignored.
Logged

nuka1195

  • Archived User
  • Sr. Member
  • *
  • Posts: 290
Script Browser?
« Reply #5 on: May 08, 2005, 04:30:00 PM »

I just go straight to the scripts screen. I have all the scripts main py files there with an associated tbn (thumbnail) and their supporting files in a subfolder of a subfolder. This cleans the list up.

To get scriptbrowser to work nice and keep it clean, you'll have to bury the scripts you want ignored in a folder of a folder. You'll also have to make sure the only py file you want listed is in the scripts folder. This requires some editing of the py's.

I like the scripts screen better, though I think the scriptbrowser was a good idea.
Logged