SF.net SVN: morphix: [2584] trunk/morphixlivekiosk/scripts/mbuild/web/views .py

[email protected] Fri, 02 Nov 2007 15:38:33 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2584
          http://morphix.svn.sourceforge.net/morphix/?rev=2584&view=rev
Author:   gandalfar
Date:     2007-11-02 15:38:32 -0700 (Fri, 02 Nov 2007)

Log Message:
-----------
XML generating part, missing just the graphics

Modified Paths:
--------------
    trunk/morphixlivekiosk/scripts/mbuild/web/views.py

Modified: trunk/morphixlivekiosk/scripts/mbuild/web/views.py
===================================================================
--- trunk/morphixlivekiosk/scripts/mbuild/web/views.py	2007-11-02 22:28:44 UTC (rev 2583)
+++ trunk/morphixlivekiosk/scripts/mbuild/web/views.py	2007-11-02 22:38:32 UTC (rev 2584)
@@ -1,6 +1,7 @@
 from django.shortcuts import render_to_response
 from django.template import RequestContext
 from django import newforms as forms
+from django.http import HttpResponse
 
 import datetime, time
 import elementtree.ElementTree as ET
@@ -25,8 +26,16 @@
     if form.is_valid():
       dt = datetime.datetime.now()
       uniq = time.mktime(dt.timetuple()) + dt.microsecond/1e6
+      cd = form.cleaned_data
       
-      print uniq
+      root = ET.Element("LIVECD")
+      for v in cd:
+        sub = ET.SubElement(root, v)
+        sub.text = str(cd[v])
+      
+      tree = ET.ElementTree(root)
+      tree.write("incoming/%s.xml" % uniq)
+      return HttpResponse("The Elves have started preparing your LiveCD.")
   else:
     form = BuildForm()
     


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/