Using Python/Django to update GitHub -


this broken code wrote update github repo django powered web-based code-editor, see https://github.com/djangocoder/djangogui/blob/master/projects/views.py line 763. how rewrite code work?

def update_github(request, project_slug):     print 'update github\n' * 100     project = project.objects.get(created_by=request.user, slug=project_slug)     import pexpect     child = pexpect.spawn('/bin/bash',)     import sys     child.logfile = sys.stdout      print 'a'     child.sendline('cd %s' % (project.get_current_directory()))     print 'b'     child.sendline('git add *')     child.sendline('git commit -m "commit"')     print 'c'     child.sendline('git push -u origin master')     print 'd'     child.sendline('ssgmssgm2')     print 'e'      return httpresponse('') 

i think should use github api kind of work.
see http://developer.github.com/v3/ more more details.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -