mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-14 00:21:08 +00:00
no need to change directories
This commit is contained in:
parent
d0aa685788
commit
66a1d33481
@ -56,19 +56,23 @@ def main():
|
||||
|
||||
bug = launchpad.bugs[number]
|
||||
|
||||
os.mkdir('bug-%s' % number)
|
||||
os.chdir('bug-%s' % number)
|
||||
bug_folder_name = 'bug-%s' % number
|
||||
|
||||
try:
|
||||
os.mkdir(bug_folder_name)
|
||||
except OSError, error:
|
||||
if 'file exists' in error:
|
||||
continue
|
||||
|
||||
for attachment in bug.attachments:
|
||||
f = attachment.data.open()
|
||||
filename = os.path.join(os.getcwd(), f.filename)
|
||||
filename = os.path.join(os.getcwd(), bug_folder_name,
|
||||
f.filename)
|
||||
local_file = open(filename, "w")
|
||||
local_file.write(f.read())
|
||||
f.close()
|
||||
local_file.close()
|
||||
|
||||
os.chdir('../')
|
||||
|
||||
# no LP credentials
|
||||
except IOError, error:
|
||||
print error
|
||||
|
Loading…
x
Reference in New Issue
Block a user