From: hernani Date: Fri, 4 Feb 2011 00:37:54 +0000 (+0000) Subject: Fixes the new line problems in the OSQA exporter. X-Git-Tag: live~453 X-Git-Url: https://git.openstreetmap.org/osqa.git/commitdiff_plain/dfcd16216da92b7011fad163462034e37f3c6996 Fixes the new line problems in the OSQA exporter. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@739 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum_modules/exporter/exporter.py b/forum_modules/exporter/exporter.py index df1237f..c54e758 100644 --- a/forum_modules/exporter/exporter.py +++ b/forum_modules/exporter/exporter.py @@ -65,7 +65,7 @@ def Etree_pretty__write(self, file, node, encoding, namespaces, if node.text or len(node): file.write(">") if node.text: - file.write(_escape_cdata(node.text.replace("\n", (level + 1) * identator + "\n"), encoding)) + file.write(_escape_cdata(node.text, encoding)) for n in node: self._write(file, n, encoding, namespaces, level + 1, identator) if node.text and len(node.text) < 125: @@ -77,7 +77,7 @@ def Etree_pretty__write(self, file, node, encoding, namespaces, for k, v in xmlns_items: del namespaces[v] if node.tail: - file.write(_escape_cdata(node.tail.replace("\n", level * identator + "\n"), encoding)) + file.write(_escape_cdata(node.tail.replace("\n", (level * identator )+ "\n"), encoding)) def make_date(date, with_time=True): try: @@ -187,7 +187,7 @@ def create_targz(tmp, files, start_time, options, user, state, set_state): with open(os.path.join(tmp, 'backup.inf'), 'wb') as inffile: inf.write(inffile) - t.add(os.path.join(tmp, '/backup.inf'), arcname='backup.inf') + t.add(os.path.join(tmp, 'backup.inf'), arcname='backup.inf') state['overall']['status'] = _('Saving backup file') set_state() t.close() diff --git a/forum_modules/exporter/urls.py b/forum_modules/exporter/urls.py index 6c92c6c..e9b35aa 100644 --- a/forum_modules/exporter/urls.py +++ b/forum_modules/exporter/urls.py @@ -2,10 +2,10 @@ from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template from django.utils.translation import ugettext as _ -from views import state, running, download, importer +from views import state, running, download urlpatterns = patterns('', url(r'^%s%s%s$' % (_('admin/'), _('exporter/'), _('state/')), state, name='exporter_state'), url(r'^%s(?P\w+)/%s$' % (_('admin/'), _('running/')), running, name='exporter_running'), url(r'^%s%s%s$' % (_('admin/'), _('exporter/'), _('download/')), download, name='exporter_download'), -) \ No newline at end of file +)