コード例 #1
0
ファイル: __init__.py プロジェクト: xihaxiaozi1/watchman
    def capabilityCheck(self, optional=None, required=None):
        """ Perform a server capability check """
        res = self.query('version', {
            'optional': optional or [],
            'required': required or []})

        if not self._hasprop(res, 'capabilities'):
            # Server doesn't support capabilities, so we need to
            # synthesize the results based on the version
            capabilities.synthesize(res, opts)
            if 'error' in res:
                raise CommandError(res['error'])

        return res
コード例 #2
0
    def capabilityCheck(self, optional=None, required=None):
        """ Perform a server capability check """
        res = self.query('version', {
            'optional': optional or [],
            'required': required or []})

        if not 'capabilities' in res:
            # Server doesn't support capabilities, so we need to
            # synthesize the results based on the version
            capabilities.synthesize(res, opts)
            if 'error' in res:
                raise CommandError(res['error'])

        return res