Merge branch 'master' of github.com:zalun/FlightDeck

This commit is contained in:
Oskar Krawczyk 2010-03-05 14:09:42 +00:00
Родитель ac471f74a4 b556e053a7
Коммит fde47abc68
1 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -1,6 +1,7 @@
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response, get_object_or_404
from django.http import Http404, HttpResponseRedirect, HttpResponse, HttpResponseNotAllowed
from django.http import Http404, HttpResponseRedirect, HttpResponse, \
HttpResponseNotAllowed, HttpResponseServerError
from django.template import RequestContext#,Template
from django.utils import simplejson
from django.contrib.auth.decorators import login_required
@ -304,3 +305,28 @@ def remove_dependency(r, slug, version, counter, type, d_slug, d_version, d_coun
return render_to_response('json/dependency_removed.json', locals(),
context_instance=RequestContext(r),
mimetype='application/json')
def createXPI(r):
"""
Create XPI from data given within POST
"""
# all data has to be provided by POST
import subprocess
# first create file structure
# save the directory using the hash only
try:
subprocess.check_call('cfx',
'--binary=/usr/bin/xulrunner',
'--pkgdir=%s' % dirname,
'xpi')
except subprocess.CalledProcessError:
return HttpResponseServerError
# return hash and xpi filename
def getXPI(r, hash, filename):
"""
return XPI file
"""