Преглед на файлове

Forgot to CVS ADd function to return node path collection as lisTd

Mark Mine преди 23 години
родител
ревизия
62208fa7cc
променени са 1 файла, в които са добавени 16 реда и са изтрити 0 реда
  1. 16 0
      direct/src/extensions/NodePathCollection-extensions.py

+ 16 - 0
direct/src/extensions/NodePathCollection-extensions.py

@@ -0,0 +1,16 @@
+
+    """
+    NodePathCollection-extensions module: contains methods to extend
+    functionality of the NodePathCollection class
+    """
+
+    # For iterating over children
+    def asList(self):
+        """Converts a NodePathCollection into a list"""
+        if self.isEmpty():
+            return []
+        else:
+            npList = []
+            for nodePathIndex in range(self.getNumPaths()):
+                npList.append(self.getPath(nodePathIndex))
+            return npList