diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-03-25 22:08:27 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-03-25 22:08:27 (GMT) |
commit | d1bb616aae8a11afef2627cf8a8d166156a05cf7 (patch) | |
tree | ba1cb988d625725660aeab0d04ce3fa16ca47a96 /program | |
parent | a5ccb836a3a281c6526a497a4426335eedbcad93 (diff) |
fixed encoding problems. again.
Diffstat (limited to 'program')
-rw-r--r-- | program/management/commands/importhosts.py | 2 | ||||
-rw-r--r-- | program/management/commands/importnotes.py | 6 | ||||
-rw-r--r-- | program/management/commands/importprogramslots.py | 4 | ||||
-rw-r--r-- | program/management/commands/importshows.py | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/program/management/commands/importhosts.py b/program/management/commands/importhosts.py index dcdf4be..39a8afd 100644 --- a/program/management/commands/importhosts.py +++ b/program/management/commands/importhosts.py @@ -22,7 +22,7 @@ WHERE letzter_termin > current_date AND macher != '' AND titel NOT LIKE 'Musikpr counter = 0 for row in cursor.fetchall(): - for macher in row[0].decode('latin1').encode('utf8').split(','): + for macher in row[0].split(','): host = Host(name=macher.strip()) host.save() diff --git a/program/management/commands/importnotes.py b/program/management/commands/importnotes.py index a8030ec..19ddfed 100644 --- a/program/management/commands/importnotes.py +++ b/program/management/commands/importnotes.py @@ -26,9 +26,9 @@ WHERE n.sendung_id in (SELECT id FROM sendungen WHERE letzter_termin > current_d counter = 0 for ntitel, datum, stitel, notiz in cursor.fetchall(): - ntitel = strip_tags(ntitel.decode('latin1').encode('utf8')) - stitel = strip_tags(stitel.decode('latin1').encode('utf8')) - notiz = clean_html(notiz.decode('latin1').encode('utf8')) + ntitel = strip_tags(ntitel) + stitel = strip_tags(stitel) + notiz = clean_html(notiz) if stitel.endswith('(Wiederholung)'): stitel = stitel[:-15] diff --git a/program/management/commands/importprogramslots.py b/program/management/commands/importprogramslots.py index 8739bbb..52aa73a 100644 --- a/program/management/commands/importprogramslots.py +++ b/program/management/commands/importprogramslots.py @@ -32,7 +32,7 @@ WHERE letzter_termin > current_date AND titel NOT LIKE 'Musikprogramm' AND titel counter = 0 for titel, beginn, ende, erster_termin, letzter_termin, rhytmus, termin in cursor.fetchall(): - titel = strip_tags(titel.decode('latin1').encode('utf8')) + titel = strip_tags(titel) hours, seconds = divmod(beginn.seconds, 3600) minutes, seconds = divmod(seconds, 60) @@ -64,7 +64,7 @@ FROM sendungen WHERE letzter_termin > current_date AND titel LIKE '%%(Wiederholung)'""") for titel, beginn, ende, erster_termin, letzter_termin, rhytmus, termin in cursor.fetchall(): - titel = titel.decode('latin1').encode('utf8')[:-15] + titel = strip_tags(titel[:-15]) hours, seconds = divmod(beginn.seconds, 3600) minutes, seconds = divmod(seconds, 60) diff --git a/program/management/commands/importshows.py b/program/management/commands/importshows.py index 9fee4ef..b013dab 100644 --- a/program/management/commands/importshows.py +++ b/program/management/commands/importshows.py @@ -28,14 +28,14 @@ ORDER BY titel, beginn, ende""") counter = 0 for titel, beschreibung, web, macher in cursor.fetchall(): - titel = strip_tags(titel.decode('latin1').encode('utf8')) - beschreibung = clean_html(beschreibung.decode('latin1').encode('utf8')) + titel = strip_tags(titel) + beschreibung = clean_html(beschreibung) slug = slugify(titel) hosts = [] - for macher in macher.decode('latin1').encode('utf8').split(','): + for macher in macher.split(','): macher = macher.strip() try: host = Host.objects.get(name=macher) |