From d687b125a0036913a2cfe1380abe47514750a531 Mon Sep 17 00:00:00 2001 From: Sylvain Thenault Date: Wed, 20 Aug 2008 19:35:11 +0200 Subject: new simple unzip function --- shellutils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shellutils.py b/shellutils.py index b8b2cda..f6072f1 100644 --- a/shellutils.py +++ b/shellutils.py @@ -141,6 +141,20 @@ def find(directory, exts, exclude=False, blacklist=STD_BLACKLIST): return files +def unzip(archive, destdir): + import zipfile + if not exists(destdir): + os.mkdir(destdir) + zfobj = zipfile.ZipFile(archive) + for name in zfobj.namelist(): + if name.endswith('/'): + os.mkdir(join(destdir, name)) + else: + outfile = open(join(destdir, name), 'wb') + outfile.write(zfobj.read(name)) + outfile.close() + + class Execute: """This is a deadlock safe version of popen2 (no stdin), that returns an object with errorlevel, out and err. -- cgit v1.2.1 From fa1c9fb37aa69db24a9cd4a9a1001427490e6d2d Mon Sep 17 00:00:00 2001 From: Sylvain Thenault Date: Wed, 20 Aug 2008 19:35:14 +0200 Subject: update changelog --- ChangeLog | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bbb4453..f87c69c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,15 @@ ChangeLog for logilab.common ============================ - -- - * changelog propertly adds new line at the end of each entry + -- + * shellutils: new simple unzip function + + * changelog: properly adds new line at the end of each entry - * add a with_tempdir decorator ensuring all temporary files and dirs are removed + * testlib: add a with_tempdir decorator ensuring all temporary files and dirs are removed - * improve DotBackend configuration. graphiz rendered can now be selected and additionnal graph parameter used + * graph: improve DotBackend configuration. graphiz rendered can now be selected + and additionnal graph parameter used * db: support of Decimal Type -- cgit v1.2.1