def _writeCFG(self, **kwargs): if 'name' not in kwargs: self.data = 'Missing parameter: name' return if 'value' not in kwargs: self.data = 'Missing parameter: value' return if 'group' not in kwargs: self.data = 'Missing parameter: group' return try: self.data = '["%s"]' % lazylibrarian.CFG.get( kwargs['group'], kwargs['name']) lazylibrarian.CFG.set(kwargs['group'], kwargs['name'], kwargs['value']) if PY2: fmode = 'wb' else: fmode = 'w' with open(lazylibrarian.CONFIGFILE, fmode) as configfile: lazylibrarian.CFG.write(configfile) lazylibrarian.config_read(reloaded=True) except Exception as e: self.data = 'Unable to update CFG entry for %s: %s, %s' % ( kwargs['group'], kwargs['name'], str(e))
def _writeCFG(self, **kwargs): if 'name' not in kwargs: self.data = 'Missing parameter: name' return if 'value' not in kwargs: self.data = 'Missing parameter: value' return if 'group' not in kwargs: self.data = 'Missing parameter: group' return try: self.data = '["%s"]' % lazylibrarian.CFG.get(kwargs['group'], kwargs['name']) lazylibrarian.CFG.set(kwargs['group'], kwargs['name'], kwargs['value']) with open(lazylibrarian.CONFIGFILE, 'wb') as configfile: lazylibrarian.CFG.write(configfile) lazylibrarian.config_read(reloaded=True) except Exception as e: self.data = 'Unable to update CFG entry for %s: %s, %s' % (kwargs['group'], kwargs['name'], str(e))
def _loadCFG(self, **kwargs): lazylibrarian.config_read(reloaded=True)
def _loadCFG(): lazylibrarian.config_read(reloaded=True)