Skip to content

Commit

Permalink
Filter requested commands using command graph
Browse files Browse the repository at this point in the history
  • Loading branch information
17451k committed Mar 26, 2019
1 parent b712008 commit 312fdac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion clade/extensions/cmd_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ def load_all_cmds(self, with_opts=False, with_raw=False, filter_by_pid=False):
def load_all_cmds_by_type(self, cmd_type, filter_by_pid=True):
ext_obj = self.get_ext_obj(cmd_type)

return ext_obj.load_all_cmds(filter_by_pid=filter_by_pid)
cmds = ext_obj.load_all_cmds(filter_by_pid=False)

if not filter_by_pid:
return cmds

if not self.graph:
cmd_graph = self.load_cmd_graph()
else:
cmd_graph = self.graph

return [cmd for cmd in cmds if cmd["id"] in cmd_graph]

def normalize_all_paths(self, cmds):
for cmd in cmds:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def finalize_options(self):

setuptools.setup(
name="clade",
version="3.0",
version="3.0.1",
author="Ilya Shchepetkov",
author_email="shchepetkov@ispras.ru",
url="https://github.com/17451k/clade",
Expand Down

0 comments on commit 312fdac

Please sign in to comment.