def commit(self): if self.update_buff: output = new_tempfile(self.user_id, 'twt') self.update_buff.sort(compare_tweets, reverse=True) for tweet in self.update_buff: output.write("%s\n" % json.dumps(tweet, sort_keys=True)) self.local_copy.seek(0, 0) copy_contents(self.local_copy, output) else: output = self.local_copy output.seek(0, 0) commit_file(output, self.user_id, 'twt')
def commit(self): self.local_copy.seek(0, 0) commit_file(self.local_copy, self.user_id, 'fws')