bugwarrior/services/pagure.py
def get_issues(self, repo, keys):
        """ Grab all the issues """
        key1, key2 = keys
        key3 = key1[:-1]  # Just the singular form of key1

        url = self.base_url + "/api/0/" + repo + "/" + key1
        response = self.session.get(url, params=dict(status='Open'))

        if not bool(response):
            error = response.json()
            code = error['error_code']
            if code == 'ETRACKERDISABLED':
                return []
            else:
                raise IOError('Failed to talk to %r %r' % (url, error))

        issues = []
        for result in response.json()[key2]:
            idx = six.text_type(result['id'])
            result['html_url'] = "/".join([self.base_url, repo, key3, idx])
            issues.append((repo, result))

        return issues
def get_issues(self, repo, keys):
        """ Grab all the issues """
        key1, key2 = keys
        key3 = key1[:-1]  # Just the singular form of key1

        url = self.base_url + "/api/0/" + repo + "/" + key1
        response = self.session.get(url, params=dict(status='Open'))

        if not bool(response):
            error = response.json()
            code = error['error_code']
            if code == 'ETRACKERDISABLED':
                return []
            else:
                raise IOError('Failed to talk to %r %r' % (url, error))

        issues = []
        for result in response.json()[key2]:
            idx = six.text_type(result['id'])
            result['html_url'] = "/".join([self.base_url, repo, key3, idx])
            issues.append((repo, result))

        return issues
def get_issues ( self , repo , keys ) : key1 , key2 = keys key3 = key1 [ : - 1 ] # Just the singular form of key1 url = self . base_url + "/api/0/" + repo + "/" + key1 response = self . session . get ( url , params = dict ( status = 'Open' ) ) if not bool ( response ) : error = response . json ( ) code = error [ 'error_code' ] if code == 'ETRACKERDISABLED' : return [ ] else : raise IOError ( 'Failed to talk to %r %r' % ( url , error ) ) issues = [ ] for result in response . json ( ) [ key2 ] : idx = six . text_type ( result [ 'id' ] ) result [ 'html_url' ] = "/" . join ( [ self . base_url , repo , key3 , idx ] ) issues . append ( ( repo , result ) ) return issues
Grab all the issues
Grab all the issues