comparison 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
comparison
equal deleted inserted replaced
4:e230ac76aaa4 5:5b74792d46e4
1 """ 1 """
2 package model for python PAckage INTrospection 2 package model for python PAckage INTrospection
3 """ 3 """
4
5 import tempfile
4 6
5 class Package(object): 7 class Package(object):
6 8
7 def __init__(self, src): 9 def __init__(self, src):
8 self.src = src 10 self.src = src
11 self._tmppath = None
12
13 def path(self):
14 """filesystem path to package"""
15 if utils.isURL(self.src):
16 if self._tmppath:
17 return self._tmppath
18 self.fetch()
19 return self._tmppath
20 return self.src
21
22 def fetch(self):
23 """fetch from remote source"""
24 self._tmppath = tempfile.mkdtemp()
25 raise NotImplementedError