当前位置: 首页>>代码示例>>Python>>正文


Python tasks_helpers.lrun函数代码示例

本文整理汇总了Python中tasks_helpers.lrun函数的典型用法代码示例。如果您正苦于以下问题:Python lrun函数的具体用法?Python lrun怎么用?Python lrun使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了lrun函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: 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)
开发者ID:odtvince,项目名称:udata,代码行数:7,代码来源:tasks.py

示例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)
开发者ID:vinyll,项目名称:udata,代码行数:7,代码来源:tasks.py

示例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)
开发者ID:anukat2015,项目名称:udata,代码行数:7,代码来源:tasks.py

示例4: 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)
开发者ID:vinyll,项目名称:udata,代码行数:8,代码来源:tasks.py

示例5: 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,
    )
开发者ID:vinyll,项目名称:udata,代码行数:8,代码来源:tasks.py

示例6: 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)
开发者ID:michelbl,项目名称:udata,代码行数:8,代码来源:tasks.py

示例7: 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'))
开发者ID:odtvince,项目名称:udata,代码行数:10,代码来源:tasks.py

示例8: 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"))
开发者ID:vinyll,项目名称:udata,代码行数:10,代码来源:tasks.py

示例9: 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=(',', ': '))
开发者ID:anukat2015,项目名称:udata,代码行数:53,代码来源:tasks.py

示例10: clean

def clean(ctx, node=False, translations=False, all=False):
    '''Cleanup all build artifacts'''
    header('Clean all build artifacts')
    patterns = [
        'build', 'dist', 'cover', 'docs/_build',
        '**/*.pyc', '*.egg-info', '.tox', 'udata/static/*'
    ]
    if node or all:
        patterns.append('node_modules')
    if translations or all:
        patterns.append('udata/translations/*/LC_MESSAGES/udata.mo')
    for pattern in patterns:
        info(pattern)
    lrun('rm -rf {0}'.format(' '.join(patterns)))
开发者ID:odtvince,项目名称:udata,代码行数:14,代码来源:tasks.py

示例11: 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*(?:\)|,)'),  # JS _('trad')
        re.compile(r'v-i18n="(.*?)"'),  # Vue.js directive v-i18n="trad"
        re.compile(r'"\{\{\{?\s*\'(.*?)\'\s*\|\s*i18n\}\}\}?"'),  # Vue.js filter {{ 'trad'|i18n }}
        re.compile(r'{{_\s*"(.*?)"\s*}}'),  # Handlebars {{_ "trad" }}
        re.compile(r"{{_\s*\'(.*?)\'\s*}}"),  # Handlebars {{_ 'trad' }}
        re.compile(r'\:[a-z0-9_\-]+="\s*_\(\'(.*?)\'\)\s*"'),  # Vue.js binding :prop="_('trad')"
    ]

    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=(",", ": "))
开发者ID:vinyll,项目名称:udata,代码行数:49,代码来源:tasks.py

示例12: 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)
开发者ID:grouan,项目名称:udata,代码行数:9,代码来源:tasks.py

示例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'))
开发者ID:anukat2015,项目名称:udata,代码行数:10,代码来源:tasks.py

示例14: update

def update(ctx, migrate=False):
    '''Perform a development update'''
    msg = 'Update all dependencies'
    if migrate:
        msg += ' and migrate data'
    header(msg)
    info('Updating Python dependencies')
    lrun('pip install -r requirements/develop.pip')
    lrun('pip install -e .')
    info('Updating JavaScript dependencies')
    lrun('npm install')
    if migrate:
        info('Migrating database')
        lrun('udata db migrate')
开发者ID:odtvince,项目名称:udata,代码行数:14,代码来源:tasks.py

示例15: widgets_watch

def widgets_watch(ctx):
    '''Build widgets on changes'''
    lrun('npm run widgets:watch', pty=True)
开发者ID:odtvince,项目名称:udata,代码行数:3,代码来源:tasks.py


注:本文中的tasks_helpers.lrun函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。