|
@@ -84,7 +84,9 @@ def get_app_info(app_loc):
|
|
|
save_cwd = os.getcwd()
|
|
save_cwd = os.getcwd()
|
|
|
os.chdir(app_loc)
|
|
os.chdir(app_loc)
|
|
|
try:
|
|
try:
|
|
|
- cmdv = [ common.ENV_PYTHON, 'setup.py', '--name', '--version', '--description' ]
|
|
|
|
|
|
|
+ cmdv = [ common.ENV_PYTHON, 'setup.py',
|
|
|
|
|
+ '--name', '--version', '--description',
|
|
|
|
|
+ '--author' ]
|
|
|
LOG.debug("Running '%s'" % (' '.join(cmdv),))
|
|
LOG.debug("Running '%s'" % (' '.join(cmdv),))
|
|
|
popen = subprocess.Popen(cmdv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
popen = subprocess.Popen(cmdv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
res = popen.wait()
|
|
res = popen.wait()
|
|
@@ -94,7 +96,7 @@ def get_app_info(app_loc):
|
|
|
LOG.error("Error getting application info from %s:\n%s" % (app_loc, stderr))
|
|
LOG.error("Error getting application info from %s:\n%s" % (app_loc, stderr))
|
|
|
raise OSError(stderr)
|
|
raise OSError(stderr)
|
|
|
LOG.debug("Command output:\n<<<\n%s\n>>>" % (stdout,))
|
|
LOG.debug("Command output:\n<<<\n%s\n>>>" % (stdout,))
|
|
|
- return stdout.split('\n')[:3]
|
|
|
|
|
|
|
+ return stdout.split('\n')[:4]
|
|
|
finally:
|
|
finally:
|
|
|
os.chdir(save_cwd)
|
|
os.chdir(save_cwd)
|
|
|
|
|
|
|
@@ -104,12 +106,12 @@ def _do_install_one(reg, app_loc):
|
|
|
LOG.info("=== Installing app at %s" % (app_loc,))
|
|
LOG.info("=== Installing app at %s" % (app_loc,))
|
|
|
try:
|
|
try:
|
|
|
app_loc = os.path.realpath(app_loc)
|
|
app_loc = os.path.realpath(app_loc)
|
|
|
- app_name, version, desc = get_app_info(app_loc)
|
|
|
|
|
|
|
+ app_name, version, desc, author = get_app_info(app_loc)
|
|
|
except (ValueError, OSError), ex:
|
|
except (ValueError, OSError), ex:
|
|
|
LOG.error(ex)
|
|
LOG.error(ex)
|
|
|
return False
|
|
return False
|
|
|
|
|
|
|
|
- app = registry.DesktopApp(app_name, version, app_loc, desc)
|
|
|
|
|
|
|
+ app = registry.DesktopApp(app_name, version, app_loc, desc, author)
|
|
|
if reg.contains(app):
|
|
if reg.contains(app):
|
|
|
LOG.warn("=== %s is already installed" % (app,))
|
|
LOG.warn("=== %s is already installed" % (app,))
|
|
|
return True
|
|
return True
|
|
@@ -131,10 +133,10 @@ def do_list():
|
|
|
"""List all apps. Returns True/False."""
|
|
"""List all apps. Returns True/False."""
|
|
|
reg = registry.AppRegistry()
|
|
reg = registry.AppRegistry()
|
|
|
apps = reg.get_all_apps()
|
|
apps = reg.get_all_apps()
|
|
|
- LOG.info("%-20s %-7s %s" % ('Name', 'Version', 'Path'))
|
|
|
|
|
- LOG.info("%s %s %s" % ('-' * 20, '-' * 7, '-' * 50))
|
|
|
|
|
|
|
+ LOG.info("%-18s %-7s %-15s %s" % ('Name', 'Version', 'Author', 'Path'))
|
|
|
|
|
+ LOG.info("%s %s %s %s" % ('-' * 18, '-' * 7, '-' * 15, '-' * 35))
|
|
|
for app in sorted(apps):
|
|
for app in sorted(apps):
|
|
|
- LOG.info("%-20s %-7s %s" % (app.name, app.version, app.path))
|
|
|
|
|
|
|
+ LOG.info("%-18s %-7s %-15s %s" % (app.name, app.version, app.author, app.path))
|
|
|
return True
|
|
return True
|
|
|
|
|
|
|
|
|
|
|