tracer: update docstrings
authorStefan Sauer <ensonic@users.sf.net>
Tue, 20 Dec 2016 07:17:34 +0000 (08:17 +0100)
committerStefan Sauer <ensonic@users.sf.net>
Tue, 20 Dec 2016 07:24:57 +0000 (08:24 +0100)
tracer/tracer/analysis_runner.py
tracer/tracer/analyzer.py
tracer/tracer/parser.py
tracer/tracer/structure.py

index 54d0b3f..292b6ab 100644 (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
index 4841eee..c4e6c7e 100644 (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
index eed54cd..22847b9 100644 (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
index ba9f465..0927b6b 100644 (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