~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/service.py

  • Committer: Curtis Hovey
  • Date: 2012-03-17 21:04:24 UTC
  • mto: This revision was merged to the branch mainline in revision 45.
  • Revision ID: curtis.hovey@canonical.com-20120317210424-v48z5vpdsgfxi0nd
do_PUT aways returns a empty list.

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 []
57
56
            except Exception, error:
58
57
                self.send_response(
59
58
                    httplib.BAD_REQUEST, reason=error.__doc__)
60
 
                return []
61
 
        if len(self.path) == 2:
 
59
        elif len(self.path) == 2:
62
60
            # This expected path is /archive/archive_id/message_id.
63
61
            try:
64
62
                put_input = self.environ['wsgi.input']
65
63
                message = put_input.read(int(self.environ['CONTENT_LENGTH']))
66
64
                self.store.put_message(self.path[0], self.path[1], message)
67
65
                self.send_response(httplib.CREATED)
68
 
                return []
69
66
            except:
70
67
                self.send_response(httplib.BAD_REQUEST)
71
 
                return []
 
68
        return []
72
69
 
73
70
    def do_POST(self):
74
71
        """Change a message on POST."""