a „oe†ã@s&dZddlmZdd„Zd dd„ZdS) zl a clumsy attempt at a macro language to let the programmer execute code on the server (ex: determine 64bit)é)Úis64bitc CsÐt|ttfƒr|g}|d}�zŒ|dkrpt ¡r>||dfWSz||dfWWStyj|dfYWS0�n,|dkrš||vr–ddl}|| ¡fWS�n|dkræddl}z||d| ¡fWWStyâ|| ¡fYWS0n¶|d k�r.z |d}Wnt�yd}Yn0||j   |d|¡fWS|d k�rdd |v�sL|d �sV|d fWS|d |fWS|dk�rœddl }ddl }||j  | ¡d|d¡fWStd|ƒ‚Wn td|t|ƒfƒ‚Yn0dS)ayallow the programmer to perform limited processing on the server by passing macro names and args :new_key - the key name the macro will create :args[0] - macro name :args[1:] - any arguments :code - the value of the keyword item :kwargs - the connection keyword dictionary. ??key has been removed --> the value to put in for kwargs['name'] = value érréÚÚgetuserNZgetnodeÚgetenvZ auto_securityÚuserzIntegrated Security=SSPIz'User ID=%(user)s; Password=%(password)sZfind_temp_test_pathZ adodbapi_testzUnknown connect string macro=%szError in macro processing %s %s)Ú isinstanceÚstrrÚPythonÚ IndexErrorÚgetpassrÚplatformZnodeÚenvironÚgetÚosÚtempfileÚpathÚjoinZ gettempdirÚ ValueErrorÚrepr) Ú macro_nameÚargsÚkwargsÚnew_keyr rZdfltrr©rú@C:\Program Files\Certbot\pkgs\adodbapi\process_connect_string.pyÚ macro_calls\ ÿ ÿ     ÿÿ ÿÿrFc Csàz |d}Wnty"d}Yn0t|tƒr:| |¡n |rF||d<z |d}Wntyhd}Yn0t|tƒr~||d<n(t|tƒr’||d<nt|tƒr¦| |¡z(|d|d<|d |d <|d |d <WntyàYn0d|v�r@z|d |d<WnBt�y>z|d |d<Wnt�y8tdƒ‚Yn0Yn0|�r”t|  ¡ƒD]@}|  d¡�rR|dd…}|  |¡}t |||ƒ\}} | ||<�qRz2|d} d| v�rÄ| ddk�rÄ|   d¡|d<Wnt�yÚYn0|S)zôattempts to inject arguments into a connection string using Python "%" operator for strings co: adodbapi connection object args: positional parameters from the .connect() call kvargs: keyword arguments from the .connect() call rNZconnection_stringrÚtimeoutrrÚpasswordéÚhostéZdatabaseÚdsnz3Must define 'connection_string' for ado connectionsZmacro_éZ proxy_hostú:ú[)r&ú])r r ÚdictÚupdateÚintr ÚKeyErrorÚ TypeErrorÚlistÚkeysÚ startswithÚpoprr) rrZ expand_macrosr#Za1ÚkwargrZ macro_coderZrsltÚsrrrÚprocessKsl    ÿ ÿ               ÿÿ  r3N)F)Ú__doc__rrrr3rrrrÚs Gÿ