mirror of
https://github.com/Oreolek/gamebookformat.git
synced 2024-05-14 23:18:19 +03:00
Now an error to have sections with the same name.
This commit is contained in:
parent
5e187d3252
commit
4dc609c1a2
|
@ -30,6 +30,9 @@ class Book:
|
|||
self.max = 0
|
||||
|
||||
def add(self, section):
|
||||
if section.name in self.from_name:
|
||||
raise Exception('Duplicate section names (%s) not allowed.' %
|
||||
section.name)
|
||||
self.sections.append(section)
|
||||
self.from_name[section.name] = section
|
||||
if len(self.sections) > self.max:
|
||||
|
|
Loading…
Reference in a new issue