+from __future__ import with_statement
+
import os, tarfile, datetime, logging, re, ConfigParser, shutil, zipfile
from django.core.cache import cache
from django.conf import settings as djsettings
import settings as selfsettings
-# Try to import the with statement
-try:
- from __future__ import with_statement
-except:
- pass
-
CACHE_KEY = "%s_exporter_state" % APP_URL
EXPORT_STEPS = []
if content:
try:
tag.text = unicode(content)
- except:
- tag.text = u''
+ except Exception, e:
+ #logging.error('error converting unicode characters')
+ #import traceback
+ #logging.error(traceback.print_exc())
+
+ import string
+ tag.text = unicode("".join([c for c in content if c in string.printable]))
for k, v in attrs.items():
tag.set(k, unicode(v))
el.add('author', n.author.id)
el.add('date', make_date(n.added_at))
el.add('parent', n.parent and n.parent.id or "")
- el.add('absparent', n.abs_parent and n.abs_parent or "")
+ el.add('absparent', n.abs_parent and n.abs_parent.id or "")
act = el.add('lastactivity')
act.add('by', n.last_activity_by and n.last_activity_by.id or "")
rev.add('tags', ", ".join(r.tagname_list()))
el.add('marked', n.marked and 'true' or 'false')
+ el.add('wiki', n.nis.wiki and 'true' or 'false')
el.add('extraRef', n.extra_ref and n.extra_ref.id or "")
make_extra(el.add('extraData'), n.extra)
el.add('extraCount', n.extra_count and n.extra_count or "")