How to use the configupdater.DuplicateSectionError function in ConfigUpdater

To help you get started, we’ve selected a few ConfigUpdater examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ralphwetzel / theonionbox / theonionbox / tob / ccfile.py View on Github external
def add_node(self) -> Optional[CCNode]:
        if self.readonly is True:
            return None

        while 1:
            id = uuid.uuid4().hex
            try:
                self.updater.add_section(id)
            except DuplicateSectionError:
                continue
            except:
                return None
            else:
                break

        return CCNode(self, self.updater[id])