diff paint/package.py @ 5:5b74792d46e4

stub package model;
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 23 Feb 2012 14:56:36 -0800
parents e230ac76aaa4
children a7bf894c96c7
line wrap: on
line diff
--- a/paint/package.py	Thu Feb 23 13:26:06 2012 -0800
+++ b/paint/package.py	Thu Feb 23 14:56:36 2012 -0800
@@ -2,7 +2,24 @@
 package model for python PAckage INTrospection
 """
 
+import tempfile
+
 class Package(object):
 
     def __init__(self, src):
         self.src = src
+        self._tmppath = None
+
+    def path(self):
+        """filesystem path to package"""
+        if utils.isURL(self.src):
+            if self._tmppath:
+                return self._tmppath
+            self.fetch()
+            return self._tmppath
+        return self.src
+
+    def fetch(self):
+        """fetch from remote source"""
+        self._tmppath = tempfile.mkdtemp()
+        raise NotImplementedError