Skip to content

Commit

Permalink
Simplify processing of mamba repoquery output
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpre committed Apr 10, 2021
1 parent fb05d84 commit 0d8f43e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mamba_gator/envmanager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2016-2020 Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import collections
import json
import logging
import os
Expand Down Expand Up @@ -608,13 +609,11 @@ def process_mamba_repoquery_output(data: Dict) -> Dict:
of "conda search --json".
"""

data_ = {}
data_ = collections.defaultdict(lambda : [])
for entry in data['result']['pkgs']:
name = entry.get('name')
if name in data_.keys():
if name is not None:
data_[name].append(entry)
else:
data_[name] = [entry]

return data_

Expand Down

0 comments on commit 0d8f43e

Please sign in to comment.