Reply
Thread Tools
Posts: 36 | Thanked: 7 times | Joined on Jun 2012
#1
Hi there,

i use a Python script to login to my providers Hotspots. (without a visit of the providers webpage and enter data manually) But the script needs username and pw, sure. So, I think it's unsafe to safe both in the script. (everbody who get the phone can read them). I could implement a call to enter the pw, but I use the Command Execution Widget to exucute the script and have no idea to create soemthing like a popup window to enter the pw.
Did anybody deal with this safety problem in scripts?

Greetings
 
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
One possible way is to use a QInputDialog via the PyQt bindings, but this requires an instance of QApplication (and thus an event loop). There is probably also a GTK equivalent. Another way is to use zenity http://library.gnome.org/users/zenity/stable/. It seems that the PyZenity module is not available for Maemo5, but you can use zenity via the os.system() method, e.g

Code:
import os

credentials = os.system('zenity --password --username').split('|')

if len(credentials) >= 2:
    username = credentials[0].strip()
    password = credentials[1].strip() // remove leading/trailing whitespace
else:
    print "Problem with username/password"
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub

Last edited by marxian; 2013-01-13 at 23:23.
 

The Following 2 Users Say Thank You to marxian For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 09:47.