On 08/15/2016 11:37 AM, Jakub Jelinek wrote:
> On Mon, Aug 15, 2016 at 11:31:22AM +0200, Martin Liška wrote:
>> diff --git a/contrib/mark_spam.py b/contrib/mark_spam.py
>> index 569a03d..f206356 100755
>> --- a/contrib/mark_spam.py
>> +++ b/contrib/mark_spam.py
>> @@ -34,6 +34,10 @@ def mark_as_spam(id, api_key, verbose):
>>      r = requests.get(u)
>>      response = json.loads(r.text)
>>  
>> +    if 'error' in response and response['error']:
>> +        print(response['message'])
>> +        return
>> +
>>      # 2) mark the bug as spam
>>      cc_list = response['bugs'][0]['cc']
>>      data = {
>> @@ -49,6 +53,7 @@ def mark_as_spam(id, api_key, verbose):
>>          'cc': {'remove': cc_list},
>>          'priority': 'P5',
>>          'severity': 'trivial',
>> +        'url': '',
>>          'assigned_to': 'unassig...@gcc.gnu.org' }
>>  
>>      r = requests.put(u, json = data)
>> @@ -74,7 +79,12 @@ def mark_as_spam(id, api_key, verbose):
>>      for a in attachments:
>>          attachment_id = a['id']
>>          url = '%sbug/attachment/%d' % (base_url, attachment_id)
>> -        r = requests.put(url, json = {'ids': [attachment_id], 'summary': 
>> 'spam', 'comment': 'spam', 'is_obsolete': True, 'api_key': api_key})
>> +        r = requests.put(url, json = {'ids': [attachment_id],
>> +            'summary': 'spam',
>> +            'file_name': 'spam',
>> +            'content_type': 'application/x-spam',
>> +            'is_obsolete': True,
> 
> Is dropping of 'comment": 'spam' intentional?

Yes, it's not necessary to do a comment about the change for an attachment.
As the name of the attachment is set to spam, it's obvious in a comment
that is made for that.

Martin

> 
>> +            'api_key': api_key})
>>          if verbose:
>>              print(r)
>>              print(r.text)
> 
>       Jakub
> 

Reply via email to