From d2aed5c8993780f577be5efd1ae28156997e1d2c Mon Sep 17 00:00:00 2001 From: zalun Date: Sat, 6 Mar 2010 01:41:00 +0000 Subject: [PATCH] preparing for XPI creation --- flightdeck/jetpack/media/js/Capability.js | 1 + flightdeck/jetpack/urls.py | 3 +++ flightdeck/jetpack/views.py | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/flightdeck/jetpack/media/js/Capability.js b/flightdeck/jetpack/media/js/Capability.js index 92f85676..2a4a0bd5 100644 --- a/flightdeck/jetpack/media/js/Capability.js +++ b/flightdeck/jetpack/media/js/Capability.js @@ -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) { diff --git a/flightdeck/jetpack/urls.py b/flightdeck/jetpack/urls.py index af1de131..a06e2330 100644 --- a/flightdeck/jetpack/urls.py +++ b/flightdeck/jetpack/urls.py @@ -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.*)/(?P.*)/$', 'getXPI', name='get_xpi'), + url(r'^jp_(?P.*)/v_(?P.*)\.(?P\d+)/$', 'jetpack_version_edit', name='jp_jetpack_version_edit'), url(r'^mod_(?P.*)/v_(?P.*)\.(?P\d+)/$', diff --git a/flightdeck/jetpack/views.py b/flightdeck/jetpack/views.py index 96151c10..dd9827be 100644 --- a/flightdeck/jetpack/views.py +++ b/flightdeck/jetpack/views.py @@ -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): """