Open mccalluc opened 7 years ago
In my view, part of the contract may be for vis packages to identify themselves as such, rather than maintaining a separate configuration list with all the details. This script does that... but it is unacceptably slow: Perhaps figure out where the package.jsons are stored and parse them directly?
import os
import json
look_for = 'refinery-vis'
matches = []
npm_list_json = os.popen('npm list --json true --depth 0').read()
dependencies = json.loads(npm_list_json)['dependencies']
for name, info in dependencies.iteritems():
command = 'npm view %s@%s keywords --json' % (name, info['version']) # Security of string interpolation?
npm_view_json = os.popen(command).read()
if npm_view_json:
keywords = json.loads(npm_view_json)
if look_for in keywords:
matches.append(name)
print matches
Alternatively parse the each package.json yourself: I think it would suffice to iterate over
node_modules/*/package.json # for locals
`npm root -g`/*/package.json # for globals
@scottx611x : Here's one attempt at an IGV wrapper. What's the simplest contract we can require for integrating this or any future visualization into refinery? What still needs to happen here?
vendor
directory? Or should I try a package.json or something like that and leave it to Refinery to pull everything during build?index.js
?