<s> import os . path <EOL> import os <EOL> import re <EOL> import fnmatch <EOL> def match_files ( directory = "<STR_LIT>" , pattern = "<STR_LIT>" ) : <EOL> files = [ ] <EOL> for file in os . listdir ( directory ) : <EOL> if fnmatch . fnmatch ( file , pattern ) : <EOL> files += [ os . path . join ( directory , file ) ] <EOL> return files <EOL> from paver . tasks import task , cmdopts <EOL> from paver . easy import sh , needs , pushd <EOL> from paver . virtual import * <EOL> def tell ( x ) : <EOL> print ( ) <EOL> print ( ( "<STR_LIT:->" * <NUM_LIT:10> ) + str ( x ) + ( "<STR_LIT:->" * <NUM_LIT:10> ) ) <EOL> print ( ) <EOL> @ task <EOL> def unit_tests ( ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> files = "<STR_LIT:U+0020>" . join ( match_files ( ) ) <EOL> sh ( '<STR_LIT>' ) <EOL> sh ( '<STR_LIT>' + files ) <EOL> @ task <EOL> def generic_unit_tests ( ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> files = "<STR_LIT:U+0020>" . join ( match_files ( ) ) <EOL> sh ( '<STR_LIT>' ) <EOL> sh ( '<STR_LIT>' + files ) <EOL> @ task <EOL> def test3 ( ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> files = "<STR_LIT:U+0020>" . join ( match_files ( ) ) <EOL> sh ( '<STR_LIT>' ) <EOL> sh ( '<STR_LIT>' + files ) <EOL> @ task <EOL> @ cmdopts ( [ <EOL> ( '<STR_LIT>' , '<STR_LIT:f>' , '<STR_LIT>' ) <EOL> ] ) <EOL> def testf ( options ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> print ( options ) <EOL> sh ( '<STR_LIT>' % ( options . file , options . file ) ) <EOL> sh ( '<STR_LIT>' % ( options . file , options . file ) ) <EOL> @ task <EOL> def build ( quiet = True ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> @ task <EOL> def win ( quiet = True ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> @ task <EOL> def upload ( quiet = False ) : <EOL> """<STR_LIT>""" <EOL> lib = file ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) ) . read ( ) <EOL> v = re . findall ( "<STR_LIT>" , lib ) [ <NUM_LIT:0> ] <EOL> tell ( "<STR_LIT>" % v ) <EOL> sh ( '<STR_LIT>' % ( v , v ) ) <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> tell ( '<STR_LIT>' ) <EOL> @ task <EOL> def lintlib ( quiet = False ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> @ needs ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> @ task <EOL> def lint ( ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> @ task <EOL> def make_docs ( quiet = True ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> with pushd ( '<STR_LIT>' ) as old_dir : <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> @ task <EOL> def wc ( quiet = False ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> print ( "<STR_LIT>" ) <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> print ( "<STR_LIT>" ) <EOL> sh ( '<STR_LIT>' , capture = quiet ) <EOL> def get_latest_dist ( ) : <EOL> lib = file ( os . path . join ( "<STR_LIT>" , "<STR_LIT>" ) ) . read ( ) <EOL> v = re . findall ( "<STR_LIT>" , lib ) [ <NUM_LIT:0> ] <EOL> return os . path . join ( "<STR_LIT>" , "<STR_LIT>" % v ) <EOL> @ needs ( '<STR_LIT>' ) <EOL> @ task <EOL> def make_env ( quiet = True ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> if os . path . exists ( "<STR_LIT>" ) : <EOL> return <EOL> os . mkdir ( "<STR_LIT>" ) <EOL> with pushd ( '<STR_LIT>' ) as old_dir : <EOL> sh ( "<STR_LIT>" , capture = quiet ) <EOL> @ needs ( "<STR_LIT>" ) <EOL> @ task <EOL> @ virtualenv ( dir = r"<STR_LIT>" ) <EOL> def lintexamples ( quiet = True ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> sh ( "<STR_LIT>" % get_latest_dist ( ) , capture = quiet ) <EOL> files = "<STR_LIT:U+0020>" . join ( match_files ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> sh ( '<STR_LIT>' + files , capture = quiet ) <EOL> @ task <EOL> @ virtualenv ( dir = r"<STR_LIT>" ) <EOL> def venv_unit_tests ( quiet = False ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> files = "<STR_LIT:U+0020>" . join ( match_files ( ) ) <EOL> sh ( "<STR_LIT>" % get_latest_dist ( ) , capture = quiet ) <EOL> sh ( "<STR_LIT>" ) <EOL> @ needs ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> @ task <EOL> def venvut ( quiet = False ) : <EOL> pass <EOL> @ task <EOL> @ virtualenv ( dir = os . path . join ( r"<STR_LIT>" , r"<STR_LIT>" ) ) <EOL> def big_tests ( quiet = False ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> sh ( "<STR_LIT>" % get_latest_dist ( ) , capture = quiet ) <EOL> files = "<STR_LIT:U+0020>" . join ( match_files ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> sh ( "<STR_LIT>" + files ) <EOL> @ needs ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> @ task <EOL> def venvbt ( quiet = False ) : <EOL> pass <EOL> @ task <EOL> def local_big_tests ( quiet = True ) : <EOL> """<STR_LIT>""" <EOL> tell ( "<STR_LIT>" ) <EOL> files = "<STR_LIT:U+0020>" . join ( match_files ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> sh ( "<STR_LIT>" + files ) <EOL> @ needs ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> @ task <EOL> def test ( ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> @ needs ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> @ task <EOL> def default ( ) : <EOL> """<STR_LIT>""" <EOL> pass </s>
