python/samples/tones | 9 +++++++++
python/samples/tones-inheritance-impl | 12 +++++++++++-
2 files changed, 20 insertions(+), 1 deletions(-)
Add usage description for using the tones sample OI.
diff --git a/python/samples/tones b/python/samples/tones
--- a/python/samples/tones
+++ b/python/samples/tones
@@ -2,11 +2,20 @@
from pyosaf.utils.immoi import implementer
+import argparse
+
tone_class_names = ["Do", "Re", "Mi", "Fa", "So", "La", "Ti"]
if __name__ == "__main__":
+ # Parse command line arguments
+ parser = argparse.ArgumentParser(
+ description=('Ensures that instances of %s can only be created in this
'
+ 'order.') % ', '.join(tone_class_names))
+
+ args = parser.parse_args()
+
# Set up containment constraints
constraints = implementer.Constraints()
diff --git a/python/samples/tones-inheritance-impl
b/python/samples/tones-inheritance-impl
--- a/python/samples/tones-inheritance-impl
+++ b/python/samples/tones-inheritance-impl
@@ -2,10 +2,13 @@
from pyosaf.utils.immoi.implementer import Implementer, Constraints
+import argparse
+
+tone_class_names = ["Do", "Re", "Mi", "Fa", "So", "La", "Ti"]
+
class Tones(Implementer):
def __init__(self):
- tone_class_names = ["Do", "Re", "Mi", "Fa", "So", "La", "Ti"]
Implementer.__init__(self, class_names=tone_class_names,
name="TonesImplementer")
@@ -25,6 +28,13 @@ class Tones(Implementer):
if __name__ == "__main__":
+ # Parse command line arguments
+ parser = argparse.ArgumentParser(
+ description=('Ensures that instances of %s can only be created in this
'
+ 'order.') % ', '.join(tone_class_names))
+
+ args = parser.parse_args()
+
# Create the implementer
tones_implementer = Tones()
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel