class Netatalk (SectionPlugin): config_path = '/etc/afp.conf' def init(self): self.title = 'Netatalk' self.icon = 'folder-close' self.category = _('Software') self.append(self.ui.inflate('netatalk:main')) if not os.path.exists(self.config_path): open(self.config_path, 'w').close() self.binder = Binder(None, self.find('config')) self.find('shares').new_item = lambda c: ShareData() self.config = NetatalkConfig(path=self.config_path) def on_page_load(self): self.refresh() def refresh(self): self.config.load() self.binder.reset(self.config.tree).autodiscover().populate() @on('save', 'click') def on_save(self): self.binder.update() self.config.save() self.refresh()
class Netatalk(SectionPlugin): config_path = '/etc/afp.conf' def init(self): self.title = 'Netatalk' self.icon = 'folder-close' self.category = _('Software') self.append(self.ui.inflate('netatalk:main')) if not os.path.exists(self.config_path): open(self.config_path, 'w').write("[Global]") self.binder = Binder(None, self.find('config')) self.find('shares').new_item = lambda c: ShareData() self.config = NetatalkConfig(path=self.config_path) def on_page_load(self): self.refresh() def refresh(self): self.config.load() self.binder.reset(self.config.tree).autodiscover().populate() @on('save', 'click') def on_save(self): self.binder.update() self.config.save() self.refresh()
class Netatalk(SectionPlugin): config_path = "/etc/afp.conf" def init(self): self.title = "Netatalk" self.icon = "folder-close" self.category = "Software" self.append(self.ui.inflate("netatalk:main")) if not os.path.exists(self.config_path): open(self.config_path, "w").close() self.binder = Binder(None, self.find("config")) self.find("shares").new_item = lambda c: ShareData() self.config = NetatalkConfig(path=self.config_path) def on_page_load(self): self.refresh() def refresh(self): self.config.load() self.binder.reset(self.config.tree).autodiscover().populate() @on("save", "click") def on_save(self): self.binder.update() self.config.save() self.refresh()
def init(self): self.title = 'Netatalk' self.icon = 'folder-close' self.category = 'Software' self.append(self.ui.inflate('netatalk:main')) self.binder = Binder(None, self.find('config')) self.find('shares').new_item = lambda c: ShareData() self.config = NetatalkConfig(path='/etc/afp.conf')
def init(self): self.title = 'Netatalk' self.icon = 'folder-close' self.category = _('Software') self.append(self.ui.inflate('netatalk:main')) if not os.path.exists(self.config_path): open(self.config_path, 'w').write("[Global]") self.binder = Binder(None, self.find('config')) self.find('shares').new_item = lambda c: ShareData() self.config = NetatalkConfig(path=self.config_path)
def init(self): self.title = 'Netatalk' self.icon = 'folder-close' self.category = _('Software') self.append(self.ui.inflate('netatalk:main')) if not os.path.exists(self.config_path): open(self.config_path, 'w').close() self.binder = Binder(None, self.find('config')) self.find('shares').new_item = lambda c: ShareData() self.config = NetatalkConfig(path=self.config_path)
def init(self): self.title = "Netatalk" self.icon = "folder-close" self.category = "Software" self.append(self.ui.inflate("netatalk:main")) if not os.path.exists(self.config_path): open(self.config_path, "w").close() self.binder = Binder(None, self.find("config")) self.find("shares").new_item = lambda c: ShareData() self.config = NetatalkConfig(path=self.config_path)