]> mj.ucw.cz Git - moe.git/commitdiff
Minor updates (docs, status.py)
authorTomas Gavenciak <gavento@ucw.cz>
Sat, 27 Nov 2010 13:56:50 +0000 (14:56 +0100)
committerTomas Gavenciak <gavento@ucw.cz>
Sat, 27 Nov 2010 13:56:50 +0000 (14:56 +0100)
Change base classes of Status and InvalidStatusFile
Fix some docs typos and invalid format

t/doc/config.rst
t/doc/status.rst
t/moe/config_parser.py
t/moe/status.py

index 87e825ef8fcc7e46b369ef4d4554dc79da8021f8..80c2ef834741fa210bc30a2732bef7a65d9a76ad 100644 (file)
@@ -136,11 +136,11 @@ Module `moe.config`
 Exceptions
 ^^^^^^^^^^
 
-.. autoclass:: ConfigError
-.. autoclass:: UndefinedError
-.. autoclass:: VariableNameError
-.. autoclass:: VariableFixedError
-.. autoclass:: CyclicConfigError
+.. autoexception:: ConfigError
+.. autoexception:: UndefinedError
+.. autoexception:: VariableNameError
+.. autoexception:: VariableFixedError
+.. autoexception:: CyclicConfigError
 
 Configuration tree
 ^^^^^^^^^^^^^^^^^^
index d8ba50ff50ce125cb7f49fdfbd64f5b706c889f0..0953181cf46f9738dc031b134e1e933226e28b81 100644 (file)
@@ -42,6 +42,7 @@ Status file grammar
 ^^^^^^^^^^^^^^^^^^^
 
 ::
+
   STATUS = ELEMENT *
   ELEMENT = WS '\n' | COMMENT | ENTRY | SUBTREE
   SUBTREE = WS KEY '(' WS '\n' STATUS ')' WS '\n'
@@ -69,4 +70,11 @@ Module moe.status
 
 .. automodule:: moe.status
 
+.. autoexception:: InvalidStatusFile
+
+.. autoclass:: Status
+  :members:
+  :exclude-members: do_read, read_val
+
+
 
index 838d76b661edfc6b04120632d675f8ee96e5dcc6..2da6facfa2daa9062c78b2cfc9d9fe52cdddaf16 100644 (file)
@@ -37,7 +37,7 @@ The configuration syntax is the following::
 
 .. todo:: should whitespace (incl. '\n') be allowed (almost) everywhere? 
          can comment be anywhere whitespace can?
-.. note:: ';' or '\n' is currently required even after CONDITION and SUBTREE block 
+.. note:: ';' or '\\n' is currently required even after CONDITION and SUBTREE block 
 .. note:: Formula can contain additional/unnecessary parentheses
 """
 
index 0cba45cb6eb029e3b100bd4dbdf7ae4adc03088c..144bf486f66afffaf6e272d79a74ebc7b727e43a 100644 (file)
@@ -2,14 +2,20 @@ import sys
 import types
 import re
 
-key_pattern = re.compile("\A[A-Za-z0-9_-]+\Z")
+key_pattern_str = "\A[A-Za-z0-9_-]+\Z"
+key_pattern = re.compile(key_pattern_str)
 
-class InvalidStatusFile(Exception):
+class InvalidStatusFile(StandardError):
     pass
 
-class Status:
+class Status(object):
     """
-    (One subtree of) Moe status file.
+    (One subtree of) a status file.
+
+    Each Status is a dictionary with string keys matching the specs. and 
+    values either strings or nested Status subtrees.
+
+    The class defines `__getitem__`, `__setitem__`, `__eq__` and `keys`.
     """
 
     def __init__(self):