本文整理汇总了Python中database.DataBase.get_username_and_password方法的典型用法代码示例。如果您正苦于以下问题:Python DataBase.get_username_and_password方法的具体用法?Python DataBase.get_username_and_password怎么用?Python DataBase.get_username_and_password使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database.DataBase
的用法示例。
在下文中一共展示了DataBase.get_username_and_password方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __add_user
# 需要导入模块: from database import DataBase [as 别名]
# 或者: from database.DataBase import get_username_and_password [as 别名]
def __add_user(self, unused, radio, vbox):
'adds a new user to the list'
from auth import Auth
Auth()
gtk.main()
from database import DataBase
database = DataBase()
users = database.get_username_and_password()
current_users = [user.get_label() for user in vbox.get_children()[0].\
get_child().get_child().get_child().get_children()]
for user in users:
if str(user[0]) not in current_users:
vbox.get_children()[0].get_child().get_child().get_child().\
pack_start(gtk.RadioButton(radio, str(user[0])))
from way2sms import login
import thread
thread.start_new_thread(login, (user[0], user[1], True))
vbox.get_children()[0].get_child().get_child().get_child().show_all()
return False
示例2: Thread
# 需要导入模块: from database import DataBase [as 别名]
# 或者: from database.DataBase import get_username_and_password [as 别名]
self.thread = Thread(target = self._runner, args = (user, password))
def start(self):
self.thread.start()
return
def isAlive(self):
return self.thread.isAlive()
def getStatus(self):
return self._login_status
def _runner(self, user, password):
return_value = login(user, password)
self._login_status = (return_value != 'Network Error') and True or False
return
gtk.gdk.threads_init()
database = DataBase()
if not database.has_default():
from gui.auth import Auth
Auth(True)
gtk.main()
if database.has_default():
login_thread_list = [LoginThread(user[0], user[1]) for user in database.get_username_and_password()]
for thread in login_thread_list:
thread.start()
Interface(login_thread_list)
gtk.main()
sys.exit(0)