How to use the dotbot.util.string.indent_lines function in dotbot

To help you get started, we’ve selected a few dotbot 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 anishathalye / dotbot / dotbot / config.py View on Github external
def _read(self, config_file_path):
        try:
            _, ext = os.path.splitext(config_file_path)
            with open(config_file_path) as fin:
                if ext == '.json':
                    data = json.load(fin)
                else:
                    data = yaml.safe_load(fin)
            return data
        except Exception as e:
            msg = string.indent_lines(str(e))
            raise ReadingError('Could not read config file:\n%s' % msg)