tracer: update docstrings

This commit is contained in:
Stefan Sauer 2016-12-20 08:17:34 +01:00
parent 64ce582313
commit 52ce3ef666
4 changed files with 23 additions and 4 deletions

View file

@ -2,7 +2,11 @@ from tracer.parser import Parser
from tracer.structure import Structure
class AnalysisRunner(object):
'''Iterate over a log and dispatch to a set of analyzers'''
"""
Runs several Analyzers over a log.
Iterates log using a Parser and dispatches to a set of analyzers.
"""
def __init__(self, log):
self.log = log

View file

@ -1,5 +1,9 @@
class Analyzer(object):
'''Base class for a gst tracer analyzer.'''
"""
Base class for a gst tracer analyzer.
Will be used in conjunction with a AnalysisRunner.
"""
def __init__(self):
pass

View file

@ -37,7 +37,11 @@ def _log_line_regex():
class Parser(object):
'''Helper to parse a tracer log'''
"""
Helper to parse a tracer log.
Implements context manager and iterator.
"""
# record fields
F_TIME = 0

View file

@ -10,7 +10,14 @@ INT_TYPES = "".join(
)
class Structure(object):
'''Gst Structure parser.'''
"""
Gst Structure parser.
Has publicly accesible members representing the structure data:
name -- the structure name
types -- a dictionary keyed by the field name
values -- a dictionary keyed by the field name
"""
def __init__(self, text):
self.text = text