@@ -23,6 +23,7 @@ def __init__(self, inDir, outDir, version="0", status=4, installDir="~"):
2323 self .inDir = os .path .abspath (inDir )
2424 self .outDir = os .path .abspath (outDir )
2525 self .exclude = self .getExcludeList ()
26+ print self .exclude
2627 self .fileList = self .getFileList ()
2728 self .installDir = installDir
2829 self .outFiles = []
@@ -45,12 +46,15 @@ def getExcludeList(self):
4546 return rv
4647
4748 def copyTestData (self ):
48- outDir = "tests/testdata"
49+ outDir = os .path .join (self .inDir , "tests/testdata" )
50+ print
4951 try :
5052 os .mkdir (outDir )
5153 except OSError :
52- #the directory already exists
53- pass
54+ #the directory already exists
55+ if not os .path .exists (outDir ):
56+ raise
57+
5458 inBaseDir = os .path .abspath (os .path .join (self .inDir , "../testdata" ))
5559 dirWalker = os .walk (inBaseDir )
5660 for (curDir , dirs , files ) in dirWalker :
@@ -152,7 +156,8 @@ def test(self):
152156
153157 def makeZipFile (self ):
154158 z = zipfile .ZipFile (os .path .join (self .outDir ,
155- "html5lib-%s.zip" % self .version ), 'w' )
159+ "html5lib-%s.zip" % self .version ), 'w' ,
160+ zipfile .ZIP_DEFLATED )
156161 for f in self .outFiles :
157162 z .write (f , os .path .join ("html5lib-%s" % self .version ,
158163 f [len (self .outDir )+ 1 :]))
@@ -226,4 +231,4 @@ def move(self, line):
226231 dirName = os .path .dirname (dirName )
227232
228233 for item in dirsToCreate [::- 1 ]:
229- os .mkdir (item )
234+ os .mkdir (item )
0 commit comments