summaryrefslogtreecommitdiff
path: root/yaksh/file_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/file_utils.py')
-rw-r--r--yaksh/file_utils.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/yaksh/file_utils.py b/yaksh/file_utils.py
index 1e03f1f..8f6f6e5 100644
--- a/yaksh/file_utils.py
+++ b/yaksh/file_utils.py
@@ -13,7 +13,7 @@ def copy_files(file_paths):
file_name = os.path.basename(file_path)
files.append(file_name)
shutil.copy(file_path, os.getcwd())
- if extract:
+ if extract and zipfile.is_zipfile(file_name):
unzip = zipfile.ZipFile(file_name)
for zip_files in unzip.namelist():
files.append(zip_files)
@@ -25,9 +25,9 @@ def copy_files(file_paths):
def delete_files(files):
""" Delete Files from current directory """
- for content in files:
- if os.path.exists(content):
- if os.path.isfile(content):
- os.remove(content)
+ for file in files:
+ if os.path.exists(file):
+ if os.path.isfile(file):
+ os.remove(file)
else:
- shutil.rmtree(content)
+ shutil.rmtree(file)