Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 304813 Details for
Bug 445607
RFE: XML-RPC method bug.setAttachmentsMIMETypes(bug.structData["attachments"])
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
script using the requested method
fixContentTypes.py (text/x-python), 1.57 KB, created by
Matěj Cepl
on 2008-05-07 22:35:48 UTC
(
hide
)
Description:
script using the requested method
Filename:
MIME Type:
Creator:
Matěj Cepl
Created:
2008-05-07 22:35:48 UTC
Size:
1.57 KB
patch
obsolete
>#!/usr/bin/env python ># -*- coding: utf-8 -*- >"""\tUsage: addAttach bugNumber filename description""" > >import bugzilla, sys > >def parseActions(parsedString,attL): > """create actionList with indexes of attachments to be changed > """ > intrList = [] > parsedString.strip() > for aItem in parsedString.split(","): > if aItem.isdigit() and (int(aItem) not in intrList) \ > and (int(aItem) < len(attL)): > intrList.append(int(aItem)) > elif aItem.find("-") <> -1: > aILeft,aIRight = aItem.split("-",2) > if aILeft.isdigit() and aIRight.isdigit(): > for i in range(int(aILeft),int(aIRight)+1): > if (i < len(attL)) and (i not in intrList): > intrList.append(i) > else: > raise ValueError,"Incorrect range specification -- %s" % aItem > return intrList > >if __name__ == '__main__': > if len(sys.argv)>1: > bugID=int(sys.argv[1]) > else: > print >>sys.stderr,__doc__ > sys.exit(1) > > bug=bugzilla.Bug(bugID) > > attList = [] > for att in bug.structData["attachments"]: > if not(att["isobsolete"]): > attList.append((att["attachid"],att["description"],att["contenttype"])) > > # And now we are running only out of attList > if len(sys.argv)==2: > for item in attList: > print "%2d. %-50s %-25s" % (attList.index(item),item[1],item[2]) > > elif len(sys.argv)==3: > actionList = parseActions(sys.argv[2],attList) > for attNo in actionList: > attachmentId = attList[attNo][0] > for att in bug.structData["attachments"]: > if attachmentId == int(att["attachid"]): > att["contenttype"] = "text/plain" > print >>sys.stderr,bug.structData["attachments"] > > bug.setAttachmentsMIMETypes(bug.structData["attachments"])
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 445607
: 304813 |
306946
|
306947
|
306948
|
307011
|
307012