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-07, 19:07   #1
EminaZ
Junior Member
 
Join Date: Jan 2004
Posts: 11
EminaZ is on a distinguished road
Default

# hi, i am trying to write a script that would auto execute upon xbmc's opening. this script will ask for a password, if the password doesn't equal that something, then xbmc will exit the program.

-----------------------------------------------------------
# imports
import xbmc,xbmcgui
from time import *

#initial stuff
dialog = xbmcgui.dialog()
pdialog = xbmcgui.dialogprogress()
sleeptime = 0
shutdowntime = 0
doit = 0
pwl = "

# defs #

def getuserinput():
pdialog.create('password','press cancel to enter password.')
pdialog.update(100/10)
if pdialog.iscanceled():
pdialog.close()
keyboard = xbmc.keyboard('')
keyboard.domodal()

if (keyboard.isconfirmed()):
return keyboard.gettext()
else:
return 0
pwl = getuserinput()
if pwl != "eminaz"
doit = 1


#waits.... and finally shut down the box
def doshutdown():
global doit
if doit == 1:
xbmc.player().stop()
pdialog.close()
xbmc.shutdown()

#main
def main():
showtimesdialog()
doshutdown()

main()

-------------------------------------------------
i didn't write all of that, to be honest. i borrowed some of the code from vultain and alx.

i don't know much about pything, but it is kind of like flash actionscripts, which i am experienced with.
EminaZ is offline   Reply With Quote
Old 2004-04-08, 03:47   #2
EminaZ
Junior Member
 
Join Date: Jan 2004
Posts: 11
EminaZ is on a distinguished road
Default

any help would be appreciated.
EminaZ is offline   Reply With Quote
Old 2004-04-08, 05:31   #3
madtw
Senior Member
 
Join Date: Mar 2004
Posts: 174
madtw is on a distinguished road
Default

where is the code for showtimesdialog()? the main function calls it but we don't get to see what it does.

also, the forum must've messed up some of the indentation so it is hard to know what the logic is exactly...
madtw is offline   Reply With Quote
Old 2004-04-08, 10:18   #4
ent
Member
 
Join Date: Mar 2004
Posts: 74
ent is on a distinguished road
Default

Quote:
use the code tags
ent 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
Does anyone can write a python to view web? hibaby Plugin/Script (Python) Help and Support 1 2005-07-27 19:29
Possible to write a server via the python api? tharvey Plugin/Script (Python) Development 7 2005-02-08 07:21
Cddb / imd write .tbn file? sarnman XBMC Feature Suggestions 2 2004-12-20 00:51
Does XBMC write to the Xbox's EEPROM? tullm XBMC General Discussion 3 2004-10-12 19:47
os.write() messed up? madtw Plugin/Script (Python) Development 2 2004-05-07 18:45


All times are GMT +2. The time now is 15:32.


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