| 115 | return py_values, cpp_values |
| 116 | |
| 117 | def items(self, Name): |
| 118 | # Check if Name registry level is registered and if it is a value |
| 119 | if self.HasItem(Name): |
| 120 | if not self.HasItems(Name): |
| 121 | err_mgs = f"Asking for the items of '{Name}'. '{Name}' item has no subitems." |
| 122 | raise Exception(err_mgs) |
| 123 | else: |
| 124 | err_msg = f"Asking for the items of '{Name}' non-registered item." |
| 125 | raise Exception(err_msg) |
| 126 | |
| 127 | # Get the keys and values |
| 128 | py_keys, cpp_keys = self.keys(Name) |
| 129 | py_values, cpp_values = self.values(Name) |
| 130 | |
| 131 | # Loop the keys and values to return the items |
| 132 | py_items = None |
| 133 | if py_keys is not None: |
| 134 | py_items = [] |
| 135 | for py_key, py_value in zip(py_keys, py_values): |
| 136 | py_items.append((py_key, py_value)) |
| 137 | |
| 138 | cpp_items = None |
| 139 | if cpp_keys is not None: |
| 140 | cpp_items = [] |
| 141 | for cpp_key, cpp_value in zip(cpp_keys, cpp_values): |
| 142 | cpp_items.append((cpp_key, cpp_value)) |
| 143 | |
| 144 | # Return the c++ and Python registry items in a tuple |
| 145 | return py_items, cpp_items |
| 146 | |
| 147 | def NumberOfItems(self, Name, Context=RegistryContext.ALL): |
| 148 | '''Returns the total number of items in the registry |