moved RSpecElement and RSpecElements to rspec_element.py
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 1 Sep 2011 19:49:30 +0000 (15:49 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 1 Sep 2011 19:49:30 +0000 (15:49 -0400)
sfa/rspecs/rspec.py
sfa/rspecs/rspec_elements.py [new file with mode: 0644]

index cd7e9f8..764114a 100755 (executable)
@@ -4,7 +4,7 @@ from StringIO import StringIO
 from datetime import datetime, timedelta
 from sfa.util.xrn import *
 from sfa.util.plxrn import hostname_to_urn
-from sfa.util.enumeration import Enum
+from sfa.rspecs.rspec_elements import RSpecElement, RSpecElements 
 from sfa.util.faults import SfaNotImplemented, InvalidRSpec, InvalidRSpecElement
 
 
@@ -28,17 +28,6 @@ class XpathFilter:
                 xpath = '[' + xpath + ']'
         return xpath
 
-# recognized top level rspec elements 
-RSpecElements = Enum('NETWORK', 'NODE', 'SLIVER', 'INTERFACE', 'LINK', 'VLINK')
-
-class RSpecElement:
-    def __init__(self, element_type, name, path):
-        if not element_type in RSpecElements:
-            raise InvalidRSpecElement(element_type)
-        self.type = element_type
-        self.name = name
-        self.path = path     
-
 class RSpec:
     header = '<?xml version="1.0"?>\n'
     template = """<RSpec></RSpec>"""
diff --git a/sfa/rspecs/rspec_elements.py b/sfa/rspecs/rspec_elements.py
new file mode 100644 (file)
index 0000000..2eb0d8c
--- /dev/null
@@ -0,0 +1,12 @@
+from sfa.util.enumeration import Enum
+
+# recognized top level rspec elements
+RSpecElements = Enum('NETWORK', 'NODE', 'SLIVER', 'INTERFACE', 'LINK', 'VLINK')
+
+class RSpecElement:
+    def __init__(self, element_type, name, path):
+        if not element_type in RSpecElements:
+            raise InvalidRSpecElement(element_type)
+        self.type = element_type
+        self.name = name
+        self.path = path