diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:34:14 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:34:14 +0100 |
commit | a366161a245339072d55581374df396271cabcac (patch) | |
tree | a645701cce476134af779aa7997c0887b6afaac7 /parsers/survex.py | |
parent | ecc4e1dc1316d081ba4733717c92f7a2f3a719ad (diff) | |
download | troggle-a366161a245339072d55581374df396271cabcac.tar.gz troggle-a366161a245339072d55581374df396271cabcac.tar.bz2 troggle-a366161a245339072d55581374df396271cabcac.zip |
[svn] Converted screen output display to ASCII, so that I could run the script
via SSH on a server
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8171 by julian @ 1/17/2009 8:36 PM
Diffstat (limited to 'parsers/survex.py')
-rw-r--r-- | parsers/survex.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/parsers/survex.py b/parsers/survex.py index 540ea0b..00b6254 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -74,9 +74,11 @@ def make_model(name, parent, iter_lines, sf, c, l): survex_block = m, role = models.Role.objects.get(name = roles[role])).save() except AttributeError: - print "Person not found: " + name + " in " + file_ + print ("Person not found: " + name + " in " + file_).encode('ascii', 'xmlcharrefreplace') except AssertionError, inst: - print inst, ": ", file_year[0] + print (unicode(inst) + ": " + unicode(file_year[0])).encode('ascii', 'xmlcharrefreplace') + except models.Expedition.DoesNotExist: + print "Expo"+str(file_year[1]).encode('ascii', 'xmlcharrefreplace') m.end_file = survex_file m.end_char = count @@ -112,7 +114,7 @@ def make_model(name, parent, iter_lines, sf, c, l): if h: team.append((survex_file, h.groups())) else: - print "Role not found: " + line + " in: " + sf + print ("Role not found: " + line + " in: " + sf).encode('ascii', 'xmlcharrefreplace') m.text = m.text + line saveEnd(survex_file, count) |