changeset 54:39325717218d

attach comments
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 19 Sep 2013 10:55:13 -0700
parents 8e245a01829d
children a5b7ea791f64
files bzconsole/api.py setup.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/bzconsole/api.py	Mon Sep 16 04:51:48 2013 -0700
+++ b/bzconsole/api.py	Thu Sep 19 10:55:13 2013 -0700
@@ -180,10 +180,6 @@
 
         assert self.username and self.password, "Must be authenticated"
 
-        if not description:
-            # fairly hacky :/
-            description = attachment
-
         # read contents
         if '://' in attachment:
             # URL
@@ -200,6 +196,8 @@
         else:
             # TODO: better content_type
             content_type = 'text/plain'
+        if not description:
+            description = basename
 
         # patch flags
         flags = []
@@ -225,6 +223,8 @@
                      'is_private': False,
                      'size': len(contents)
                      }
+        if comment:
+            attachment['comments'] = [self._comment(comment)]
 
         return self._request('/bug/%s/attachment' % bug, attachment)
 
--- a/setup.py	Mon Sep 16 04:51:48 2013 -0700
+++ b/setup.py	Thu Sep 19 10:55:13 2013 -0700
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 import sys, os
 
-version = '0.3.2'
+version = '0.3.3'
 
 readme = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.txt')