本文整理汇总了Python中User.User方法的典型用法代码示例。如果您正苦于以下问题:Python User.User方法的具体用法?Python User.User怎么用?Python User.User使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.User方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: closeEven
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def closeEven(self):
adi = self.txt_kayitAdi.text()
email = self.txt_kayitEmail.text()
sifre = self.txt_kayitSifre.text()
sifreTekrar = self.txt_kayitSifreTekrar.text()
u = User(adi, sifre, email,"")
if sifreTekrar == sifre:
try:
Mysql.üyeOl(u)
self.dialogTextBrowser.show()
self.close()
except Exception:
print(_uno_extract_printable_stacktrace())
else:
self.lbl_kayitSifreHata.setVisible(True)
示例2: show_user
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def show_user(user):
mb = MessageBox()
mb.set_title('User info for ' + user.name + ' (ID ' + str(user.id) + ')')
mb.add_property('Email', user.email)
mb.add_property('Last Login', user.last_login)
mb.add_property('Created On', user.creation_date)
mb.add_property('Handle', user.handle)
mb.add_property('Computer ID', str(user.computer.id))
mb.display()
# Shows information and contents about a specific computer disk
示例3: main
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def main():
gc.clear()
gc.typewriter(colored('\n\tWelcome to Hack the Planet!', 'green', attrs = ['bold']))
valid_choice = False
while not valid_choice:
gc.msg('\n 1. Log In')
gc.msg('2. Register')
gc.msg('3. Reset Password')
gc.msg('4. About Hack the Planet')
choice = cc.prompt_num()
# log in
if choice == '1':
login()
# register
elif choice == '2':
register()
# reset password
elif choice == '3':
u = User()
u.reset_password()
# about
elif choice == '4':
about()
# invalid
else:
gc.error('Invalid choice; please try again.')
## Navigation
# Shows a user's profile summary
示例4: login
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def login():
# check user credentials
user = User()
user.login()
profile(user, new_login = True)
# Register a new user account
示例5: register
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def register():
user = User()
user.register()
profile(user, new_login = True)
示例6: click
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def click(self):
ad = self.lineEdit.text()
sifre = self.lineEdit_2.text()
u=User.User(ad,sifre,"")
print("user olu?turuldu")
if Mysql.getir(u):
if self.checkBox.isChecked():
from anasayfa import AnaSayfa
self.anasayfa=AnaSayfa()
self.anasayfa.show()
basla=TarayiciTaramaBaslat(self)
else:
print ("basarisiz")
示例7: operate
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def operate(self):
if not self.parse():
return True
print self.get_title()
while True:
op = raw_input("zhuanlan$ ")
if op == "content":
self.get_content()
elif op == "author":
url = self.get_author_info()
if not url:
print termcolor.colored("?????????", "red")
else:
from User import User
user = User(url)
if user.operate():
return True
elif op == "voteup":
self.vote(type=1)
elif op == "votecancle":
self.vote(type=2)
elif op == "pwd":
print self.get_title()
elif op == "browser":
self.open_in_browser()
elif op == "clear":
clear()
elif op == "break":
break
elif op == "help":
self.help()
elif op == "quit":
return True
else:
error()
示例8: operate
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def operate(self):
self.show_item_info()
while True:
op = raw_input("Question Answer Item$ ")
if op == "voteup":
self.vote_up_answer()
elif op == "votedown":
self.vote_down_answer()
elif op == "votecancle":
self.vote_cancle_answer()
elif op == "answer":
from Answer import Answer
answer = Answer(zhihu + self.get_answer_link())
if answer.operate():
return True
elif op == "author":
author_link = self.get_author_link()
if author_link:
user = User(zhihu + self.get_author_link())
if user.operate():
return True
else:
print termcolor.colored("????????", "red")
elif op == "pwd":
self.show_item_info()
elif op == "help":
self.help()
elif op == "break":
break
elif op == "clear":
clear()
elif op == "quit":
return True
else:
error()
示例9: addUser
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def addUser(self, user):
if not isinstance(user, User):
raise TypeError('%s is not a User object' % (user,))
user.setSerialNum(self.nextSerialNum())
user.externalId() # set unique id
UserManager.addUser(self, user)
user.save()
示例10: userClass
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def userClass(self):
"""Return the userClass, which is used by createUser.
The default value is UserKit.User.User.
"""
if self._userClass is None:
self.setUserClass(User)
return self._userClass
示例11: setUserClass
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def setUserClass(self, userClass):
"""Set the userClass, which cannot be None and must inherit from User.
See also: userClass().
"""
if not issubclass(userClass, User):
raise TypeError('%s is not a User class' % (userClass,))
self._userClass = userClass
示例12: addUser
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def addUser(self, user):
if not isinstance(user, User):
raise TypeError('%s is not a User object' % (user,))
self._cachedUsers.append(user)
if user.serialNum() in self._cachedUsersBySerialNum:
raise KeyError('a user with this number already exists')
self._cachedUsersBySerialNum[user.serialNum()] = user
示例13: login
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def login(self, user, password):
"""Return the user if the login is successful, otherwise return None."""
if not isinstance(user, User):
raise TypeError('%s is not a User object' % (user,))
result = user.login(password, fromMgr=True)
if result:
self._numActive += 1
return result
示例14: __init__
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def __init__(self, userid=None):
u"""??????userid?????????????session??header??????json?????????best_id?"""
if userid is None:
from User import User
s = User()
self.userid = s.signup()
else:
self.userid = userid
self._changebestid()
self.mobile = self._getusermobile()
示例15: loadUsers
# 需要导入模块: import User [as 别名]
# 或者: from User import User [as 别名]
def loadUsers():
# creates database.id if it doesnt exists yet
if not(os.path.isfile("database.id")):
open("database.id", "w").close()
with open("database.id", "r") as database:
for user in database:
u = json.loads(user)
newUser = User(u['id'], u['name'], u['hour'], u['minute'])
users[u['id']] = newUser
thread = Thread(target = checkTime, args = (u['id'],))
thread.start()
### Handle messages reiceved from users ###