本文整理汇总了Python中api.PokeAuthSession.createRequestsSession方法的典型用法代码示例。如果您正苦于以下问题:Python PokeAuthSession.createRequestsSession方法的具体用法?Python PokeAuthSession.createRequestsSession怎么用?Python PokeAuthSession.createRequestsSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api.PokeAuthSession
的用法示例。
在下文中一共展示了PokeAuthSession.createRequestsSession方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sortCloseForts
# 需要导入模块: from api import PokeAuthSession [as 别名]
# 或者: from api.PokeAuthSession import createRequestsSession [as 别名]
elif option == 4:
suboption = 0
forts = sortCloseForts(session)
while suboption > -1:
i = 0
for fort in forts:
print ( "[" + str(i) + "]" + str(fort))
i = i + 1
print('[ -1 ]: Back')
suboption = input("Walk to fort? ")
if suboption != -1:
print walkAndSpin(session, forts[suboption])
forts.remove(fort)
# Entry point
# Start off authentication and demo
if __name__ == '__main__':
setupLogger()
logging.debug('Logger set up')
token = 'eyJhbGciOiJSUzI1NiIsImtpZCI6IjM5NGNiYjk4OTdmOGZiMmYzMzY0NTMzMmEyMTU0MDk5YTk1ZTI1OWYifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXVkIjoiODQ4MjMyNTExMjQwLTdzbzQyMWpvdHIyNjA5cm1xYWtjZXV1MWx1dXEwcHRiLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwic3ViIjoiMTExNjc4NjkwMjc5NTg4MzQ5MTIxIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImF6cCI6Ijg0ODIzMjUxMTI0MC0zdmRydHJmZG50bGpmMnU0bWxndG5ubGhuaWduMzVkNS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImVtYWlsIjoiam04bmF2QGdtYWlsLmNvbSIsImlhdCI6MTQ2OTkxNzkxNiwiZXhwIjoxNDY5OTIxNTE2LCJuYW1lIjoiSm9zZSBNaWd1ZWwgTmF2YXJybyBJZ2xlc2lhcyIsInBpY3R1cmUiOiJodHRwczovL2xoMy5nb29nbGV1c2VyY29udGVudC5jb20vLVh1Zzk3b2F2TXljL0FBQUFBQUFBQUFJL0FBQUFBQUFBVThZL2lkc0VneDBkU0tFL3M5Ni1jL3Bob3RvLmpwZyIsImdpdmVuX25hbWUiOiJKb3NlIE1pZ3VlbCIsImZhbWlseV9uYW1lIjoiTmF2YXJybyBJZ2xlc2lhcyJ9.d1W12odZnEScMvDGD643P9uIQ3IuycMmZFDwHKm1I8ILKYgz2bKUro_D47qer3muZajTXuehJ32Hjel3MPbb5H_DoOyO1AkzROHy6_EdxxBR_uM5jkMWUtFc1FRguZ8T47sFMR0-1ckCdP6S3ymvBiMkMA8rXj5QHljcT8tsMEf2HQ5iABYUYZ-gpmBwGEebTwzsBQQaN_m9JXe1nWoQcsC33unaLVOHUekRF7p3q8HyX-TDwPaDeMmgrEJR5dEFQjjthNyaJOo1AbkW-5guFrYvHAkdrwS8eHJS_LxZh0z902SRQR-cA8WBZRxkkZA0EvqGITniich12xG6ABVRGA'
location = Location('Brussels', None)
req_session = PokeAuthSession.createRequestsSession()
session = PogoSession(req_session, 'google', token, location)
if session:
manual(session)
else:
logging.critical('Session not created successfully')
sys.exit(-1)