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 147 of file backend.py.

00147                            :
        '''Get all settings from defaults file'''
        self.defaults = {}
        for f in [self.files['defaults'], self.files['conf']]:
            try:
                orig = ufw.util.open_file_read(f)
            except:
                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('"\'')

            orig.close()

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


Generated by  Doxygen 1.6.0   Back to index