]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixes a python < 2.6 compatibility issue in the importer.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 11 Jun 2010 14:24:24 +0000 (14:24 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 11 Jun 2010 14:24:24 +0000 (14:24 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@407 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/sximporter/views.py

index 76bc8e4be99087b82c1f1f035e7ced07f6a06f83..95e6826ca497ba43dc93b4a6378b8d524500a5af 100644 (file)
@@ -12,9 +12,15 @@ def sximporter(request):
         dump = ZipFile(request.FILES['dump'])\r
         members = [f for f in dump.namelist() if f.endswith('.xml')]\r
         extract_to = os.path.join(os.path.dirname(__file__), 'tmp')\r
-        dump.extractall(extract_to, members)\r
-        importer.sximport(extract_to, request.POST)\r
+\r
+        for m in members:\r
+            f = open(os.path.join(extract_to, m), 'w')\r
+            f.write(dump.read(m))\r
+            f.close()\r
+\r
+        #dump.extractall(extract_to, members)\r
         dump.close()\r
+        importer.sximport(extract_to, request.POST)\r
 \r
     return render_to_response('modules/sximporter/page.html', {\r
     'names': list\r