Lines Matching refs:self

18   # are also used as values for self.allow to indicate which type of
24 def __init__(self, allow, directory, dependent_directory, source):
25 self.allow = allow
26 self._dir = directory
27 self._dependent_dir = dependent_directory
28 self._source = source
30 def __str__(self):
31 return '"%s%s" from %s.' % (self.allow, self._dir, self._source)
33 def AsDependencyTuple(self):
35 which is fully self-sufficient to answer the question whether the dependent
38 return self.allow, self._dependent_dir or '.', self._dir or '.'
40 def ParentOrMatch(self, other):
43 return self._dir == other or self._dir.startswith(other + '/')
45 def ChildOrMatch(self, other):
48 return self._dir == other or other.startswith(self._dir + '/')
56 def __init__(self, reason):
57 super(MessageRule, self).__init__(Rule.DISALLOW, '', '', '')
58 self._reason = reason
60 def __str__(self):
61 return self._reason
98 def __init__(self):
104 self._general_rules = []
110 self._specific_rules = {}
112 def __str__(self):
114 ' %s' % x for x in self._general_rules)]
115 for regexp, rules in list(self._specific_rules.items()):
121 def AsDependencyTuples(self, include_general_rules, include_specific_rules):
133 AddDependencyTuplesImpl(deps, self._general_rules)
135 for regexp, rules in list(self._specific_rules.items()):
139 def AddRule(self, rule_string, dependent_dir, source, dependee_regexp=None):
155 rules_to_update = self._general_rules
157 if dependee_regexp in self._specific_rules:
158 rules_to_update = self._specific_rules[dependee_regexp]
169 self._general_rules = rules_to_update
171 self._specific_rules[dependee_regexp] = rules_to_update
173 def RuleApplyingTo(self, include_path, dependee_path):
178 for regexp, specific_rules in list(self._specific_rules.items()):
183 for rule in self._general_rules: