+
    ÖÇÜh/  ã                   óT   € R t ^ RIt^ RIt^ RIHt RR lt ! R R4      tR	R ltR tR# )
z8
Authentication utilities to accompany `twitterclient`.
N)ÚTwythonc                ó8   € \        4       P                  WVR7      # )z)
Convenience function for authentication
©Ú
creds_fileÚsubdirÚverbose)ÚAuthenticateÚ
load_credsr   s   &&&Ú3/usr/lib/python3/dist-packages/nltk/twitter/util.pyÚcredsfromfiler      s#   € ô ‹>×$Ñ$Ø°gð %ó ð ó    c                   ó>   a € ] tR t^t o RtR tRR ltRR ltRtV t	R# )	r   z*
Methods for authenticating with Twitter.
c                óÌ   € R V n         RV n        / V n         \        P                  R,          V n        V P
                  V n        R#   \         d    RT n        RT n         R# i ; i)zcredentials.txtNÚTWITTER)r   Úcreds_fullpathÚoauthÚosÚenvironÚtwitter_dirÚcreds_subdirÚKeyError)Úselfs   &r
   Ú__init__ÚAuthenticate.__init__!   s[   € Ø+ˆŒØ"ˆÔàˆŒ
ð	%Ü!Ÿz™z¨)Õ4ˆDÔØ $× 0Ñ 0ˆDÖøÜô 	%Ø#ˆDÔØ $ˆD×ð	%ús   —-A ÁA#Á"A#Nc                ó,  € Ve   Wn         Vf   V P                  f   Rp\        V4      hMW n        \        P                  P                  \        P                  P                  V P                  V P                   4      4      V n        \        P                  P                  V P                  4      '       g   \        RV P                   24      h\        V P                  4      ;_uu_ 4       pV'       d   \        RV P                   24       V FK  pRV9   g   K  VP                  R^4      w  rxVP                  4       V P                  VP                  4       &   KM  	  RRR4       V P                  VR7       V P                  #   + '       g   i     L.; i)a§  
Read OAuth credentials from a text file.

File format for OAuth 1::

   app_key=YOUR_APP_KEY
   app_secret=YOUR_APP_SECRET
   oauth_token=OAUTH_TOKEN
   oauth_token_secret=OAUTH_TOKEN_SECRET


File format for OAuth 2::

   app_key=YOUR_APP_KEY
   app_secret=YOUR_APP_SECRET
   access_token=ACCESS_TOKEN

:param str file_name: File containing credentials. ``None`` (default) reads
    data from `TWITTER/'credentials.txt'`
NzCannot find file zReading credentials file Ú=)r   zQSupply a value to the 'subdir' parameter or set the TWITTER environment variable.)r   r   Ú
ValueErrorr   ÚpathÚnormpathÚjoinr   ÚisfileÚOSErrorÚopenÚprintÚsplitÚstripr   Ú_validate_creds_file)	r   r   r   r   ÚmsgÚinfileÚlineÚnameÚvalues	   &&&&     r
   r	   ÚAuthenticate.load_creds-   s@  € ð* Ò!Ø(ŒOàŠ>Ø× Ñ Ò(ð?ð ô ! “oÐ%ð )ð !'Ôä Ÿg™g×.Ñ.Ü�G‰G�L‰L˜×*Ñ*¨D¯O©OÓ<ó
ˆÔô �w‰w�~‰~˜d×1Ñ1×2Ò2ÜÐ-¨d×.AÑ.AÐ-BÐCÓDÐDä�$×%Ñ%×&Ô&¨&ßÜÐ1°$×2EÑ2EÐ1FÐGÔHã�Ø˜$–;Ø"&§*¡*¨S°!Ó"4‘K�DØ/4¯{©{«}�D—J‘J˜tŸz™z›|Ó,ñ ÷	 'ð 	×!Ñ!¨'Ð!Ô2à�z‰zÐ÷ '×&ús   Ã+*FÄAFÆF	c                ó  a € Rp. R
OpRp. ROp\         ;QJ d    V 3R lV 4       F  '       d   K   RM	  RM! V 3R lV 4       4      '       d   RpMB\         ;QJ d    V 3R lV 4       F  '       d   K   RM	  RM! V 3R lV 4       4      '       d   RpV'       gK   V'       gC   RS P                   R2pV\        P                  ! S P                  4      ,          p\        V4      hV'       d   \        RS P                   R24       R	# R	# )z%Check validity of a credentials file.Fc              3   ó@   <"  € T F  qSP                   9   x € K  	  R # 5i©N©r   ©Ú.0Úkr   s   & €r
   Ú	<genexpr>Ú4Authenticate._validate_creds_file.<locals>.<genexpr>i   s   øé € Ð4© 1�D—J‘JŽ«ùó   ƒTc              3   ó@   <"  € T F  qSP                   9   x € K  	  R # 5ir/   r0   r1   s   & €r
   r4   r5   k   s   øé € Ð6©+ Q�d—j‘j–«+ùr6   z Missing or incorrect entries in Ú
zCredentials file "z" looks goodN)Úapp_keyÚ
app_secretÚoauth_tokenÚoauth_token_secret)r9   r:   Úaccess_token)Úallr   ÚpprintÚpformatr   r   r#   )r   r   Úoauth1Úoauth1_keysÚoauth2Úoauth2_keysr'   s   f&     r
   r&   Ú!Authenticate._validate_creds_filec   s»   ø€ àˆÚTˆØˆÚ?ˆß‹3Ô4©Ó4�3�3Š3Ô4©Ó4×4Ò4Ø‰Fß‹SÔ6©+Ó6�S�SŠSÔ6©+Ó6×6Ò6ØˆFçŸ&Ø4°T·_±_Ð4EÀRÐHˆCØ”6—>’> $§*¡*Ó-Õ-ˆCÜ˜S“/Ð!ßÜÐ& t§¡Ð&7°|ÐDÖEñ r   )r   r   r   r   r   ©NNF)F)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r	   r&   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r
   r   r      s!   ø‡ € ñò
%ô4÷lFò Fr   r   c                ó�  € V fD   \         P                  P                  \        4      p\         P                  P	                  VR4      p \        V R7      pVR,          pVR,          p\        W4^R7      pVP                  4       pRV R2p\        V R	4      ;_uu_ 4       p\        WxR
7       RRR4       R#   + '       g   i     R# ; i)zW
For OAuth 2, retrieve an access token for an app and append it to a
credentials file.
Nzcredentials2.txt)r   r9   r:   )Úoauth_versionzaccess_token=r8   Úa)Úfile)
r   r   ÚdirnameÚ__file__r   r   r   Úobtain_access_tokenr"   r#   )	r   r   rC   r9   r:   Útwitterr=   Útokr(   s	   &        r
   Úadd_access_tokenrX   v   s�   € ð
 ÒÜ�w‰w�‰œxÓ(ˆÜ—W‘W—\‘\ $Ð(:Ó;ˆ
Ü jÔ1€FØ�YÕ€GØ˜Õ%€Jä�g¸Ô;€GØ×.Ñ.Ó0€LØ˜,˜ rÐ
*€CÜ	ˆj˜#×	Ô	 &ÜˆcÕ÷ 
×	×	Ò	ús   ÂB4Â4C	c                óÊ   € \         P                  P                  V 4      '       d   V # \         P                  P                  \         P                  P	                  RV 4      4      # )z³
If the path is not absolute, guess that it is a subdirectory of the
user's home directory.

:param str pth: The pathname of the directory where files of tweets should be written
Ú~)r   r   ÚisabsÚ
expanduserr   )Úpths   &r
   Ú
guess_pathr^   ‰   s@   € ô 
‡w�w‡}�}�S×ÒØˆ
ä�w‰w×!Ñ!¤"§'¡'§,¡,¨s°CÓ"8Ó9Ð9r   rF   r/   )	rK   r   r?   Útwythonr   r   r   rX   r^   © r   r
   Ú<module>ra      s3   ðñó 
Û å ô÷WFñ WFôt ô&
:r   