no need to change directories

This commit is contained in:
Brian Murray 2011-04-18 11:28:22 -07:00
parent d0aa685788
commit 66a1d33481

View File

@ -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