本文整理汇总了Python中account.Account.login方法的典型用法代码示例。如果您正苦于以下问题:Python Account.login方法的具体用法?Python Account.login怎么用?Python Account.login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类account.Account
的用法示例。
在下文中一共展示了Account.login方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PrepareMPT
# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import login [as 别名]
class PrepareMPT():
def __init__(self):
self.adb_tools = AdbTools()
self.d = AutomationDevice().get_device()
self.account = Account(self.d)
self.fps = None
self.fps_full_file_name = '/system/build.prop'
self.fps_file_name = 'build.prop'
self.fps_file_name_mod = 'build_mod.prop'
self.blacklist = '/system/media/applist/blacklist.txt'
self.gesturehelper = '/system/bin/gesturehelper'
def check_fps(self):
self.fps = None
# check debug.sf.fps
self.adb_tools.adb_pull(self.fps_full_file_name, self.fps_file_name)
f_read = open(self.fps_file_name)
for line in f_read:
if not line:
break
if 'debug.sf.fps' in line:
print line.rstrip()
fps = line.rstrip().split('=')[1]
if fps:
self.fps = int(fps)
def modify_fps(self):
self.check_fps()
if not self.fps:
self.adb_tools.adb_remount()
self.adb_tools.adb_pull(self.fps_full_file_name, self.fps_file_name)
try:
f_read = open(self.fps_file_name)
f_write = open(self.fps_file_name_mod, 'w')
for line in f_read:
if not line:
break
if 'debug.sf.fps' in line:
line = line.replace('debug.sf.fps=0', 'debug.sf.fps=1')
f_write.write(line)
f_read.close()
f_write.close()
except Exception as e:
print(e)
self.adb_tools.adb_push(self.fps_file_name_mod, self.fps_full_file_name)
self.check_fps()
if self.fps:
print('change OK! fps = %s' % (self.fps))
self.adb_tools.adb_chmod('644', self.fps_full_file_name)
else:
print('change KO! fps = %s' % (self.fps))
else:
print('fps = %s' % (self.fps))
def close_screen_protect(self):
self.adb_tools.adb_remount()
self.adb_tools.adb_rm(self.blacklist)
self.adb_tools.adb_setprop('sys.settings.show', '1')
# login system
self.account.sleep()
self.account.wakeup()
self.account.login()
time.sleep(2)
# unlock the screen
apk_manager = ApkManager()
apk = 'Development.apk'
apk_info = apk_manager.get_apk_info(apk)
apk_manager.start_apk(apk)
time.sleep(1)
dev_option = self.d(packageName=apk_info.package_name, text=u'开发者选项')
if dev_option.exists:
dev_option.click()
time.sleep(1)
settings_apk = 'Settings.apk'
settings_apk_info = apk_manager.get_apk_info(settings_apk)
not_lock_screen = self.d(packageName=settings_apk_info.package_name, text=u'不锁定屏幕')
if not_lock_screen.exists:
not_lock_screen.click()
else:
print('not found not_lock_screen')
time.sleep(1)
apk_manager.close_apk(settings_apk)
time.sleep(1)
else:
print('not found dev_option')
apk_manager.close_apk(apk)
def prepare_mpt(self):
#.........这里部分代码省略.........
示例2: Gmail
# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import login [as 别名]
from account import Account
from gmail import Gmail
gmail = Gmail()
while True:
choice = input('1. Sign up\n2. Login\n')
if choice == '1':
new_account = Account()
elif choice == '2':
user_account = Account.login()
if user_account != None:
while True:
choice2 = input('1. Inbox\n2.Send Email\n')
if choice2 == '1':
inbx = gmail.inbox(user_account)
print(inbx)
choice3 = input('Enter the index of message to view (max {}) / -1 to go back: '.format(len(inbx)-1))
if int(choice3) == -1:
pass
else:
print(gmail.view_message(int(choice3),inbx))
elif choice2 == '2':
#to_email, msg, subject, user
t = input('To: ')
s = input('Subject: ')
m = input('Message: ')
gmail.send_email(t, m, s, user_account)
示例3: open
# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import login [as 别名]
f = open("account.txt","r")
account_list = []
while(True):
line = f.readline()
if(line):
temp = line.split()
account_list.append(temp)
else:
break
f.close()
user_rank = 0
t1 = time.time()
test = Account()
while(True):
if(test.login(account_list[0][0],account_list[0][1])):
break
init_time = time.time()
#to_be_searched = [1995234631]
#to_be_searched = [5102872939]
to_be_searched = read_users("to_be_searched.txt")
searched = read_users("searched.txt")
#to_be_searched = [3737537255]
searched = []
blogcrawler = BlogCrawler()
writefile = WriteFile()
f = open("count.txt","r")
line = f.readline()
line = line.strip()
sumcount = int(line)