Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias Import alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias alias alias alias Assign NameStore Call AttributeLoad NameLoad attr Str Str ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad For NameStore AttributeLoad AttributeLoad NameLoad attr attr body If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Raise Call NameLoad BinOpMod Str NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str With Call NameLoad Call NameLoad NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Str Str Return Call NameLoad Call NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpMod Call AttributeLoad NameLoad attr Str Str NameLoad Expr Call NameLoad Call NameLoad BinOpAdd NameLoad Str NameLoad Str Expr Call NameLoad Call NameLoad BinOpAdd NameLoad Str NameLoad Str Expr Call NameLoad NameLoad NameLoad Str TryExcept body With Call NameLoad NameLoad Str NameStore body Expr Call NameLoad ListLoad Str Str Str Str Call NameLoad NameLoad Str Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str keyword NameLoad keyword NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad Str NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore AttributeLoad Call NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num TryExcept body If CompareEq NameLoad Str body Print Call NameLoad NameLoad orelse If CompareEq NameLoad Str body Assign NameStore SubscriptLoad NameLoad Index Num Expr Call NameLoad NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index Num handlers ExceptHandler type NameLoad name NameStore body Print SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Return Num orelse Return Num decorator_list If CompareEq NameLoad Str body Expr Call NameLoad Call NameLoad
N/A N/A Do downloading and JSON parsing without additional dependencies. ::

    # Print latest released version of LE to stdout:
    python fetch.py --latest-version
    
    # Download letsencrypt-auto script from git tag v1.2.3 into the folder I'm
    # in, and make sure its signature verifies:
    python fetch.py --le-auto-script v1.2.3

On failure, return non-zero.

 distutils.version LooseVersion json loads os devnull environ os.path dirname join N/A re subprocess check_call CalledProcessError sys argv exit urllib2 build_opener HTTPHandler HTTPSHandler HTTPError N/A PUBLIC_KEY N/A N/A environ get LE_AUTO_PUBLIC_KEY -----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6MR8W/galdxnpGqBsYbq
OzQb2eyW15YFjDDEMI0ZOzt8f504obNs920lDnpPD2/KqgsfjOgw2K7xWDJIj/18
xUvWPk3LDkrnokNiRkA3KOx3W6fHycKL+zID7zy+xZYBuh2fLyQtWV1VGQ45iNRp
9+Zo7rH86cdfgkdnWTlNSHyTLW9NbXvyv/E12bppPcEvgCTAQXgnDVJ0/sqmeiij
n9tTFh03aM+R2V/21h8aTraAS24qiPCz6gkmYGC8yr6mglcnNoYbsLNYZ69zF1XH
cXPduCPdPdfLlzVlKK1/U7hkA28eG3BIAMh6uJYBRJTpiGgaGdPd7YekUB8S6cy+
CQIDAQAB
-----END PUBLIC KEY-----
 ExpectedError N/A Exception N/A N/A A novice-readable exception that also carries the original exception for
    debugging N/A HttpsGetter N/A object N/A __init__ N/A N/A self N/A N/A N/A Build an HTTPS opener. N/A N/A self _opener N/A build_opener N/A HTTPSHandler N/A handler N/A N/A self _opener handlers N/A N/A N/A isinstance handler HTTPHandler N/A N/A N/A N/A N/A N/A self _opener handlers remove handler N/A get N/A N/A self url N/A N/A N/A Return the document contents pointed to by an HTTPS URL.

        If something goes wrong (404, timeout, etc.), raise ExpectedError.

         N/A N/A N/A N/A N/A N/A N/A N/A self _opener open url read N/A N/A N/A N/A HTTPError IOError N/A exc N/A N/A N/A ExpectedError N/A Couldn't download %s. url exc N/A N/A write N/A N/A contents dir filename N/A N/A N/A Write something to a file in a certain directory. N/A N/A open N/A join dir filename w file N/A N/A N/A N/A file write contents N/A latest_stable_version N/A N/A get N/A N/A N/A Return the latest stable release of letsencrypt. N/A metadata N/A loads N/A get N/A N/A environ get LE_AUTO_JSON_URL https://pypi.python.org/pypi/letsencrypt/json N/A N/A str N/A max N/A N/A LooseVersion r N/A r N/A N/A N/A metadata N/A releases iterkeys N/A N/A re match ^[0-9.]+$ r N/A verified_new_le_auto N/A N/A get tag temp_dir N/A N/A N/A Return the path to a verified, up-to-date letsencrypt-auto script.

    If the download's signature does not verify or something else goes wrong
    with the verification process, raise ExpectedError.

     N/A le_auto_dir N/A N/A N/A environ get LE_AUTO_DIR_TEMPLATE https://raw.githubusercontent.com/letsencrypt/letsencrypt/%s/letsencrypt-auto-source/ tag N/A N/A write N/A get N/A le_auto_dir letsencrypt-auto temp_dir letsencrypt-auto N/A N/A write N/A get N/A le_auto_dir letsencrypt-auto.sig temp_dir letsencrypt-auto.sig N/A N/A write PUBLIC_KEY temp_dir public_key.pem N/A N/A N/A N/A open devnull w dev_null N/A N/A N/A check_call N/A openssl dgst -sha256 -verify N/A join temp_dir public_key.pem -signature N/A join temp_dir letsencrypt-auto.sig N/A join temp_dir letsencrypt-auto stdout dev_null stderr dev_null N/A N/A N/A CalledProcessError N/A exc N/A N/A N/A ExpectedError Couldn't verify signature of downloaded letsencrypt-auto. exc N/A main N/A N/A N/A N/A N/A get N/A N/A HttpsGetter get N/A flag N/A argv N/A 1 N/A N/A N/A N/A flag --latest-version N/A N/A N/A latest_stable_version get N/A N/A N/A flag --le-auto-script N/A N/A tag N/A argv N/A 2 N/A N/A verified_new_le_auto get tag N/A dirname N/A argv N/A 0 N/A N/A N/A ExpectedError N/A exc N/A N/A N/A N/A exc args N/A 0 N/A N/A exc args N/A 1 N/A 1 N/A N/A 0 N/A N/A N/A __name__ __main__ N/A N/A N/A exit N/A main