99
1010exclude = [".svn" , "*.pyc" , "*~" , "*.orig" , "*.patch" , "__basedir__/utils" ,
1111 "__basedir__/setup_base.py" , "*.prof" , "#*" , "__basedir__/build" ,
12- '__basedir__/tests/performance' , '*.out' ,
13- '__basedir__/tests/testdata/*.html' ,
14- '__basedir__/tests/testdata/sites' , '__basedir__/print-stats.py' ]
12+ '__basedir__/tests' , '*.out' , '__basedir__/dist' ,
13+ '__basedir__/html5lib.egg-info' , '__basedir__/print-stats.py' ]
1514
1615class Package (object ):
1716
@@ -23,20 +22,19 @@ def __init__(self, inDir, outDir, version="0", status=4, installDir="~"):
2322 self .inDir = os .path .abspath (inDir )
2423 self .outDir = os .path .abspath (outDir )
2524 self .exclude = self .getExcludeList ()
26- print self .exclude
2725 self .fileList = self .getFileList ()
2826 self .installDir = installDir
2927 self .outFiles = []
3028
3129 def runall (self ):
3230 self .copyTestData ()
33- self .getFileList ()
3431 self .copy ()
32+ self .makeInitFile ()
3533 self .makeSetupFile ()
3634 self .preprocess ()
3735 #if self.test():
3836 self .makeZipFile ()
39- # self.cleanup()
37+ self .cleanup ()
4038
4139
4240 def getExcludeList (self ):
@@ -55,7 +53,7 @@ def copyTestData(self):
5553 if not os .path .exists (outDir ):
5654 raise
5755
58- inBaseDir = os .path .abspath (os .path .join (self .inDir , "../ testdata" ))
56+ inBaseDir = os .path .abspath (os .path .join (self .inDir , ".." , " testdata" ))
5957 dirWalker = os .walk (inBaseDir )
6058 for (curDir , dirs , files ) in dirWalker :
6159 outDir = os .path .join (self .inDir , "tests" , "testdata" , curDir [len (inBaseDir )+ 1 :])
@@ -111,12 +109,20 @@ def makeSetupFile(self):
111109 "5" :"5 - Production/Stable" ,
112110 "6" :"6 - Mature" ,
113111 "7" :"7 - Inactive" }
114- inFile = open (os .path .join (self .inDir , "setup_base.py" ))
115- outFile = open (os .path .join (self .outDir , "setup.py" ), "w" )
112+ inFile = open (os .path .join (self .outDir , "setup.py" ))
116113 text = "" .join (inFile .readlines ())
114+ inFile .close ()
115+ outFile = open (os .path .join (self .outDir , "setup.py" ), "w" )
117116 outFile .write (text % {"status" :statusStrings [self .status ],
118117 "version" :self .version })
119-
118+
119+ def makeInitFile (self ):
120+ inFile = open (os .path .join (self .outDir , "src" , "html5lib" , "__init__.py" ))
121+ text = "" .join (inFile .readlines ())
122+ outFile = open (os .path .join (self .outDir , "src" , "html5lib" , "__init__.py" ),
123+ "w" )
124+ outFile .write (text % {"version" :self .version })
125+
120126 def copy (self ):
121127 if not os .path .exists (self .outDir ):
122128 os .mkdir (self .outDir )
0 commit comments