mirror of
https://github.com/thewesker/lazy-dsi-file-downloader.git
synced 2025-12-20 04:21:09 -05:00
fully working!
This commit is contained in:
3
certifi/__init__.py
Normal file
3
certifi/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .core import contents, where
|
||||
|
||||
__version__ = "2020.04.05.1"
|
||||
12
certifi/__main__.py
Normal file
12
certifi/__main__.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import argparse
|
||||
|
||||
from certifi import contents, where
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-c", "--contents", action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.contents:
|
||||
print(contents())
|
||||
else:
|
||||
print(where())
|
||||
BIN
certifi/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
certifi/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
certifi/__pycache__/__main__.cpython-38.pyc
Normal file
BIN
certifi/__pycache__/__main__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
certifi/__pycache__/core.cpython-38.pyc
Normal file
BIN
certifi/__pycache__/core.cpython-38.pyc
Normal file
Binary file not shown.
4641
certifi/cacert.pem
Normal file
4641
certifi/cacert.pem
Normal file
File diff suppressed because it is too large
Load Diff
30
certifi/core.py
Normal file
30
certifi/core.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
certifi.py
|
||||
~~~~~~~~~~
|
||||
|
||||
This module returns the installation location of cacert.pem or its contents.
|
||||
"""
|
||||
import os
|
||||
|
||||
try:
|
||||
from importlib.resources import read_text
|
||||
except ImportError:
|
||||
# This fallback will work for Python versions prior to 3.7 that lack the
|
||||
# importlib.resources module but relies on the existing `where` function
|
||||
# so won't address issues with environments like PyOxidizer that don't set
|
||||
# __file__ on modules.
|
||||
def read_text(_module, _path, encoding="ascii"):
|
||||
with open(where(), "r", encoding=encoding) as data:
|
||||
return data.read()
|
||||
|
||||
|
||||
def where():
|
||||
f = os.path.dirname(__file__)
|
||||
|
||||
return os.path.join(f, "cacert.pem")
|
||||
|
||||
|
||||
def contents():
|
||||
return read_text("certifi", "cacert.pem", encoding="ascii")
|
||||
Reference in New Issue
Block a user