added get_list
This commit is contained in:
1 parent
e5cfb68b9e
commit
12c99024d8
1 file changed
+11
@@ -4,6 +4,7 @@ import argparse
|
||||
import json
|
||||
import shutil
|
||||
import subprocess
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
@@ -114,6 +115,16 @@ class Conda:
|
||||
subprocess.run(cmd)
|
||||
|
||||
|
||||
def get_list(self, env):
|
||||
cmd = [self.exe, "list", "--json", "--name", env]
|
||||
pkgs = run_and_parse(cmd)
|
||||
res = defaultdict(list)
|
||||
for p in pkgs:
|
||||
for k in ("name", "version", "build_string", "build_number", "channel"):
|
||||
res[k].append(p[k])
|
||||
return dict(res)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user