comparison paint/package.py @ 21:4df3e715817d

now have passing tests again
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 27 Feb 2012 13:44:52 -0800
parents 11bc01a089e7
children 54c1e7e43a54
comparison
equal deleted inserted replaced
20:11bc01a089e7 21:4df3e715817d
7 import subprocess 7 import subprocess
8 import sys 8 import sys
9 import tarfile 9 import tarfile
10 import tempfile 10 import tempfile
11 import urllib2 11 import urllib2
12 import urlparse
12 import utils 13 import utils
13 14
14 try: 15 try:
15 from subprocess import check_call as call 16 from subprocess import check_call as call
16 except ImportError: 17 except ImportError:
143 return info_dict 144 return info_dict
144 145
145 def dependencies(self): 146 def dependencies(self):
146 """return the dependencies""" 147 """return the dependencies"""
147 148
149 # get the egg_info directory
148 egg_info = self.egg_info() 150 egg_info = self.egg_info()
149 151
150 # read the dependencies 152 # read the dependencies
151 requires = os.path.join(egg_info, 'requires.txt') 153 requires = os.path.join(egg_info, 'requires.txt')
152 if os.path.exists(requires): 154 if os.path.exists(requires):
153 dependencies = [i.strip() for i in file(requires).readlines() if i.strip()] 155 dependencies = [i.strip() for i in file(requires).readlines() if i.strip()]
154 else: 156 else:
155 dependencies = [] 157 dependencies = []
158 dependencies = dict([(i, None) for i in dependencies])
156 159
160 # read the dependency links
161 dependency_links = os.path.join(egg_info, 'dependency_links.txt')
162 if os.path.exists(dependency_links):
163 links = [i.strip() for i in file(dependency_links).readlines() if i.strip()]
164 for link in links:
165 # XXX pretty ghetto
166 assert '#egg=' in link
167 url, dep = link.split('#egg=', 1)
168 if dep in dependencies:
169 dependencies[dep] = link
170
171 return dependencies