Skip to content

Commit

Permalink
Merge pull request #1143 from AndreMiras/patch-1
Browse files Browse the repository at this point in the history
Remove unused `extract_source()` method
  • Loading branch information
inclement authored Nov 12, 2017
2 parents 9cb4112 + 43b2c92 commit 41b2e51
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions pythonforandroid/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,43 +169,6 @@ def report_hook(index, blksize, size):
shprint(sh.git, 'submodule', 'update', '--recursive')
return target

def extract_source(self, source, cwd):
"""
(internal) Extract the `source` into the directory `cwd`.
"""
if not source:
return
if isfile(source):
info("Extract {} into {}".format(source, cwd))

if source.endswith(".tgz") or source.endswith(".tar.gz"):
shprint(sh.tar, "-C", cwd, "-xvzf", source)

elif source.endswith(".tbz2") or source.endswith(".tar.bz2"):
shprint(sh.tar, "-C", cwd, "-xvjf", source)

elif source.endswith(".zip"):
zf = zipfile.ZipFile(source)
zf.extractall(path=cwd)
zf.close()

else:
warning(
"Error: cannot extract, unrecognized extension for {}"
.format(source))
raise Exception()

elif isdir(source):
info("Copying {} into {}".format(source, cwd))

shprint(sh.cp, '-a', source, cwd)

else:
warning(
"Error: cannot extract or copy, unrecognized path {}"
.format(source))
raise Exception()

# def get_archive_rootdir(self, filename):
# if filename.endswith(".tgz") or filename.endswith(".tar.gz") or \
# filename.endswith(".tbz2") or filename.endswith(".tar.bz2"):
Expand Down

0 comments on commit 41b2e51

Please sign in to comment.