Skip to content

Commit

Permalink
reqs install error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Apr 13, 2018
1 parent b8cfac4 commit 3bc9101
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
23 changes: 18 additions & 5 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,14 @@ def run_pip(self, skill_folder):
if exists(join(skill["path"], "requirements.txt")):
pip_code = pip.main(['install', '-r', join(skill["path"], "requirements.txt")])
# TODO parse pip code
return True
return False

if str(pip_code) == "1":
LOG.error("pip code: " + str(pip_code))
return False
LOG.debug("pip code: " + str(pip_code))
else:
LOG.info("no requirements.txt to run")
return True

def run_requirements_sh(self, skill_folder):
LOG.info("running requirements.sh for: " + skill_folder)
Expand All @@ -378,8 +384,13 @@ def run_requirements_sh(self, skill_folder):
output = subprocess.check_output(["gksudo", "bash", reqs])
else: # no sudo
output = subprocess.check_output(["bash", reqs])
return True
return False
if str(output) != "0":
LOG.error(str(output))
return False
LOG.debug(output)
else:
LOG.info("no requirements.sh to run")
return True

def match_name_to_folder(self, name):
LOG.info("searching skill by name: " + name)
Expand Down Expand Up @@ -507,6 +518,8 @@ def add_to_blacklist(self, skill_name):
self.update_skills_config(config)
else:
LOG.info("Skill already Blacklisted: " + skill_folder)
LOG.info("reloading skill to trigger shutdown")
self.reload_skill(skill_folder)
return True

def change_skills_directory(self, skills_dir):
Expand Down Expand Up @@ -638,4 +651,4 @@ def touch(fname):
try:
utime(fname, None)
except OSError:
open(fname, 'a').close()
open(fname, 'a').close()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='py_msm',
version='0.3.5',
version='0.3.6',
packages=['py_msm'],
install_requires=['GitPython', 'requests'],
url='https://github.com/JarbasAl/py_msm',
Expand Down

0 comments on commit 3bc9101

Please sign in to comment.