Skip to content

Commit

Permalink
Rename 'print' action to 'return' and set it to rules
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyX committed Feb 2, 2015
1 parent 7d9c88d commit 62ae5a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
19 changes: 10 additions & 9 deletions data/rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-
- When process is found, tracer looks into this file and searches for its parent rules.
- If rule is found, action is performed. These two actions can be done:
- * Print the actual process
- * Return the actual process
- * Find the rule for parent process
-
-
Expand All @@ -30,16 +30,18 @@
- 'call-parent'
-
- Available actions:
- 'call-parent', 'print'
- 'call-parent' - Use it for parts of the application (i.e. chrome-sandbox)
- 'return' - Use it for the whole application (i.e. chromium)
-
-->

<rules>
<rule name="sd-pam" />

<!-- KDE -->
<rule name="kwin" action="return" />
<rule name="seapplet" action="return" />
<rule name="akonadiserver" />
<rule name="kwin" />
<rule name="ksmserver" />
<rule name="akonadi_agent_launcher" />
<rule name="akonadi_archivemail_agent" />
Expand All @@ -52,19 +54,18 @@
<rule name="akonadi_newmailnotifier_agent" />
<rule name="akonadi_sendlater_agent" />
<rule name="abrt-applet" />
<rule name="seapplet" />

<!-- Networking -->
<rule name="wicd" />
<rule name="wicd" action="return" />

<!-- Web browsers -->
<rule name="chrome" />
<rule name="chromium" />
<rule name="chrome" action="return" />
<rule name="chromium" action="return" />
<rule name="firefox" action="return" />
<rule name="chrome-sandbox" />
<rule name="plugin-container" />
<rule name="firefox" />

<rule name="urxvt" />
<rule name="urxvt" action="return" />
<rule name="xmonad-i386-linux" />

</rules>
Expand Down
4 changes: 2 additions & 2 deletions tracer/resources/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Rules:

ACTIONS = {
"CALL-PARENT" : "call-parent",
"PRINT" : "print",
"RETURN" : "return",
}
_DEFAULT_ACTION = ACTIONS["CALL-PARENT"]
_rules = None
Expand Down Expand Up @@ -125,4 +125,4 @@ def setdefault(self, key, value):
def update(self, values):
if isinstance(values, Rule):
values = values._attributes
self._attributes.update(values)
self._attributes.update(values)
4 changes: 2 additions & 2 deletions tracer/resources/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def _apply_rules(self, process):
if rule.action == self._rules.ACTIONS["CALL-PARENT"]:
return self._apply_rules(parent)

# Only PRINT action left
# PRINT rule is defined for parent process
# Only RETURN action left
# RETURN rule is defined for parent process
return parent

def trace_application(self, app_name):
Expand Down

0 comments on commit 62ae5a7

Please sign in to comment.