This commit is contained in:
zalun 2010-03-06 01:41:00 +00:00
Родитель 3d9905c2a8
Коммит d2aed5c899
3 изменённых файлов: 12 добавлений и 1 удалений

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

@ -275,6 +275,7 @@ var CapVersion = new Class({
version_content: this.options.content,
version_name: this.options.name,
version_description: this.options.description,
version_counter: this.options.counter
});
// set as base functionality
if (!this.options.is_base) {

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

@ -3,6 +3,9 @@ from django.conf.urls.defaults import *
urlpatterns = patterns('jetpack.views',
url(r'^gallery/$', 'gallery', name='gallery'),
url(r'^create_xpi/$', 'createXPI', name='create_xpi'),
url(r'^get_xpi/(?P<hash>.*)/(?P<filename>.*)/$', 'getXPI', name='get_xpi'),
url(r'^jp_(?P<slug>.*)/v_(?P<version>.*)\.(?P<counter>\d+)/$',
'jetpack_version_edit', name='jp_jetpack_version_edit'),
url(r'^mod_(?P<slug>.*)/v_(?P<version>.*)\.(?P<counter>\d+)/$',

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

@ -311,11 +311,12 @@ def remove_dependency(r, slug, version, counter, type, d_slug, d_version, d_coun
def createXPI(r):
"""
Create XPI from data given within POST
Data will be cleaned by cron every x minutes
"""
# all data has to be provided by POST
import subprocess
# first create file structure
# save the directory using the hash only
import subprocess
try:
subprocess.check_call('cfx',
'--binary=/usr/bin/xulrunner',
@ -324,7 +325,13 @@ def createXPI(r):
except subprocess.CalledProcessError:
return HttpResponseServerError
# return hash and xpi filename
return render_to_response('json/xpi_created.json', {'url':xpi_url},
context_instance=RequestContext(r),
mimetype='application/json')
def getXPI(r, hash, filename):
"""