Skip to content

Commit

Permalink
handle empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
allenhsieh committed Oct 11, 2019
1 parent d19db5c commit 4f2204f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions jake/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@

def main():
log = logging.getLogger('jake')
log.setLevel(logging.ERROR)
log.setLevel(logging.DEBUG)

parse = Parse()
ossindex = OssIndex()
audit = Audit()

log.debug('Getting arguments')
args = sys.argv[1:]

for arg in args:
log.debug(arg)
if arg == 'ddt':
Expand Down
14 changes: 11 additions & 3 deletions jake/parse/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ def parseCondaDependenciesIntoPurls(self, results):
if "#" in line:
self._log.debug("Skipping line")
else:
purls.add_coordinate(self.parseLineIntoPurl(line))
return purls.get_coordinates_as_json()
purl = self.parseLineIntoPurl(line)
if purl is not None:
purls.add_coordinate(self.parseLineIntoPurl(line))
if len(purls.get_coordinates()) == 0:
return None
else:
return purls.get_coordinates_as_json()

def parseLineIntoPurl(self, line):
lineArray = line.split()
template = "pkg:conda/{}@{}"
return template.format(lineArray[0], lineArray[1])
if len(lineArray) is not 0:
return template.format(lineArray[0], lineArray[1])
else:
return None
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ conda==4.3.16
cytoolz==0.10.0
idna==2.8
isort==4.3.21
# Editable install with no version control (jake==0.0.1)
-e /Users/jeffryhesse/code/sonatype-nexus-community/snek
lazy-object-proxy==1.4.2
mccabe==0.6.1
pycosat==0.6.3
Expand Down

0 comments on commit 4f2204f

Please sign in to comment.