mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-14 00:21:08 +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]
|
||||
|
||||
os.mkdir('bug-%s' % number)
|
||||
os.chdir('bug-%s' % number)
|
||||
|
||||
for attachment in bug.attachments:
|
||||
f = attachment.data.open()
|
||||
filename = os.path.join(os.getcwd(), f.filename)
|
||||
@ -64,6 +67,8 @@ def main():
|
||||
f.close()
|
||||
local_file.close()
|
||||
|
||||
os.chdir('../')
|
||||
|
||||
# no LP credentials
|
||||
except IOError, error:
|
||||
print error
|
||||
|
Loading…
x
Reference in New Issue
Block a user