Logo Search packages:      
Sourcecode: ufw version File versions

def src::backend::UFWBackend::_get_defaults (   self  )  [private]

Get all settings from defaults file

Definition at line 165 of file backend.py.

00165                            :
        '''Get all settings from defaults file'''
        self.defaults = {}
        for f in [self.files['defaults'], self.files['conf']]:
                orig = ufw.util.open_file_read(f)
            except Exception:
                err_msg = _("Couldn't open '%s' for reading") % (f)
                raise UFWError(err_msg)
            pat = re.compile(r'^\w+="?\w+"?')
            for line in orig:
                if pat.search(line):
                    tmp = re.split(r'=', line.strip())
                    self.defaults[tmp[0].lower()] = tmp[1].lower().strip('"\'')


    def set_default(self, f, opt, value):

Generated by  Doxygen 1.6.0   Back to index