Commit d0540ad3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 11611163
...@@ -35,6 +35,7 @@ from os.path import basename ...@@ -35,6 +35,7 @@ from os.path import basename
from glob import glob from glob import glob
from collections import namedtuple from collections import namedtuple
from urllib.parse import unquote from urllib.parse import unquote
import email.parser
# PkgInfo represents information about a package # PkgInfo represents information about a package
...@@ -82,6 +83,11 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo ...@@ -82,6 +83,11 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
url = '%s/%s-%s.tar.gz' % (nxdbase, name, v) url = '%s/%s-%s.tar.gz' % (nxdbase, name, v)
else: else:
url = 'https://pypi.org/project/%s/%s/' % (name, v) url = 'https://pypi.org/project/%s/%s/' % (name, v)
with open('%s/EGG-INFO/PKG-INFO' % urlpath) as f:
p = email.parser.Parser()
meta = p.parse(f, headersonly=True)
license = meta['license']
else: else:
raise NotImplementedError('TODO url for kind %r (urlpath: %r)' % (kind, urlpath)) raise NotImplementedError('TODO url for kind %r (urlpath: %r)' % (kind, urlpath))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment