File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,24 @@ def scrubeol(directory, filerestr):
5353 updated .close ()
5454
5555 print "Updated %s to unix-style endlines." % f
56+
57+
58+ def rm (directory , filerestr ):
59+ """Delete files in directory matched by regex string.
60+
61+ Parameters
62+ ----------
63+ directory - A directory to scrub
64+ filerestr - A regex string defining which files to match."""
65+ os .chdir (__basedir__ )
66+ os .chdir (directory )
67+ files = [re .match (filerestr , f ) for f in os .listdir ("." )]
68+ files = [f .group (0 ) for f in files if f ]
69+
70+ for f in files :
71+ os .remove (f )
72+
73+ print "Deleted %s." % f
5674
5775
5876
@@ -61,6 +79,9 @@ def scrubeol(directory, filerestr):
6179 # Temporarily add examples to path
6280 lib_path = os .path .abspath (os .path .join ('..' ,'doc' ,'examples' ))
6381 sys .path .append (lib_path )
82+
83+ # Delete existing files that don't necessarily have a fixed name.
84+ rm ("../doc/examples/output" , r"C60_multimodel.*\.pwa" )
6485
6586 ### Testing examples
6687 examples = Test ()
You can’t perform that action at this time.
0 commit comments