changeset 57:d5e5c7496784

stubbing
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 23 Jan 2013 16:26:14 -0800
parents 042a1b2a3e8a
children 13767ee2ddf4
files paint/info.py paint/package.py tests/doctest.txt
diffstat 3 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/paint/info.py	Wed Jan 23 16:01:29 2013 -0800
+++ b/paint/info.py	Wed Jan 23 16:26:14 2013 -0800
@@ -2,9 +2,12 @@
 interfaces to get information from a package
 """
 
+import imp
 import os
 import sys
 
+from subprocess import check_call as call
+
 class PackageInfo(object):
     """abstract base class of package info"""
     def __init__(self, path):
@@ -30,7 +33,7 @@
         sys.modules['setuptools'] = sys.modules[__name__]
         globals()['setup'] = self._setup
         try:
-            module = imp.load_source('setup', setup_py)
+            module = imp.load_source('setup', self.setup_py)
         finally:
             sys.modules.pop('setuptools')
             if setuptools:
@@ -40,3 +43,19 @@
 
     def _setup(self, **kwargs):
         self._info = kwargs
+
+class EggInfo(PackageInfo):
+    """
+    use `python setup.py egg_info` to gather package information
+    """
+
+    def __call__(self):
+        raise NotImplementedError("TODO")
+
+    def _egg_info(self):
+        """build the egg_info directory"""
+
+        if self._egg_info_path:
+            return self._egg_info_path
+
+        raise NotImplementedError("TODO")
--- a/paint/package.py	Wed Jan 23 16:01:29 2013 -0800
+++ b/paint/package.py	Wed Jan 23 16:26:14 2013 -0800
@@ -4,6 +4,7 @@
 
 # TODO: use pkginfo.sdist more
 
+import info
 import os
 import pip
 import shutil
--- a/tests/doctest.txt	Wed Jan 23 16:01:29 2013 -0800
+++ b/tests/doctest.txt	Wed Jan 23 16:26:14 2013 -0800
@@ -20,3 +20,6 @@
     >>> import paint.info
     >>> dummy_path = os.path.join(here, 'dummy')
     >>> package_info = paint.info.SetupOverridePackageInfo(dummy_path)
+    >>> info = package_info()
+    >>> info['name']
+    'dummy'