From 9f3e4ce634e15359fe90405fa485a7d940a52480 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 18 Dec 2014 20:04:57 +0530 Subject: [PATCH] Code for extraction --- ee/core/extract.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ee/core/extract.py diff --git a/ee/core/extract.py b/ee/core/extract.py new file mode 100644 index 00000000..af2d001c --- /dev/null +++ b/ee/core/extract.py @@ -0,0 +1,15 @@ +"""EasyEngine extarct core classes.""" + + +class EEExtract(): + """Method to extract from tar.gz file""" + + def extract(file, path): + try: + tar = tarfile.open(file) + tar.extractall(path=path) + tar.close() + return True + except tarfile.TarError as e: + print("Unable to extract file "+file) + return False