mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-13 18:01:28 +00:00
grab-attachments: put attachments in a folder named after the bug number which prevents clobbering of attachments if multiple bugs have the same attachment name
This commit is contained in:
parent
4dc91f0366
commit
d0aa685788
@ -56,6 +56,9 @@ def main():
|
|||||||
|
|
||||||
bug = launchpad.bugs[number]
|
bug = launchpad.bugs[number]
|
||||||
|
|
||||||
|
os.mkdir('bug-%s' % number)
|
||||||
|
os.chdir('bug-%s' % number)
|
||||||
|
|
||||||
for attachment in bug.attachments:
|
for attachment in bug.attachments:
|
||||||
f = attachment.data.open()
|
f = attachment.data.open()
|
||||||
filename = os.path.join(os.getcwd(), f.filename)
|
filename = os.path.join(os.getcwd(), f.filename)
|
||||||
@ -64,6 +67,8 @@ def main():
|
|||||||
f.close()
|
f.close()
|
||||||
local_file.close()
|
local_file.close()
|
||||||
|
|
||||||
|
os.chdir('../')
|
||||||
|
|
||||||
# no LP credentials
|
# no LP credentials
|
||||||
except IOError, error:
|
except IOError, error:
|
||||||
print error
|
print error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user