How to use the pywatchman.bser.loads function in pywatchman

To help you get started, we’ve selected a few pywatchman 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 facebook / buck / src / com / facebook / buck / json / buck.py View on Github external
global ui, hg
            from mercurial import ui, hg
            use_mercurial_glob = True
        except ImportError:
            d = Diagnostic(
                message=format_traceback_and_exception(),
                level='warning',
                source='mercurial'
            )
            to_parent.write(encode_result([], [d], None))
            to_parent.flush()

    configs = {}
    if options.config is not None:
        with open(options.config, 'rb') as f:
            for section, contents in bser.loads(f.read()).iteritems():
                for field, value in contents.iteritems():
                    configs[(section, field)] = value

    ignore_paths = []
    if options.ignore_paths is not None:
        with open(options.ignore_paths, 'rb') as f:
            ignore_paths = [make_glob(i) for i in bser.loads(f.read())]

    buildFileProcessor = BuildFileProcessor(
        project_root,
        cell_roots,
        options.build_file_name,
        options.allow_empty_globs,
        options.ignore_buck_autodeps_files,
        options.no_autodeps_signatures,
        watchman_client,
github facebook / watchman / python / pywatchman_aio / __init__.py View on Github external
def _loads(self, response):
        """ Parse the BSER packet """
        return bser.loads(
            response,
            True,
            value_encoding=encoding.get_local_encoding(),
            value_errors=encoding.default_local_errors,
        )