resolve.py 604 B

12345678910111213141516171819202122232425262728
  1. #! /usr/bin/env python
  2. import os, sys
  3. import cgi, cgitb
  4. cgitb.enable()
  5. PKGDIR = os.environ.get('PKGDIR', os.path.abspath('../packages'))
  6. if not 'DISTNETCACHE' in os.environ:
  7. os.environ['DISTNETCACHE'] = PKGDIR
  8. d = os.path.dirname
  9. base = d(d(d(d(d(os.path.abspath(__file__))))))
  10. sys.path.append(base)
  11. from waflib.extras import distnet
  12. form = cgi.FieldStorage()
  13. text = form.getvalue('text')
  14. distnet.packages.debug = 0
  15. distnet.packages.constraints = distnet.packages.local_resolve(text)
  16. results = distnet.packages.get_results()
  17. print("Content-Type: text/plain")
  18. print( "")
  19. print("")
  20. print(results)