From 887f09464b623c498cdfb78e738e5c4576d9b47f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 25 Dec 2011 18:55:40 +0530 Subject: [PATCH] newlines --- import_padma.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/import_padma.py b/import_padma.py index d939ce5..b854b57 100755 --- a/import_padma.py +++ b/import_padma.py @@ -70,9 +70,9 @@ def html_parser(text): text = re.sub('\[(/.+?) (.+?)\]', '\\2', text) text = text.replace('__LINK__', 'http').replace('__DOT__', '.') - text = text.replace("\n\n", '

\n') - text = text.replace("\n", '
\n').replace('


\n', '

\n') - text = u'

%s

'%text + + text = text.replace('\n\n', '
\n').replace("\n", '
\n') + return text @@ -158,7 +158,7 @@ def import_layers(item, layers): annotation.end = float(layer['time_out'])/1000 username = layer['creator'].strip() annotation.user = User.objects.get(username=username) - annotation.value = html_parser(layer['value'], False) + annotation.value = html_parser(layer['value']) annotation.created = datetime.fromtimestamp(int(layer['created'])) annotation.modified = datetime.fromtimestamp(int(layer['modified'])) annotation.save()