本文整理汇总了Python中tasks_helpers.header函数的典型用法代码示例。如果您正苦于以下问题:Python header函数的具体用法?Python header怎么用?Python header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: jstest
def jstest(hot=False):
"""Run JS tests suite"""
header("Run client tests suite")
cmd = "webpack-dev-server --config webpack.config.test.js"
if hot:
cmd += " --hot --inline"
nrun(cmd, pty=True)
示例2: test
def test(fast=False):
"""Run tests suite"""
header("Run tests suite")
cmd = "nosetests --rednose --force-color udata"
if fast:
cmd = " ".join([cmd, "--stop"])
lrun(cmd, pty=True)
示例3: test
def test(fast=False):
'''Run tests suite'''
header('Run tests suite')
cmd = 'nosetests --rednose --force-color udata'
if fast:
cmd = ' '.join([cmd, '--stop'])
lrun(cmd, pty=True)
示例4: perform_dist
def perform_dist(buildno=None):
header('Building a distribuable package')
cmd = ['python setup.py']
if buildno:
cmd.append('egg_info -b {0}'.format(buildno))
cmd.append('bdist_wheel')
lrun(' '.join(cmd), pty=True)
示例5: jstest
def jstest(hot=False):
'''Run JS tests suite'''
header('Run client tests suite')
cmd = 'webpack-dev-server --config webpack.config.test.js'
if hot:
cmd += ' --hot --inline'
nrun(cmd, pty=True)
示例6: cover
def cover(ctx, html=False):
'''Run tests suite with coverage'''
header('Run tests suite with coverage')
cmd = 'pytest --cov udata --cov-report term'
if html:
cmd = ' '.join((cmd, '--cov-report html:reports/python/cover'))
with ctx.cd(ROOT):
ctx.run(cmd, pty=True)
示例7: assets_build
def assets_build(progress=False):
'''Install and compile assets'''
header('Building static assets')
cmd = 'npm run assets:build -- --config {0}.js'
if progress:
cmd += ' --progress'
nrun(cmd.format('webpack.config.prod'), pty=True)
nrun(cmd.format('webpack.widgets.config'), pty=True)
示例8: assets_build
def assets_build(progress=False):
"""Install and compile assets"""
header("Building static assets")
cmd = "npm run assets:build -- --config {0}.js"
if progress:
cmd += " --progress"
lrun(cmd.format("webpack.config.prod"), pty=True)
lrun(cmd.format("webpack.widgets.config"), pty=True)
示例9: cover
def cover():
"""Run tests suite with coverage"""
header("Run tests suite with coverage")
lrun(
"nosetests --rednose --force-color \
--with-coverage --cover-html --cover-package=udata",
pty=True,
)
示例10: qa
def qa():
'''Run a quality report'''
header('Performing static analysis')
info('Python static analysis')
flake8_results = lrun('flake8 udata', warn=True)
info('JavaScript static analysis')
jshint_results = nrun('jshint js', warn=True)
if flake8_results.failed or jshint_results.failed:
exit(flake8_results.return_code or jshint_results.return_code)
示例11: qa
def qa(ctx):
'''Run a quality report'''
header('Performing static analysis')
info('Python static analysis')
flake8_results = lrun('flake8 udata --jobs 1', pty=True, warn=True)
info('JavaScript static analysis')
eslint_results = lrun('npm -s run lint', pty=True, warn=True)
if flake8_results.failed or eslint_results.failed:
exit(flake8_results.return_code or eslint_results.return_code)
print(green('OK'))
示例12: qa
def qa():
"""Run a quality report"""
header("Performing static analysis")
info("Python static analysis")
flake8_results = lrun("flake8 udata --jobs 1", pty=True, warn=True)
info("JavaScript static analysis")
eslint_results = lrun("npm -s run lint", pty=True, warn=True)
if flake8_results.failed or eslint_results.failed:
exit(flake8_results.return_code or eslint_results.return_code)
print(green("OK"))
示例13: qa
def qa():
'''Run a quality report'''
header('Performing static analysis')
info('Python static analysis')
flake8_results = lrun('flake8 udata', pty=True, warn=True)
info('JavaScript static analysis')
eslint_results = nrun('eslint js/ --ext .vue,.js', pty=True, warn=True)
if flake8_results.failed or eslint_results.failed:
exit(flake8_results.return_code or eslint_results.return_code)
print(green('OK'))
示例14: clean
def clean(bower=False, node=False):
"""Cleanup all build artifacts"""
header("Clean all build artifacts")
patterns = ["build", "dist", "cover", "docs/_build", "**/*.pyc", "*.egg-info", ".tox"]
if bower:
patterns.append("udata/static/bower")
if node:
patterns.append("node_modules")
for pattern in patterns:
info("Removing {0}".format(pattern))
run("cd {0} && rm -rf {1}".format(ROOT, pattern))
示例15: i18n
def i18n():
'''Extract translatable strings'''
header('Extract translatable strings')
info('Extract Python strings')
lrun('python setup.py extract_messages')
lrun('python setup.py update_catalog')
info('Extract JavaScript strings')
keys = []
catalog = {}
catalog_filename = join(ROOT, 'js', 'locales',
'{}.en.json'.format(I18N_DOMAIN))
not_found = {}
not_found_filename = join(ROOT, 'js', 'locales',
'{}.notfound.json'.format(I18N_DOMAIN))
if exists(catalog_filename):
with codecs.open(catalog_filename, encoding='utf8') as f:
catalog = json.load(f)
globs = '*.js', '*.vue', '*.hbs'
regexps = [
re.compile(r'(?:|\.|\s|\{)_\(\s*(?:"|\')(.*?)(?:"|\')\s*(?:\)|,)'),
# re.compile(r'this\._\(\s*(?:"|\')(.*?)(?:"|\')\s*\)'),
re.compile(r'v-i18n="(.*?)"'),
re.compile(r'"\{\{\{?\s*\'(.*?)\'\s*\|\s*i18n\}\}\}?"'),
re.compile(r'{{_\s*"(.*?)"\s*}}'),
re.compile(r'{{_\s*\'(.*?)\'\s*}}'),
]
for directory, _, _ in os.walk(join(ROOT, 'js')):
glob_patterns = (iglob(join(directory, g)) for g in globs)
for filename in itertools.chain(*glob_patterns):
print('Extracting messages from {0}'.format(green(filename)))
content = codecs.open(filename, encoding='utf8').read()
for regexp in regexps:
for match in regexp.finditer(content):
key = match.group(1)
keys.append(key)
if key not in catalog:
catalog[key] = key
with codecs.open(catalog_filename, 'w', encoding='utf8') as f:
json.dump(catalog, f, sort_keys=True, indent=4, ensure_ascii=False,
encoding='utf8', separators=(',', ': '))
for key, value in catalog.items():
if key not in keys:
not_found[key] = value
with codecs.open(not_found_filename, 'w', encoding='utf8') as f:
json.dump(not_found, f, sort_keys=True, indent=4, ensure_ascii=False,
encoding='utf8', separators=(',', ': '))