Example #1
0
import os
import subprocess
import sys
import unittest
from importlib import import_module

from green import __version__ as green_version
from colr import (
    __version__ as colr_version,
    auto_disable as colr_auto_disable,
    docopt,
    Colr as C,
)
from fmtblock import __version__ as fmtblock_version
colr_auto_disable()

APPNAME = 'FormatBlock'
APPVERSION = fmtblock_version
NAME = '{} Test Runner'.format(APPNAME)
VERSION = '0.0.1'
VERSIONSTR = '{} v. {}'.format(NAME, VERSION)
SCRIPT = os.path.split(os.path.abspath(sys.argv[0]))[1]
SCRIPTDIR = os.path.abspath(sys.path[0])

USAGESTR = """{versionstr}
    Runs tests using `green` and provides a little more info.

    Usage:
        {script} [-h | -l | -L | -v]
        {script} [-d] [-s] TESTS...
Example #2
0
    print(
        '\n'.join((
            'Failed to import {pname}, you may need to install it:',
            '    pip install {exc.name}',
            'Original error:',
            '    {exc.msg}'
        )).format(
            pname=exc.name.title(),
            exc=exc
        ),
        file=sys.stderr
    )
    sys.exit(1)

# Disable colors when piping output.
colr_auto_disable()

NAME = 'CodePDF'
VERSION = '0.0.5'
VERSIONSTR = '{} v. {}'.format(NAME, VERSION)
SCRIPT = os.path.split(os.path.abspath(sys.argv[0]))[1]
SCRIPTDIR = os.path.abspath(sys.path[0])

# Global debug flag, set with --debug.
DEBUG = False
# File name to trigger reading from stdin.
STDIN_NAME = '-'
# Default pygments style.
DEFAULT_STYLE = 'default'
# Default pygments lexer, when it can't be detected.
DEFAULT_LEXER = 'text'