def run(self):
# Regular installation
install.do_egg_install(self)
# copy sos.vim and sos-detect.vim to .vim
vim_syntax_dir = os.path.expanduser('~/.vim/syntax')
vim_syntax_file = os.path.join(vim_syntax_dir, 'sos.vim')
if not os.path.isdir(vim_syntax_dir):
os.makedirs(vim_syntax_dir)
shutil.copy('misc/sos.vim', vim_syntax_file)
#
vim_ftdetect_dir = os.path.expanduser('~/.vim/ftdetect')
vim_ftdetect_file = os.path.join(vim_ftdetect_dir, 'sos.vim')
if not os.path.isdir(vim_ftdetect_dir):
os.makedirs(vim_ftdetect_dir)
shutil.copy('misc/sos-detect.vim', vim_ftdetect_file)
log.info('\nSoS is installed and configured to use with vim.')
log.info('Use "set syntax=sos" to enable syntax highlighting.')
python类do_egg_install()的实例源码
def run(self):
_pre_install()
install.run(self)
# FIXME: why egg missed without manual install?
install.do_egg_install(self)
def run(self):
_install.do_egg_install(self)
spacy_download_en()
_install.run(self)
def run(self):
# setuptools is an oldie goldie. super() is not supported by base class (it's an "old style class")
SetuptoolsInstallCommand.do_egg_install(self)
import nltk
for corpus in _required_nltk_corpora:
nltk.download(corpus)
def run(self):
build_protos()
install.do_egg_install(self)
def do_egg_install(self):
path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "rekall-core", "setup.py"))
if os.access(path, os.F_OK):
print "Installing rekall-core from local directory."
subprocess.check_call([sys.executable, "setup.py", "install"],
cwd="rekall-core")
# Need to call this directly because _install.run does crazy stack
# walking and falls back to compatibility mode.
_install.do_egg_install(self)
def run(self):
info = '''
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! PLEASE READ COMMENTS IN ~/.magnet/console.sh AND !
! CHANGE SETTINGS ACCORDING YOUR SYSTEM. !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'''
print(info)
cmd_pipeline = "apt-get install -y python-qt4 xdotool && cp -R config %s/.magnet" % os.environ.get('HOME')
for c in cmd_pipeline.split(' && '):
subprocess.check_output(c.split(' '))
install.do_egg_install(self)