Exemple #1
0
 def UpdateRietveldDescription(self):
   """Sets the description for an issue on Rietveld."""
   data = [("description", self.description),]
   ctype, body = upload.EncodeMultipartFormData(data, [])
   self.SendToRietveld('/%d/description' % self.issue, payload=body,
       content_type=ctype)
   self.needs_upload = False
Exemple #2
0
  def CloseIssue(self):
    """Closes the Rietveld issue for this changelist."""
    # Newer versions of Rietveld require us to pass an XSRF token to POST, so
    # we fetch it from the server.
    xsrf_token = self.SendToRietveld(
        '/xsrf_token',
        extra_headers={'X-Requesting-XSRF-Token': '1'})

    # You cannot close an issue with a GET.
    # We pass an empty string for the data so it is a POST rather than a GET.
    data = [("description", self.description),
            ("xsrf_token", xsrf_token)]
    ctype, body = upload.EncodeMultipartFormData(data, [])
    self.SendToRietveld('/%d/close' % self.issue, payload=body,
        content_type=ctype)
Exemple #3
0
 def post(self, request_path, data, **kwargs):
   ctype, body = upload.EncodeMultipartFormData(data, [])
   return self._send(request_path, payload=body, content_type=ctype, **kwargs)
Exemple #4
0
 def UpdateRietveldDescription(self):
   """Sets the description for an issue on Rietveld."""
   data = [("description", self.description),]
   ctype, body = upload.EncodeMultipartFormData(data, [])
   SendToRietveld("/%d/description" % self.issue, body, ctype)
Exemple #5
0
 def CloseIssue(self):
   """Closes the Rietveld issue for this changelist."""
   data = [("description", self.description),
           ("xsrf_token", GetXsrfToken())]
   ctype, body = upload.EncodeMultipartFormData(data, [])
   SendToRietveld("/%d/close" % self.issue, body, ctype)