pip.main moved to pip.__main (or something like that?) but don't try to use it anyways.

This commit is contained in:
brent s 2019-01-25 02:40:45 -05:00
parent ae2a7be09d
commit d744250c1b

View File

@ -17,26 +17,12 @@ import socket
import ssl import ssl
from urllib import parse from urllib import parse
# PyPi/PIP # PyPi/PIP
# These are handled automagically. import OpenSSL
# If you'd rather install them via your distro's package manager (YOU SHOULD), import validators
# then install them first then run this script. #import pyasn1
# Otherwise you'll have to use pip to remove them.
thrd_prty = {'OpenSSL': 'pyOpenSSL',
#'pyasn1': 'pyasn1',
#'jinja2': 'Jinja2',
'validators': 'validators'}


cols = shutil.get_terminal_size((80, 20)).columns cols = shutil.get_terminal_size((80, 20)).columns


for mod in thrd_prty:
try:
globals()[mod] = importlib.import_module(mod)
except ImportError:
import pip
pip.main(['install', '--quiet', '--quiet', '--quiet',
'--user', thrd_prty[mod]])
globals()[mod] = importlib.import_module(mod)

class CertParse(object): class CertParse(object):
def __init__(self, target, port = 443, force = None, cert_type = 'pem', def __init__(self, target, port = 443, force = None, cert_type = 'pem',
json_fmt = False, starttls = False, extensions = False, json_fmt = False, starttls = False, extensions = False,