@@ -23,6 +23,7 @@ def __init__(self, inDir, outDir, version="0", status=4, installDir="~"):
23
23
self .inDir = os .path .abspath (inDir )
24
24
self .outDir = os .path .abspath (outDir )
25
25
self .exclude = self .getExcludeList ()
26
+ print self .exclude
26
27
self .fileList = self .getFileList ()
27
28
self .installDir = installDir
28
29
self .outFiles = []
@@ -45,12 +46,15 @@ def getExcludeList(self):
45
46
return rv
46
47
47
48
def copyTestData (self ):
48
- outDir = "tests/testdata"
49
+ outDir = os .path .join (self .inDir , "tests/testdata" )
50
+ print
49
51
try :
50
52
os .mkdir (outDir )
51
53
except OSError :
52
- #the directory already exists
53
- pass
54
+ #the directory already exists
55
+ if not os .path .exists (outDir ):
56
+ raise
57
+
54
58
inBaseDir = os .path .abspath (os .path .join (self .inDir , "../testdata" ))
55
59
dirWalker = os .walk (inBaseDir )
56
60
for (curDir , dirs , files ) in dirWalker :
@@ -152,7 +156,8 @@ def test(self):
152
156
153
157
def makeZipFile (self ):
154
158
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 )
156
161
for f in self .outFiles :
157
162
z .write (f , os .path .join ("html5lib-%s" % self .version ,
158
163
f [len (self .outDir )+ 1 :]))
@@ -226,4 +231,4 @@ def move(self, line):
226
231
dirName = os .path .dirname (dirName )
227
232
228
233
for item in dirsToCreate [::- 1 ]:
229
- os .mkdir (item )
234
+ os .mkdir (item )
0 commit comments