4
|
1 """
|
|
2 package model for python PAckage INTrospection
|
|
3 """
|
|
4
|
5
|
5 import tempfile
|
|
6
|
4
|
7 class Package(object):
|
|
8
|
|
9 def __init__(self, src):
|
|
10 self.src = src
|
5
|
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
|