Commit 470280e3 authored by Kevin Deldycke's avatar Kevin Deldycke

Use shutil to correct the same problem as the one discribe here:...

Use shutil to correct the same problem as the one discribe here: http://mail.python.org/pipermail/python-list/2005-February/266553.html


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5418 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d4dd3670
...@@ -35,6 +35,7 @@ import tarfile ...@@ -35,6 +35,7 @@ import tarfile
import os import os
import sys import sys
import tempfile import tempfile
import shutil
property_list = ('title', 'version', 'description', 'license', 'dependency_list', 'copyright_list') property_list = ('title', 'version', 'description', 'license', 'dependency_list', 'copyright_list')
...@@ -59,9 +60,9 @@ def readBusinessTemplate(tar): ...@@ -59,9 +60,9 @@ def readBusinessTemplate(tar):
property_dict[name_list[2]] = text property_dict[name_list[2]] = text
finally: finally:
f.close() f.close()
return property_dict return property_dict
def generateInformation(fd): def generateInformation(fd):
os.write(fd, '<?xml version="1.0"?>\n') os.write(fd, '<?xml version="1.0"?>\n')
os.write(fd, '<repository>\n') os.write(fd, '<repository>\n')
...@@ -90,9 +91,9 @@ def generateInformation(fd): ...@@ -90,9 +91,9 @@ def generateInformation(fd):
info('done\n') info('done\n')
finally: finally:
tar.close() tar.close()
os.write(fd, '</repository>\n') os.write(fd, '</repository>\n')
def main(): def main():
if len(sys.argv) < 2: if len(sys.argv) < 2:
dir_list = ['.'] dir_list = ['.']
...@@ -112,7 +113,7 @@ def main(): ...@@ -112,7 +113,7 @@ def main():
os.remove(path) os.remove(path)
raise raise
else: else:
os.rename(path, 'bt5list') shutil.move(path, 'bt5list')
os.chdir(cwd) os.chdir(cwd)
main() main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment