How to use the pyyaml.load function in PyYAML

To help you get started, we’ve selected a few PyYAML examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nicosantangelo / sublime-text-i18n-rails / yaml.py View on Github external
def read_file(self):
        with open(self.locales_path.yaml(), 'r', encoding = "utf-8") as yaml_file:
            self.dict = self.yaml_to_write = pyyaml.load(yaml_file)

        return self.dict
github colinta / SublimeScreencastDirector / screencast_director.py View on Github external
def _run(self):
        regions = self.source_view.get_regions('screencast_director')
        region = regions[self.index]
        content = self.source_view.substr(region)
        commands = pyyaml.load(content)
        for entry in commands:
            self._execute(entry)
        if len(self.target_view.sel()):
            region = self.target_view.sel()[0]
        else:
            region = sublime.Region(0, 0)
        self.target_view.add_regions('screencast_director', [region], 'source', '', sublime.HIDDEN)
        self._start_timer()