<s> from __future__ import absolute_import , print_function , unicode_literals <EOL> import os <EOL> import sys <EOL> from os . path import exists <EOL> from os . path import join <EOL> from os . path import dirname <EOL> from os . path import abspath <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> base_path = dirname ( dirname ( abspath ( __file__ ) ) ) <EOL> print ( "<STR_LIT>" . format ( base_path ) ) <EOL> env_path = join ( base_path , "<STR_LIT>" , "<STR_LIT>" ) <EOL> if sys . platform == "<STR_LIT:win32>" : <EOL> bin_path = join ( env_path , "<STR_LIT>" ) <EOL> else : <EOL> bin_path = join ( env_path , "<STR_LIT>" ) <EOL> if not exists ( env_path ) : <EOL> import subprocess <EOL> print ( "<STR_LIT>" . format ( env_path ) ) <EOL> try : <EOL> subprocess . check_call ( [ "<STR_LIT>" , env_path ] ) <EOL> except Exception : <EOL> subprocess . check_call ( [ sys . executable , "<STR_LIT>" , "<STR_LIT>" , env_path ] ) <EOL> print ( "<STR_LIT>" ) <EOL> subprocess . check_call ( [ join ( bin_path , "<STR_LIT>" ) , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> activate = join ( bin_path , "<STR_LIT>" ) <EOL> exec ( compile ( open ( activate , "<STR_LIT:rb>" ) . read ( ) , activate , "<STR_LIT>" ) , dict ( __file__ = activate ) ) <EOL> import jinja2 <EOL> import subprocess <EOL> jinja = jinja2 . Environment ( <EOL> loader = jinja2 . FileSystemLoader ( join ( base_path , "<STR_LIT>" , "<STR_LIT>" ) ) , <EOL> trim_blocks = True , <EOL> lstrip_blocks = True , <EOL> keep_trailing_newline = True <EOL> ) <EOL> tox_environments = [ line . strip ( ) for line in subprocess . check_output ( [ '<STR_LIT>' , '<STR_LIT>' ] ) . splitlines ( ) ] <EOL> tox_environments = [ line for line in tox_environments if line not in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ] <EOL> for name in os . listdir ( join ( "<STR_LIT>" , "<STR_LIT>" ) ) : <EOL> with open ( join ( base_path , name ) , "<STR_LIT:w>" ) as fh : <EOL> fh . write ( jinja . get_template ( name ) . render ( tox_environments = tox_environments ) ) <EOL> print ( "<STR_LIT>" . format ( name ) ) <EOL> print ( "<STR_LIT>" ) </s>
