From 8406cdd56d9ede9ffa88c77c0ed4bf7e6c149a59 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Sat, 29 Jan 2011 17:44:03 +0100 Subject: [PATCH] - Request: added get_actions method --- osc/core.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osc/core.py b/osc/core.py index 064d585f..68662ad2 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2425,6 +2425,15 @@ class Request: """add a new action to the request""" self.actions.append(Action(type, **kwargs)) + def get_actions(self, *types): + """ + get all actions with a specific type + (if types is empty return all actions) + """ + if not types: + return self.actions + return [i for i in self.actions if i.type in types] + def get_creator(self): """return the creator of the request""" if len(self.statehistory):