equal
deleted
inserted
replaced
59 self.rules.append((action, conditions)) |
59 self.rules.append((action, conditions)) |
60 |
60 |
61 def set(self, **kw): |
61 def set(self, **kw): |
62 self.preset.update(kw) |
62 self.preset.update(kw) |
63 |
63 |
|
64 def get(self, k): |
|
65 return self.preset.get(k, None) |
|
66 |
64 def matchrule(self, kw): |
67 def matchrule(self, kw): |
65 d = self.preset.copy() |
68 d = self.preset.copy() |
66 d.update(kw) |
69 d.update(kw) |
67 for a, c in self.rules: |
70 for a, c in self.rules: |
68 if c(d): |
71 if c(d): |