def copy_for_legacy_python(src_dir, dest_dir): from translate_to_legacy import LegacyPythonTranslator # Dirs and files to explicitly not translate skip = ['pyscript/tests/python_sample.py', 'pyscript/tests/python_sample2.py', 'pyscript/tests/python_sample3.py'] # Make a fresh copy of the flexx package if os.path.isdir(dest_dir): shutil.rmtree(dest_dir) ignore = lambda src, names: [n for n in names if n == '__pycache__'] shutil.copytree(src_dir, dest_dir, ignore=ignore) # Translate in-place LegacyPythonTranslator.translate_dir(dest_dir, skip=skip)
def copy_for_legacy_python(src_dir, dest_dir): from translate_to_legacy import LegacyPythonTranslator # Dirs and files to explicitly not translate skip = ['tests/python_sample.py', 'tests/python_sample2.py', 'tests/python_sample3.py'] # Make a fresh copy of the package if os.path.isdir(dest_dir): shutil.rmtree(dest_dir) ignore = lambda src, names: [n for n in names if n == '__pycache__'] shutil.copytree(src_dir, dest_dir, ignore=ignore) # Translate in-place LegacyPythonTranslator.translate_dir(dest_dir, skip=skip)
def copy_for_legacy_python(src_dir, dest_dir): if sys.argv[1:] != ['install']: raise RuntimeError('Setup.py can only be used to "install" on Python 2.x') from translate_to_legacy import LegacyPythonTranslator # Dirs and files to explicitly not translate ignore_dirs = ['__pycache__'] skip = ['pyscript/tests/python_sample.py', 'pyscript/tests/python_sample2.py', 'pyscript/tests/python_sample3.py'] # Make a copy of the flexx package if os.path.isdir(dest_dir): shutil.rmtree(dest_dir) shutil.copytree(src_dir, dest_dir, ignore=lambda src, names: [n for n in names if n in ignore_dirs]) # Translate in-place LegacyPythonTranslator.translate_dir(dest_dir, skip=skip)
def copy_for_legacy_python(src_dir, dest_dir): if sys.argv[1:] != ['install']: raise RuntimeError( 'Setup.py can only be used to "install" on Python 2.x') from translate_to_legacy import LegacyPythonTranslator # Dirs and files to explicitly not translate ignore_dirs = ['__pycache__'] skip = [ 'pyscript/tests/python_sample.py', 'pyscript/tests/python_sample2.py', 'pyscript/tests/python_sample3.py' ] # Make a copy of the flexx package if os.path.isdir(dest_dir): shutil.rmtree(dest_dir) shutil.copytree( src_dir, dest_dir, ignore=lambda src, names: [n for n in names if n in ignore_dirs]) # Translate in-place LegacyPythonTranslator.translate_dir(dest_dir, skip=skip)