# HG changeset patch # User Jeff Hammel # Date 1359339554 28800 # Node ID 5b10f2c03cb97839cb18d893ff71bd11959243dc # Parent 017b75cd61d8d22531cf327ba6873bf922cecedd more stubbing of something really stupid that is really hard diff -r 017b75cd61d8 -r 5b10f2c03cb9 paint/info.py --- a/paint/info.py Sun Jan 27 18:01:04 2013 -0800 +++ b/paint/info.py Sun Jan 27 18:19:14 2013 -0800 @@ -2,13 +2,16 @@ interfaces to get information from a package """ + import imp import os import subprocess import sys +from distutils.dist import Distribution from distutils.dist import DistributionMetadata from subprocess import check_call as call +from StringIO import StringIO # TODO: # Reconcile the difference between the keys (and values) between the different @@ -26,12 +29,14 @@ # TODO: consider using pkginfo -def setup2metadata(**kwargs): +def setup2metadata(**attrs): """ convert setup arguments to standard python metadata: http://www.python.org/dev/peps/pep-0314/ """ - metadata = DistributionMetadata() + distribution = Distribution(kwargs) + buffer = StringIO() + distribution.metadata.write_pkg_file(buffer) raise NotImplementedError("TODO") @@ -49,7 +54,6 @@ def __call__(self): """returns dictionary of package info""" raise NotImplementedError("abstract base class") - def dependencies(self): raise NotImplementedError("abstract base class")