def to_ocaml_features(self): """Populate ocaml features object (defined in snippets) with content of this feature object. This is useful to use the high-level Python abilities to read these features from a file/string before setting the ocaml features with this data.""" import ocaml for section in self.sections(): for key, value in self.items(section): ocaml.snippets_register_feature(section, key, value)
def to_ocaml_features(self): """Populate ocaml features object (defined in snippets) with content of this feature object. This is useful to use the high-level Python abilities to read these features from a file/string before setting the ocaml features with this data.""" import ocaml for section in self.sections(): for key,value in self.items(section): ocaml.snippets_register_feature(section,key,value)
def update_features(conf): import ocaml ocaml.snippets_register_feature('file-cache', 'directory', conf.get('file-cache-directory'))
def set(self, section, key, value): """Set key,value - pair in given section""" self._must_be_strings('set', [('section', section), ('key', key), ('value', value)]) ocaml.snippets_register_feature(section, key, value)