Skip to content
Snippets Groups Projects
Commit a94fd3c7 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed a bug in local backend where the subsections were not added to the parent section.

parent 2beb276e
No related branches found
No related tags found
No related merge requests found
......@@ -420,11 +420,11 @@ class Section(object):
class SectionManager(object):
"""Manages the sections for the given metainfo.
"""
def __init__(self, metaInfo, parentSectionNames, lastSectionGIndex=-1, openSections={}):
def __init__(self, metaInfo, parentSectionNames, lastSectionGIndex=-1):
self.metaInfo = metaInfo
self.parentSectionNames = parentSectionNames
self.lastSectionGIndex = lastSectionGIndex
self.openSections = dict(openSections)
self.openSections = []
def openSection(self, backend):
newGIndex = self.lastSectionGIndex + 1
......@@ -455,7 +455,10 @@ class SectionManager(object):
if not parent_found and len(self.parentSectionNames) != 0:
raise LookupError("Could not open section '{}' because none of it's parent sections '{}' could not be found".format(self.metaInfo.name, self.parentSectionNames))
self.openSections[gIndex] = Section(gIndex, references, parents, self.metaInfo.name, backend)
new_section = Section(gIndex, references, parents, self.metaInfo.name, backend)
self.openSections.append(new_section)
if parent_found:
parents[0].addSubsection(self.metaInfo, new_section)
def closeSection(self, backend, gIndex):
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment