Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions dparse/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
except NameError: # pragma: no cover
basestring = str

from .regex import URL_REGEX, HASH_REGEX
from .regex import HASH_REGEX

from .dependencies import DependencyFile, Dependency
from packaging.requirements import Requirement as PackagingRequirement, InvalidRequirement
Expand Down Expand Up @@ -190,10 +190,11 @@ def parse_index_server(cls, line):
:param line:
:return:
"""
matches = URL_REGEX.findall(line)
if matches:
url = matches[0]
return url if url.endswith("/") else url + "/"
groups = re.split(pattern="[=\s]+", string=line.strip(), maxsplit=100)

if len(groups) >= 2:
return groups[1] if groups[1].endswith("/") else groups[1] + "/"

return None

@classmethod
Expand Down Expand Up @@ -360,6 +361,7 @@ def parse(self):
except (toml.TomlDecodeError, IndexError) as e:
pass


class PipfileLockParser(Parser):

def parse(self):
Expand Down
Loading