>>> from github import Github
>>> gh = Github( "login", "password", "base_url")
>>> for repo in gh.get_user().get_repos():
... print repo.name
>>> for repo in gh.get_organization( org_name ).get_repos():
... print repo.name
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.7-intel/egg/github/Organization.py", line 311, in get_repos
File "build/bdist.macosx-10.7-intel/egg/github/Requester.py", line 60, in requestAndCheck
File "build/bdist.macosx-10.7-intel/egg/github/Requester.py", line 76, in requestRaw
Is this because of my lack of knowledge about python, or is there something else going on here ?
What I would like to do is be able to get a list of the hooks in all the repos in an organization and also go through that list of repos in an organization and be able to create hooks.
Definitely not a lack of knowledge on your part. I'll investigate (and hopefully fix it) today.
Ok, this has to be related to the Enterprise thing, and I don't have access to a Github Enterprise server.
Can you please check that gh.get_organization( org_name ).url starts with the base_url you give to the Github constructor?
gh.get_organization( org_name ).url
This behavior of Github Enterprise looks like a bug to me.
Anyway, I will work around it in PyGithub. I will publish the fix in version 1.7 tonight.
Note to myself:
For your assert, shouldn't that be:
the scheme is either the same or "https" if the self.__baseUrl scheme was NOT "http" ?
The way you've stated it, it sounds like that you're going to replace http with https.
Don't worry, my plan is to keep all informations from base_url and use only the parts I need from the requested url, so if you say that you use http in base_url, I will keep this scheme for all requests.
Well now I'm not worried :)
I'm planning to fork the project and work on the documentation of it. I think there might be a better way to generate the class reference and also provide some code samples, a sort of tutorial.
That would be great! I open issue #82 to discuss this subject. When you want to take time to think about that, feel free to discuss in this issue.
Work-around Github Enterprise bad URL (issue #80)
This should be fixed by previous commit, so I close the issue to be able to close the milestone tonight. Do not hesitate to re-open it if you still have related problems with version 1.7
How quickly will this show up in whatever repository is used by easy_install ? I'm on a MacOS X system.
It's already on PyPi, so easy_install --upgrade PyGithub should fetch it.
easy_install --upgrade PyGithub
duh ! that was quick :)
>>> gh = Github( login, password, github_url)
>>> for org in gh.get_organization( org_name ).get_repos():
... print org.name
It works !!! :)