def __init__(self, standalone=False, filename=None): menu = Menu.parse(filename) if standalone: self.contents = "[begin] (Fluxbox)" self.contents.extend(self.menu(menu, depth=1)) self.comtents.append("[end]") else: self.contents = self.menu(menu)
def createMenu(self, parent, name, genericname=None, comment=None, icon=None, after=None, before=None): menu = Menu() menu.Parent = parent menu.Depth = parent.Depth + 1 menu.Layout = parent.DefaultLayout menu.DefaultLayout = parent.DefaultLayout menu = self.editMenu(menu, name, genericname, comment, icon) self.__addEntry(parent, menu, after, before) sort(self.menu) return menu
def __init__(self, filename=None): if filename: self._node = Menu.parse(filename) else: self._node = None