-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repository.get_contents does not return directory information #140
Comments
I'll look at that soon, thank you for reporting. |
http://developer.github.com/v3/repos/contents/#get-contents does not document the response in the case :path is a directory. In that case, Github returns a list of files. This is why I missed the "contents of any file or directory" in this doc. I will have to return a different type depending on whether It doesn't make sense to mix this in the same method. I will add a |
so, what happens when you do |
Something like this (pseudo-code, obviously not tested):
The difference between https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js ( In the pseudo-code above, the
and will be lazy-completed by calling https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-typeahead.js if The
and will not be lazy-completed. (There is something inconsistent in Github API v3 here: calling the |
It's now implemented in branch @ksookocheff-va @bilderbuchi I close the issue, but do not hesitate to continue discussion here if needed. |
Thanks. :-) |
Hi, how would one go about finding directories through PyGitHub? I just need to find if the directory exist in the repo or not. |
The GitHub API returns a list of all files in a directory when you use Get Contents on a directory.
example:
https://api.github.com/repos/twitter/bootstrap/contents/js/?ref=d28343dc3ad53a411ae3685e7d6a7866c8c22d6b
Currently PyGithub only returns None when using this API to query a directory.
The text was updated successfully, but these errors were encountered: