Module Expr Str TryExcept body Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Import alias Assign NameStore Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Print Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Print Print Str Print AttributeLoad NameLoad attr Print Import alias If CompareEq Call NameLoad Call AttributeLoad NameLoad attr Str Num body Import alias Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Str While CompareEq Call AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Print Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str SubscriptLoad NameLoad Index Str Print Print Str Print
N/A N/A 
This example implements Kuaipan OAuth. (http://www.kuaipan.cn/developers/document_oauth.htm)

Requirement :
    * Python oauth2 (https://pypi.python.org/pypi/oauth2/)
    * Python poster (https://pypi.python.org/pypi/poster/)

Howto -
Step 1:
    Set proper "consumer_key" and "consumer_secret" for your account
    You may get "consumer_key" and "consumer_secret" at URL "http://www.kuaipan.cn/developers/list.htm"

Step 2:
    Run "python Kuaipan_OAuth.py" in your environment

Step 3:
    If you work on Windows system, the authentication URL would be open in you default browser directly. Otherwise, you should copy/paste the URL printed on console screen.

Step 4:
    If everything work well, you should get the autenticated key-paire at final step.

 N/A N/A N/A read_input raw_input N/A N/A N/A NameError N/A N/A read_input input N/A Kuaipan N/A consumer_key your_kuaipan_consumer_key N/A consumer_secret your_kuaipan_consumer_secret N/A kuaipan_oauth N/A N/A Kuaipan KuaipanOAuth consumer_key consumer_secret N/A request_token N/A N/A kuaipan_oauth GetRequestToken N/A Request Token: N/A N/A     - oauth_token        = %s N/A request_token N/A oauth_token N/A N/A     - oauth_token_secret = %s N/A request_token N/A oauth_token_secret N/A N/A Go to the following link in your browser: N/A N/A kuaipan_oauth AuthenticationUrl N/A N/A platform N/A N/A N/A cmp N/A N/A platform system Windows 0 N/A N/A webbrowser N/A N/A N/A webbrowser open N/A kuaipan_oauth AuthenticationUrl N/A accepted n N/A N/A N/A N/A accepted lower n N/A N/A accepted N/A read_input Have you authorized me? (y/n)  N/A oauth_verifier N/A read_input What is the PIN?  N/A access_token N/A N/A kuaipan_oauth GetAccessToken oauth_verifier N/A Access Token: N/A N/A     - oauth_token        = %s N/A access_token N/A oauth_token N/A N/A     - oauth_token_secret = %s N/A access_token N/A oauth_token_secret N/A N/A You may now access protected resources using the access tokens above. N/A