comparison paint/package.py @ 33:5efb61fde8aa

improved docstring
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 30 Mar 2012 13:43:23 -0700
parents f2e31ac03bb3
children acb2f4896291
comparison
equal deleted inserted replaced
32:f2e31ac03bb3 33:5efb61fde8aa
20 from subporcess import call 20 from subporcess import call
21 21
22 __all__ = ['Package'] 22 __all__ = ['Package']
23 23
24 class Package(object): 24 class Package(object):
25 """
26 class for python package introspection.
27 constructor takes the package 'src'
28 """
25 29
26 def __init__(self, src): 30 def __init__(self, src):
27 self.src = src 31 self.src = src
28 32
29 # ephemeral data 33 # ephemeral data
30 self._tmppath = None 34 self._tmppath = None
31 self._egg_info_path = None 35 self._egg_info_path = None
36 self._build_path = None
32 37
33 # TODO: list of temporary files/directories to be deleted 38 # TODO: list of temporary files/directories to be deleted
34 39
35 def path(self): 40 def path(self):
36 """filesystem path to package directory""" 41 """filesystem path to package directory"""
180 return dependencies 185 return dependencies
181 186
182 def extension(self): 187 def extension(self):
183 """filename extension""" 188 """filename extension"""
184 189
185 def repackage(self): 190 def repackage(self, destination):
186 """ 191 """
187 repackage the package to ensure its actually in the right form 192 repackage the package to ensure its actually in the right form
188 """ 193 """
194
195 if self._build_path:
196 return self._build_path
189 197
190 def download(self, directory): 198 def download(self, directory):
191 """download a package and all its dependencies using pip""" 199 """download a package and all its dependencies using pip"""
192 if not os.path.exists(directory): 200 if not os.path.exists(directory):
193 os.makedirs(directory) 201 os.makedirs(directory)