本文整理匯總了Python中distutils.command.clean.clean.run方法的典型用法代碼示例。如果您正苦於以下問題:Python clean.run方法的具體用法?Python clean.run怎麽用?Python clean.run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類distutils.command.clean.clean
的用法示例。
在下文中一共展示了clean.run方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
Clean.run(self)
# Remove c files if we are not within a sdist package
cwd = os.path.abspath(os.path.dirname(__file__))
remove_c_files = not os.path.exists(os.path.join(cwd, 'PKG-INFO'))
if remove_c_files:
print('Will remove generated .c files')
if os.path.exists('build'):
shutil.rmtree('build')
for dirpath, dirnames, filenames in os.walk('pulse2percept'):
for filename in filenames:
if any(filename.endswith(suffix) for suffix in
(".so", ".pyd", ".dll", ".pyc")):
os.unlink(os.path.join(dirpath, filename))
continue
extension = os.path.splitext(filename)[1]
if remove_c_files and extension in ['.c', '.cpp']:
pyx_file = str.replace(filename, extension, '.pyx')
if os.path.exists(os.path.join(dirpath, pyx_file)):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
shutil.rmtree(os.path.join(dirpath, dirname))
示例2: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
_clean.run(self)
if os.path.exists('build'):
shutil.rmtree('build')
for dirpath, dirnames, filenames in os.walk('yatsm'):
for filename in filenames:
if any(filename.endswith(suffix) for suffix in
('.c', '.so', '.pyd', '.pyc')):
os.unlink(os.path.join(dirpath, filename))
continue
if (any(filename.endswith(suffix) for suffix in
('.pkl', '.json')) and
os.path.basename(dirpath) == 'pickles'):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
shutil.rmtree(os.path.join(dirpath, dirname))
# Create pickles when building
示例3: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
Clean.run(self)
# Remove c files if we are not within a sdist package
cwd = os.path.abspath(os.path.dirname(__file__))
remove_c_files = not os.path.exists(os.path.join(cwd, 'PKG-INFO'))
if remove_c_files:
print('Will remove generated .c files')
if os.path.exists('build'):
shutil.rmtree('build')
for dirpath, dirnames, filenames in os.walk('.'):
for filename in filenames:
if any(filename.endswith(suffix) for suffix in
(".so", ".pyd", ".dll", ".pyc")):
os.unlink(os.path.join(dirpath, filename))
continue
extension = os.path.splitext(filename)[1]
if remove_c_files and extension in ['.c', '.cpp']:
pyx_file = str.replace(filename, extension, '.pyx')
if os.path.exists(os.path.join(dirpath, pyx_file)):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
shutil.rmtree(os.path.join(dirpath, dirname))
示例4: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
Clean.run(self)
# Remove c files if we are not within a sdist package
cwd = os.path.abspath(os.path.dirname(__file__))
remove_c_files = not os.path.exists(os.path.join(cwd, 'PKG-INFO'))
if remove_c_files:
print('Will remove generated .c files')
if os.path.exists('build'):
shutil.rmtree('build')
for dirpath, dirnames, filenames in os.walk('rankeval'):
for filename in filenames:
if any(filename.endswith(suffix) for suffix in
(".so", ".pyd", ".dll", ".pyc")):
os.unlink(os.path.join(dirpath, filename))
continue
extension = os.path.splitext(filename)[1]
if remove_c_files and extension in ['.c', '.cpp']:
pyx_file = str.replace(filename, extension, '.pyx')
if os.path.exists(os.path.join(dirpath, pyx_file)):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
shutil.rmtree(os.path.join(dirpath, dirname))
示例5: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
"the entry point for the distutils clean class"
sys.stdout.write(blue("Cleaning headers:"))
dir_gen = os.walk("Inventor")
for _dir, _, names in dir_gen:
self.remove_headers(None, _dir, names)
dir_gen = os.walk("VolumeViz")
for _dir, _, names in dir_gen:
self.remove_headers(None, _dir, names)
self.remove_cmake()
# remove the SWIG generated wrappers
for wrapper_file in self.REMOVE_FILES:
if os.path.isfile(wrapper_file):
sys.stdout.write(' ' + turquoise(wrapper_file))
os.remove(wrapper_file)
print(green("."))
clean.run(self)
示例6: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
"the entry point for the distutils clean class"
sys.stdout.write(blue("Cleaning headers:"))
dir_gen = os.walk("Inventor")
for _dir, _, names in dir_gen:
self.remove_headers(None, _dir, names)
dir_gen = os.walk("VolumeViz")
for _dir, _, names in dir_gen:
self.remove_headers(None, _dir, names)
# remove the SWIG generated wrappers
for wrapper_file in self.REMOVE_FILES:
if os.path.isfile(wrapper_file):
sys.stdout.write(' ' + turquoise(wrapper_file))
os.remove(wrapper_file)
print(green("."))
clean.run(self)
示例7: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
protoc = find_executable("protoc")
if not protoc:
sys.stderr.write('Cant find protoc.\n')
sys.exit(-1)
if not os.path.exists('auvsi_suas/proto'):
shutil.copytree('../proto', 'auvsi_suas/proto')
for (dirpath, dirnames, filenames) in os.walk("auvsi_suas/proto"):
for filename in filenames:
if not filename.endswith(".proto"):
continue
filepath = os.path.join(dirpath, filename)
if subprocess.call([protoc, '--python_out=.', filepath]) != 0:
sys.stderr.write('Failed to compile protos.\n')
sys.exit(-1)
_build_py.run(self)
示例8: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
# Generate necessary .proto file if it doesn't exist.
generate_proto("../src/google/protobuf/descriptor.proto")
generate_proto("../src/google/protobuf/compiler/plugin.proto")
generate_proto("../src/google/protobuf/any.proto")
generate_proto("../src/google/protobuf/api.proto")
generate_proto("../src/google/protobuf/duration.proto")
generate_proto("../src/google/protobuf/empty.proto")
generate_proto("../src/google/protobuf/field_mask.proto")
generate_proto("../src/google/protobuf/source_context.proto")
generate_proto("../src/google/protobuf/struct.proto")
generate_proto("../src/google/protobuf/timestamp.proto")
generate_proto("../src/google/protobuf/type.proto")
generate_proto("../src/google/protobuf/wrappers.proto")
GenerateUnittestProtos()
# Make sure google.protobuf/** are valid packages.
for path in ['', 'internal/', 'compiler/', 'pyext/', 'util/']:
try:
open('google/protobuf/%s__init__.py' % path, 'a').close()
except EnvironmentError:
pass
# _build_py is an old-style class, so super() doesn't work.
_build_py.run(self)
示例9: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
Clean.run(self)
# Remove c files if we are not within a sdist package
cwd = os.path.abspath(os.path.dirname(__file__))
remove_c_files = not os.path.exists(os.path.join(cwd, 'PKG-INFO'))
if remove_c_files:
print('Will remove generated .c files')
if os.path.exists('build'):
shutil.rmtree('build')
for dirpath, dirnames, filenames in os.walk('ristretto'):
for filename in filenames:
if any(filename.endswith(suffix) for suffix in
(".so", ".pyd", ".dll", ".pyc")):
os.unlink(os.path.join(dirpath, filename))
continue
extension = os.path.splitext(filename)[1]
if remove_c_files and extension in ['.c', '.cpp']:
pyx_file = str.replace(filename, extension, '.pyx')
if os.path.exists(os.path.join(dirpath, pyx_file)):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
shutil.rmtree(os.path.join(dirpath, dirname))
示例10: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
clean.run(self)
def maybe_rm(path):
if os.path.exists(path):
shutil.rmtree(path)
if self.all:
maybe_rm('ndkale.egg-info')
maybe_rm('build')
maybe_rm('dist')
subprocess.call('rm -rf *.egg', shell=True)
subprocess.call('find . -name "*.pyc" -exec rm -rf {} \;',
shell=True)
# -*- Classifiers -*-
示例11: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
clean.run(self)
def maybe_rm(path):
if os.path.exists(path):
shutil.rmtree(path)
maybe_rm('ndscheduler.egg-info')
maybe_rm('build')
maybe_rm('.venv')
maybe_rm('dist')
maybe_rm('.eggs')
subprocess.call('rm -rf *.egg', shell=True)
subprocess.call('rm -f datastore.db', shell=True)
subprocess.call('find . -name "*.pyc" -exec rm -rf {} \;',
shell=True)
# -*- Classifiers -*-
示例12: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
Clean.run(self)
if os.path.exists('build'):
shutil.rmtree('build')
# Remove c files if we are not within a sdist package
cwd = os.path.abspath(os.path.dirname(__file__))
remove_c_files = not os.path.exists(os.path.join(cwd, 'PKG-INFO'))
if remove_c_files:
if os.path.exists('lap/_lapjv.cpp'):
os.unlink('lap/_lapjv.cpp')
for dirpath, dirnames, filenames in os.walk('lap'):
for filename in filenames:
if any(filename.endswith(suffix) for suffix in
(".so", ".pyd", ".dll", ".pyc")):
os.unlink(os.path.join(dirpath, filename))
for dirname in dirnames:
if dirname == '__pycache__':
shutil.rmtree(os.path.join(dirpath, dirname))
示例13: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
options=['setup', '_bcftools', '_utils']
if not self.minimal:
if not self.no_samtools:
options.append('_samtools')
if not self.no_gem3:
options.append('gem3')
if not self.no_bscall:
options.append('_bs_call')
if not self.enable_cuda:
self.diable_cuda = True
compile_gemBS_tools(options, self.enable_cuda, self.disable_cuda)
_install.run(self)
# find target folder
install_dir = os.path.join(gemBS_install_dir, "gemBS")
_install_bundle(install_dir, self)
示例14: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
from grpc_tools import protoc
include = pkg_resources.resource_filename('grpc_tools', '_proto')
for src in glob(os.path.join(JAVA_PROTO_DIR, "*.proto")):
command = ['grpc_tools.protoc',
'--proto_path=%s' % JAVA_PROTO_DIR,
'--proto_path=%s' % include,
'--python_out=%s' % SKEIN_PROTO_DIR,
'--grpc_python_out=%s' % SKEIN_PROTO_DIR,
src]
if protoc.main(command) != 0:
self.warn('Command: `%s` failed'.format(command))
sys.exit(1)
for path in _compiled_protos():
self._fix_imports(path)
示例15: run
# 需要導入模塊: from distutils.command.clean import clean [as 別名]
# 或者: from distutils.command.clean.clean import run [as 別名]
def run(self):
if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)),"__libdarknet","libdarknet.so")):
logging.info("removing __libdarknet/libdarknet.so")
os.remove(os.path.join(os.path.dirname(__file__),"__libdarknet","libdarknet.so"))
if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), "libdarknet.so")):
logging.info("removing libdarknet.so")
os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),"libdarknet.so"))
if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)),"pydarknet.cpp")):
logging.info("removing pydarknet.cpp")
os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),"pydarknet.cpp"))
for f in os.listdir(os.path.dirname(os.path.abspath(__file__))):
if f.startswith("pydarknet.") and f.endswith(".so"):
logging.info("removing " + f)
os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),f))
clean.run(self)