def attach(self, bugid, filename, content_type = 'text/plain', description = None): """ Attach a file to a bug given a filename. """ if not os.path.exists(filename): raise BugzError('File not found: %s' % filename) if not description: description = block_edit('Enter description (optional)') result = Bugz.attach(self, bugid, filename, description, filename, content_type)
def attach(self, bugid, filename, content_type = 'text/plain', patch = False, description = None): """ Attach a file to a bug given a filename. """ if not os.path.exists(filename): raise BugzError('File not found: %s' % filename) if not description: description = block_edit('Enter description (optional)') result = Bugz.attach(self, bugid, filename, description, filename, content_type, patch) if result == True: self.log("'%s' has been attached to bug %s" % (filename, bugid)) else: reason = "" if result and result != False: reason = "\nreason: %s" % result raise RuntimeError("Failed to attach '%s' to bug %s%s" % (filename, bugid, reason))
def attach(self, bugid, filename, content_type='text/plain', patch=False, description=None): """ Attach a file to a bug given a filename. """ if not os.path.exists(filename): raise BugzError('File not found: %s' % filename) if not description: description = block_edit('Enter description (optional)') result = Bugz.attach(self, bugid, filename, description, filename, content_type, patch) if result == True: self.log("'%s' has been attached to bug %s" % (filename, bugid)) else: reason = "" if result and result != False: reason = "\nreason: %s" % result raise RuntimeError("Failed to attach '%s' to bug %s%s" % (filename, bugid, reason))