XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-04-15, 20:34   #1
b01
Senior Member
 
Join Date: Nov 2003
Location: Southfield, MI
Posts: 114
b01 is on a distinguished road
Send a message via AIM to b01
Default

how would i go about getting a listing of the contents of a directory in python.

i want to get the names of the folders in the 'games' directory and store them in a list variable in python.

i've been reading the xbmc python doc, but have not figured this out yet. i also checked the python doc in the xbmc cvs, so i know there is no class already in the xbmc python libs to do this.

but there must be a method to get file and directory names with python!
__________________
reading must be magical or something, it's how i find all da anwsers!
------
Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300
b01 is offline   Reply With Quote
Old 2004-04-15, 22:07   #2
alx5962
Senior Member
 
Join Date: Jan 2004
Posts: 174
alx5962 is on a distinguished road
Default

the os library builtin python will do that
alx5962 is offline   Reply With Quote
Old 2004-04-16, 06:18   #3
b01
Senior Member
 
Join Date: Nov 2003
Location: Southfield, MI
Posts: 114
b01 is on a distinguished road
Send a message via AIM to b01
Default

thanks alot, i now know how to retrieve list from directories with:

os.listdir(path)

i took screenshots, but i cant post them just yet.
__________________
reading must be magical or something, it's how i find all da anwsers!
------
Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300
b01 is offline   Reply With Quote
Old 2004-04-17, 02:54   #4
b01
Senior Member
 
Join Date: Nov 2003
Location: Southfield, MI
Posts: 114
b01 is on a distinguished road
Send a message via AIM to b01
Default

im trying to use the get dvd state function in the xbmc lib, like so:

Quote:
if XBMC.getdvdstate() == -16:

but i get the attributerror: 'module' object has no attribute ' getdvdstate'

i know i saw this in the xbmc python doc, but how do i get the state of the dvd rom drive?
__________________
reading must be magical or something, it's how i find all da anwsers!
------
Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300
b01 is offline   Reply With Quote
Old 2004-04-17, 11:07   #5
xsintill
Member
 
Join Date: Dec 2003
Posts: 39
xsintill is on a distinguished road
Default

do you have cvs build 13-04-2004 or later?

i see a mixup in your module name.... XBMC should be xbmc...
xsintill is offline   Reply With Quote
Old 2004-04-18, 03:08   #6
b01
Senior Member
 
Join Date: Nov 2003
Location: Southfield, MI
Posts: 114
b01 is on a distinguished road
Send a message via AIM to b01
Default

i posted this late last night so that was a typo, it is correct in the script.

i do not have xbmc 13-04-2004 build. i currently do not have .net installed on my pc, becuase i'm waiting to get a bigger hdd (only got a 20gb right now). so i have no way to complie the cvs.


ok, i went to the cvs and dowloaded the makedoc.py and ran it on my xbmc and getdvdstatus is not in the build i have. so i have to get the latest build if i want to use that function.

btw darkie i luv dat makedoc.py, it really helps. the makedoc script combined with alx5962's examples make learning python for xbmc simple.
__________________
reading must be magical or something, it's how i find all da anwsers!
------
Ubuntu 8.10 (64bit) | AMD Sempron 2600+ | ATi 2400HD Pro | Asus AE1 Barebone ---- Ubuntu 9.04RC (64bit) | AMD 5000+ | BIOSTAR TA790GX XE w/ ATi 3300
b01 is offline   Reply With Quote
Old 2004-04-18, 12:48   #7
alx5962
Senior Member
 
Join Date: Jan 2004
Posts: 174
alx5962 is on a distinguished road
Default

darkie and i added getdvdstatus only few days ago so there's no cvs compile yet available including it.
so wait for a newer xbmc cvs build.
alx5962 is offline   Reply With Quote
Old 2004-04-19, 16:17   #8
carlosp_uk
Member
 
Join Date: Apr 2004
Posts: 47
carlosp_uk is on a distinguished road
Default

i'm also waiting for a new anonymous cvs build so i can use the latest python methods - can anyone who knows the right people please do some nudging?
carlosp_uk is offline   Reply With Quote
Old 2004-04-19, 21:17   #9
alx5962
Senior Member
 
Join Date: Jan 2004
Posts: 174
alx5962 is on a distinguished road
Default

the latest official release doesn't include our latest methods...
weird!
alx5962 is offline   Reply With Quote
Old 2004-06-05, 16:29   #10
alvette78
Junior Member
 
Join Date: Jun 2004
Posts: 1
alvette78 is on a distinguished road
Default

Quote:
Originally Posted by (b01 @ april 16 2004,04:18)
thanks alot, i now know how to retrieve list from directories with:

os.listdir(path)

i took screenshots, but i cant post them just yet.
could you post the script you created
alvette78 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shortcut to directory cayotic XBMC for Xbox Specific Support 3 2004-12-23 20:26
Cd ripping directory cbushy XBMC for Xbox Specific Support 1 2004-11-22 15:36
Cant change directory in FTP foof XBMC for Xbox Specific Support 7 2004-05-18 18:32
List mode (Icon vs List etc) tharvey XBMC for Xbox Specific Support 7 2004-05-06 04:50
Upp one directory level roadrash XBMC Feature Suggestions 1 2004-04-06 13:13


All times are GMT +2. The time now is 14:35.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project