Repurpose the installtion app for it's original intent which was let apps report on their dependencies and if they were met. This commit removes two more Python dependencies: GitPython and psutil.

This commit is contained in:
Roberto Rosario
2015-04-01 13:20:35 -04:00
parent 3f8fe90787
commit 57fd943c9d
8 changed files with 49 additions and 164 deletions
+11 -1
View File
@@ -7,7 +7,7 @@ from common.utils import encapsulate
from navigation.api import register_links, register_model_list_columns
from project_tools.api import register_tool
from .classes import Property, PropertyNamespace
from .classes import Property, PropertyNamespace, PIPNotFound, VirtualEnv
from .links import link_menu_link, link_namespace_details, link_namespace_list
@@ -41,3 +41,13 @@ class InstallationApp(apps.AppConfig):
register_links(PropertyNamespace, [link_namespace_details])
register_links(['installation:namespace_list', PropertyNamespace], [link_namespace_list], menu_name='secondary_menu')
register_tool(link_menu_link)
# Virtualenv
namespace = PropertyNamespace('venv', _('VirtualEnv'))
try:
venv = VirtualEnv()
except PIPNotFound:
namespace.add_property('pip', 'pip', _('pip not found.'), report=True)
else:
for item, version, result in venv.get_results():
namespace.add_property(item, '%s (%s)' % (item, version), result, report=True)