| 67 | return PythonRegistryIterator(self) |
| 68 | |
| 69 | def keys(self, Name): |
| 70 | # Check if Name registry level is registered and if it is a value |
| 71 | if self.HasItem(Name): |
| 72 | if not self.HasItems(Name): |
| 73 | err_mgs = f"Asking for the keys of '{Name}'. '{Name}' item has no subitems." |
| 74 | raise Exception(err_mgs) |
| 75 | else: |
| 76 | err_msg = f"Asking for the keys of '{Name}' non-registered item." |
| 77 | raise Exception(err_msg) |
| 78 | |
| 79 | # Get the c++ registry item keys |
| 80 | cpp_keys = None |
| 81 | if self.HasItems(Name, RegistryContext.CPP): |
| 82 | cpp_keys = self.__GetCppItem(Name).keys() |
| 83 | # Get the Python registry item keys |
| 84 | # Note that this is a view object of the Python dictionary keys |
| 85 | py_keys = None |
| 86 | if self.HasItems(Name, RegistryContext.PYTHON): |
| 87 | py_keys = self.__GetPythonItem(Name).keys() |
| 88 | |
| 89 | # Return the c++ and Python registry keys in a tuple |
| 90 | # Note that we return None if the item was not present in one of the registries |
| 91 | return py_keys, cpp_keys |
| 92 | |
| 93 | def values(self, Name): |
| 94 | # Check if Name registry level is registered and if it is a value |