Permalink
Browse files

use tuple instead of TopicData class

  • Loading branch information...
1 parent e1b406b commit 8e468b888bf4a1c5860ce51ffa4a2137c7cbdd9e @kjk committed Jul 4, 2008
Showing with 2 additions and 10 deletions.
  1. +1 −1 fruitshow_dump_upload.py
  2. +1 −2 main.py
  3. +0 −7 offsets.py
View
@@ -132,7 +132,7 @@ def main():
topic_id = topic[TOPIC_ID]
post_ids = [p[TP_POST_ID] for p in topic_posts if topic_id == p[TP_TOPIC_ID]]
posts = [p for p in all_posts if p[POST_ID] in post_ids]
- topic_data = TopicData(topic, posts)
+ topic_data = (topic, posts)
fo = StringIO.StringIO()
pickle.dump(topic_data, fo)
topic_pickled = fo.getvalue()
View
@@ -549,9 +549,8 @@ def post(self):
topic_data = pickle.load(fo)
fo.close()
- topic = topic_data.topic
+ (topic, posts) = topic_data
topic_no = topic[TOPIC_ID]
- posts = topic_data.posts
if 0 == len(posts):
logging.info("There are no posts in this topic.")
return self.error(NOT_ACCEPTABLE)
View
@@ -1,13 +1,6 @@
# This code is in Public Domain. Take all the code you want, we'll just write more.
-# TODO: rename this file to common.py or sth.
-
(POST_ID, POST_MSG, POST_NAME, POST_EMAIL, POST_URL, POST_POSTED_ON, POST_POSTER_IP, POST_POSTER_KEY, POST_UNIQUE_KEY, POST_DELETED, POST_LAST_MOD) = range(11)
(TOPIC_ID, TOPIC_FIRST_POST, TOPIC_SUBJECT) = range(3)
(TP_TOPIC_ID, TP_POST_ID) = range(2)
-class TopicData:
- def __init__(self, topic, posts):
- self.topic = topic
- self.posts = posts
-

0 comments on commit 8e468b8

Please sign in to comment.