From d963bc3184072be430c0e6b76ec31cb882a89976 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Mon, 26 Mar 2012 19:05:57 +0000 Subject: when loading plugins, check for .tar.gz files --- diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 943eb4a..2271c57 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -844,11 +844,19 @@ class TurtleArtActivity(activity.Activity): if hasattr(self, 'tw'): _logger.debug('Read file: %s' % (file_path)) # Could be a plugin or deprecated gtar or tar file... - if plugin or file_path.endswith(('.gtar', '.tar')): + if plugin or file_path.endswith(('.gtar', '.tar', '.tar.gz')): import tempfile import shutil - tar_fd = tarfile.open(file_path, 'r') + try: + status = subprocess.call(['gunzip', file_path]) + if status == 0: + tar_fd = tarfile.open(file_path[:-3], 'r') + else: + tar_fd = tarfile.open(file_path, 'r') + except: + tar_fd = tarfile.open(file_path, 'r') + tmpdir = tempfile.mkdtemp() if True: #try: -- cgit v0.9.1