mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-14 10:21:29 +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]
|
bug = launchpad.bugs[number]
|
||||||
|
|
||||||
os.mkdir('bug-%s' % number)
|
bug_folder_name = 'bug-%s' % number
|
||||||
os.chdir('bug-%s' % number)
|
|
||||||
|
try:
|
||||||
|
os.mkdir(bug_folder_name)
|
||||||
|
except OSError, error:
|
||||||
|
if 'file exists' in error:
|
||||||
|
continue
|
||||||
|
|
||||||
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(), bug_folder_name,
|
||||||
|
f.filename)
|
||||||
local_file = open(filename, "w")
|
local_file = open(filename, "w")
|
||||||
local_file.write(f.read())
|
local_file.write(f.read())
|
||||||
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