diff options
| author | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-09-22 11:46:15 -0400 |
|---|---|---|
| committer | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-09-22 11:46:15 -0400 |
| commit | 42f0d73ba8ed7a2b647cb1cf8dc4ceafcc71a114 (patch) | |
| tree | 7e61d5e09915e2c5ab2191dd6d496152e008f781 | |
| parent | cf9e9e02175d8eefe1986540f53b22a63f2e3f27 (diff) | |
timb: lol more unicode errors
| -rw-r--r-- | scripts/fill.image_urls.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/fill.image_urls.py b/scripts/fill.image_urls.py index 7686ecf..952b7ea 100644 --- a/scripts/fill.image_urls.py +++ b/scripts/fill.image_urls.py @@ -12,14 +12,18 @@ def get_num_images_in_db(): return int(ps()[0][0]) def add_url(url): - print(url) + try: + print(url) + except UnicodeEncodeError: + print("i thought python 3 fixed the unicode shit. yet i still get unicode errors everywhere. GOOD JOB FUCKHEADS") ps = db.prepare("DELETE FROM image_urls WHERE url=$1") ps(url) ps2 = db.prepare("INSERT INTO image_urls(url) VALUES($1)") ps2(url) +# NOTE. hardcoded room numbers to index here... only indexing DUMPFM (1) and GIF (8) currently. def get_messages(lower, upper): - ps = db.prepare("SELECT content FROM messages WHERE message_id >= $1 AND message_id <= $2 ORDER BY message_id ASC") + ps = db.prepare("SELECT content FROM messages WHERE message_id >= $1 AND message_id <= $2 AND room_id IN (1,8) ORDER BY message_id ASC") rows = ps(lower, upper) return rows |
