Commits

Antoine Millet committed eb3bf3c

Added a from_filename contructor to Dotconf class

Comments (0)

Files changed (1)

dotconf/__init__.py

         self._config = config
         self._schema = schema
 
+    @classmethod
+    def from_filename(cls, filename, **kwargs):
+        fconf = open(filename)
+        return cls(fconf.read())
+
     def _parse(self):
         parser = DotconfParser(self._config, debug=False, write_tables=False,
                                errorlog=yacc.NullLogger())