~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/service.py

  • Committer: Curtis Hovey
  • Date: 2012-03-17 21:03:40 UTC
  • Revision ID: curtis.hovey@canonical.com-20120317210340-03lp3pw0raiwndew
Do not return a needless empty string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
            try:
54
54
                self.store.put_archive(self.path[0])
55
55
                self.send_response(httplib.CREATED)
56
 
                return ['']
 
56
                return []
57
57
            except Exception, error:
58
58
                self.send_response(
59
59
                    httplib.BAD_REQUEST, reason=error.__doc__)
60
 
                return ['']
 
60
                return []
61
61
        if len(self.path) == 2:
62
62
            # This expected path is /archive/archive_id/message_id.
63
63
            try:
65
65
                message = put_input.read(int(self.environ['CONTENT_LENGTH']))
66
66
                self.store.put_message(self.path[0], self.path[1], message)
67
67
                self.send_response(httplib.CREATED)
68
 
                return ['']
 
68
                return []
69
69
            except:
70
70
                self.send_response(httplib.BAD_REQUEST)
71
 
                return ['']
 
71
                return []
72
72
 
73
73
    def do_POST(self):
74
74
        """Change a message on POST."""
82
82
                return [simplejson.dumps(response)]
83
83
            except:
84
84
                self.send_response(httplib.BAD_REQUEST)
85
 
                return ['']
 
85
                return []
86
86
 
87
87
    def do_GET(self):
88
88
        """Retrieve a list of messages on GET."""
93
93
            return [simplejson.dumps(response)]
94
94
        except Exception, error:
95
95
            self.send_response(httplib.BAD_REQUEST, reason=error.__doc__)
96
 
            return ['']
 
96
            return []
97
97
 
98
98
    def log_message(self, format, *args):
99
99
        """Override log_message to use standard Python logging."""