summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorSam Wenham <sam@wenhams.co.uk>2019-07-16 00:07:37 +0100
committerSam Wenham <sam@wenhams.co.uk>2019-07-16 00:07:37 +0100
commit08a41941f9e2b35b16548624d5070216dd933f79 (patch)
treecfd0bd7dfc68c77cf66d92d72b6d1d74e6155880 /utils.py
parenta26109cb3006dd64e1bec38100397ad636813e98 (diff)
downloadtroggle-08a41941f9e2b35b16548624d5070216dd933f79.tar.gz
troggle-08a41941f9e2b35b16548624d5070216dd933f79.tar.bz2
troggle-08a41941f9e2b35b16548624d5070216dd933f79.zip
Part one of getting troggle to work with django 1.10
Major rework of how survex is processed
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.py b/utils.py
index d5deeda..ffb9f66 100644
--- a/utils.py
+++ b/utils.py
@@ -46,7 +46,7 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}):
instance, created=objectType.objects.get_or_create(defaults=nonLookupAttribs, **lookupAttribs)
if not created and not instance.new_since_parsing:
- for k, v in nonLookupAttribs.items(): #overwrite the existing attributes from the logbook text (except date and title)
+ for k, v in list(nonLookupAttribs.items()): #overwrite the existing attributes from the logbook text (except date and title)
setattr(instance, k, v)
instance.save()
@@ -112,7 +112,7 @@ re_subs = [(re.compile(r"\<b[^>]*\>(.*?)\</b\>", re.DOTALL), r"'''\1'''"),
def html_to_wiki(text, codec = "utf-8"):
if type(text) == str:
- text = unicode(text, codec)
+ text = str(text, codec)
text = re.sub("</p>", r"", text)
text = re.sub("<p>$", r"", text)
text = re.sub("<p>", r"\n\n", text)