Add support for repository, user, issue code search #224

Merged
merged 7 commits into from Mar 3, 2014

Conversation

Projects
None yet
2 participants
Contributor

thialfihar commented Feb 8, 2014

Hey, great project, thanks for all the work.

I needed the search API, so I added it for repositories, users, issues, and code. Maybe it works for you.

The __grow() change is optional, but I think it is useful to have the totalCount property.
Search results also populate a 'score' attribute for each element, but I think it's enough that this can be accessed via obj.raw_data.

thialfihar added some commits Feb 8, 2014

@thialfihar thialfihar Make PaginatedList support the search wrapper JSON
For /search resources the resulting JSON contains 'total_count' and
'items'. The latter is the list PaginatedList expects, so just
transparently use that list. Everything else works just like other
lists.

Also change __grow()'s visibility to allow PaginatedList to use it
in order to peek at 'total_count', making it available as a property.
9a51a61
@thialfihar thialfihar Add repository search
Qualifiers can be added via keyword args in order to keep the method
uncluttered. Qualifiers could also be given in the query string
directly.
b5faac0
@thialfihar thialfihar Add user search
Qualifiers can be added via keyword args in order to keep the method
uncluttered. Qualifiers could also be given in the query string
directly.
b1e60eb
@thialfihar thialfihar Add issue search
Qualifiers can be added via keyword args in order to keep the method
uncluttered. Qualifiers could also be given in the query string
directly.
b1524e2
@thialfihar thialfihar Add code search
Code search results are content resources with an embedded repository.
The "content" and "encoding" attributes aren't returned and require
completion.
3afae93
@thialfihar thialfihar Add decoded_content property to ContentFile
The only encoding currently supported is base64, but that's ok, since
v3 of the GitHub API only mentions base64.
59e92f8
@thialfihar thialfihar Fix add_attribute insertion logic
The code didn't work if it couldn't find a property in the file
that is lexicographically greater than the new attribute.
It now accepts _identity as an "end point" to insert before, and
empty lines in _initAttributes() and _useAttributes(), as they mark
the end of the method.

Also add "float" as a possible type, mainly for the "score" attribute
in search results.
6ef3a02
Owner

jacquev6 commented Feb 27, 2014

This looks great, thank you!

I'll merge that next week-end and publish a new version of PyGithub.

thialfihar added the v1 label Mar 2, 2014

jacquev6 was assigned by thialfihar Mar 3, 2014

jacquev6 added this to the Version 1.24.0 milestone Mar 3, 2014

@jacquev6 jacquev6 added a commit that referenced this pull request Mar 3, 2014

@jacquev6 jacquev6 Fix doc (#224) 87dbb94

@jacquev6 jacquev6 merged commit 6ef3a02 into PyGithub:master Mar 3, 2014

1 check passed

default The Travis CI build passed
Details
Owner

jacquev6 commented Mar 3, 2014

It's in PyGithub 1.24.0, thanks!

@koobs koobs added a commit to freebsd/freebsd-ports that referenced this pull request Mar 8, 2014

@koobs koobs devel/py-pygithub: Update to 1.24.0
- Update to 1.24.0

Changes:

 * Implement search [1]

[1] PyGithub/PyGithub#224
5980568

@knu knu pushed a commit to idaemons/freebsd-ports that referenced this pull request Mar 9, 2014

koobs devel/py-pygithub: Update to 1.24.0
- Update to 1.24.0

Changes:

 * Implement search [1]

[1] PyGithub/PyGithub#224


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@347444 35697150-7ecd-e111-bb59-0022644237b5
9a475b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment