Home | History | Annotate | Download | only in lib

Lines Matching defs:Policy

16 # Heap Profile Policy versions
34 """Represents one matching rule in a policy file."""
108 class Policy(object):
109 """Represents a policy, a content of a policy file."""
257 """Loads a policy file of |filename| in a |format|.
265 A loaded Policy object.
268 return Policy.parse(policy_f, filetype)
272 """Parses a policy file content in a |format|.
280 A loaded Policy object.
283 return Policy._parse_json(policy_f)
289 """Parses policy file in json format.
291 A policy file contains component's names and their stacktrace pattern
293 symbols of each stacktraces in the order written in the policy file
299 A loaded policy object.
301 policy = json.load(policy_f)
304 for rule in policy['rules']:
317 return Policy(rules, policy['version'], policy['components'])
353 """Loads a set of policies via the "default policy directory".
355 The "default policy directory" contains pairs of policies and their labels.
356 For example, a policy "policy.l0.json" is labeled "l0" in the default
357 policy directory "policies.json".
363 labels: An array that contains policy labels to be loaded.
374 # TODO(dmikurube): Load an un-labeled policy file.
397 LOGGER.info('Loading policy files.')
401 loaded = Policy.load(directory[label]['file'], directory[label]['format'])