/usr/share/pyshared/atheist/plugins/composite.py is in atheist 0.20110402-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # -*- mode: python; coding: utf-8 -*-
""" Composite tasks and conditions """
import types
import atheist
from atheist.const import *
class CompositeCondition(atheist.ConditionDecorator, atheist.Plugin):
def __init__(self, oper, *conds):
assert callable(oper)
self.oper = oper
atheist.ConditionDecorator.__init__(self, *conds)
def run(self):
return self.oper([c.run() for c in self.children])
@property
def name(self):
return self.__class__.__name__
def basic_info(self):
return str.join(', ', ["{0}({1})".format(x.name, x.basic_info())
for x in self.children])
class Or(CompositeCondition, atheist.Plugin):
def __init__(self, *conds):
CompositeCondition.__init__(self, any, *conds)
|