• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python fancylogger.logToScreen函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: run

    def run(self, args):
        """Run 'create' subcommand."""
        optparser = CreateOptions(go_args=args, envvar_prefix=self.envvar_prefix, usage=self.usage_txt)
        options = optparser.options
        if not validate_pbs_option(options):
            sys.stderr.write('Missing config options. Exiting.\n')
            return 1

        label = options.label

        if not hc.validate_label(label, hc.known_cluster_labels()):
            sys.exit(1)

        if not hc.validate_hodconf_or_dist(options.hodconf, options.dist):
            sys.exit(1)

        try:
            j = PbsHodJob(optparser)
            hc.report_cluster_submission(label)
            j.run()
            jobs = j.state()
            hc.post_job_submission(label, jobs, optparser.options.workdir)
            return 0
        except StandardError as e:
            fancylogger.setLogFormat(fancylogger.TEST_LOGGING_FORMAT)
            fancylogger.logToScreen(enable=True)
            _log.raiseException(e.message)
开发者ID:ehiggs,项目名称:hanythingondemand,代码行数:27,代码来源:create.py


示例2: test_normal_logging

    def test_normal_logging(self):
        """
        Test if just using import logging, logging.warning still works after importing fancylogger
        """

        stringfile = StringIO()
        sys.stderr = stringfile
        handler = fancylogger.logToScreen()
        import logging
        msg = 'this is my string'
        logging.warning(msg)
        self.assertTrue(msg in stringfile.getvalue(),
                        msg="'%s' in '%s'" % (msg, stringfile.getvalue()))

        msg = 'there are many like it'
        logging.getLogger().warning(msg)
        self.assertTrue(msg in stringfile.getvalue(),
                        msg="'%s' in '%s'" % (msg, stringfile.getvalue()))

        msg = 'but this one is mine'
        logging.getLogger('mine').warning(msg)
        self.assertTrue(msg in stringfile.getvalue(),
                        msg="'%s' in '%s'" % (msg, stringfile.getvalue()))


        # restore
        fancylogger.logToScreen(enable=False, handler=handler)
开发者ID:Iepoev,项目名称:vsc-base,代码行数:27,代码来源:fancylogger.py


示例3: parse_options

def parse_options(args=None):
    """wrapper function for option parsing"""
    if os.environ.get("DEBUG_EASYBUILD_OPTIONS", "0").lower() in ("1", "true", "yes", "y"):
        # very early debug, to debug the generaloption itself
        fancylogger.logToScreen(enable=True)
        fancylogger.setLogLevel("DEBUG")

    usage = "%prog [options] easyconfig [...]"
    description = (
        "Builds software based on easyconfig (or parse a directory).\n"
        "Provide one or more easyconfigs or directories, use -H or --help more information."
    )

    try:
        eb_go = EasyBuildOptions(
            usage=usage,
            description=description,
            prog="eb",
            envvar_prefix=CONFIG_ENV_VAR_PREFIX,
            go_args=args,
            error_env_options=True,
            error_env_option_method=raise_easybuilderror,
        )
    except Exception, err:
        raise EasyBuildError("Failed to parse configuration options: %s" % err)
开发者ID:gppezzi,项目名称:easybuild-framework,代码行数:25,代码来源:options.py


示例4: parseoptions

    def parseoptions(self, options_list=None):
        """
        Handle mpirun mode:
          - continue with reduced set of commandline options
          - These options are the keys of opts_to_remove.
          - The values of opts_to_remove are the number of arguments of these options, that also need to be removed.
        """

        if options_list is None:
            options_list = self.default_parseoptions()

        newopts = options_list[:]  # copy
        if self.mpirunmode:
            opts_to_remove = {
                '-np': 1,
                '-machinefile': 1
            }

            for opt in opts_to_remove.keys():
                try:
                    pos = newopts.index(opt)
                    # remove 1 + args
                    del newopts[pos:pos + 1 + opts_to_remove[opt]]
                except ValueError:
                    continue

        GeneralOption.parseoptions(self, newopts)

        # set error logging to file as soon as possible
        if self.options.logtofile:
            print("logtofile %s" % self.options.logtofile)
            if os.path.exists(self.options.logtofile):
                os.remove(self.options.logtofile)
            fancylogger.logToFile(self.options.logtofile)
            fancylogger.logToScreen(False)
开发者ID:hpcugent,项目名称:vsc-mympirun,代码行数:35,代码来源:option.py


示例5: test_fancylogger_as_rootlogger_logging

    def test_fancylogger_as_rootlogger_logging(self):
        """
        Test if just using import logging, logging with logging uses fancylogger
        after setting the root logger
        """

        # test logging.root is loggin root logger
        # this is an assumption made to make the fancyrootlogger code work
        orig_root = logging.getLogger()
        self.assertEqual(logging.root, orig_root,
                         msg='logging.root is the root logger')
        self.assertFalse(isinstance(logging.root, fancylogger.FancyLogger),
                         msg='logging.root is not a FancyLogger')


        stringfile = StringIO()
        sys.stderr = stringfile
        handler = fancylogger.logToScreen()
        fancylogger.setLogLevelDebug()
        logger = fancylogger.getLogger()

        self.assertEqual(logger.handlers, [self.handler, handler],
                         msg='active handler for root fancylogger')
        self.assertEqual(logger.level, fancylogger.getLevelInt('DEBUG'), msg='debug level set')

        msg = 'this is my string'
        logging.debug(msg)
        self.assertEqual(stringfile.getvalue(), '',
                         msg="logging.debug reports nothing when fancylogger loglevel is debug")

        fancylogger.setroot()
        self.assertTrue(isinstance(logging.root, fancylogger.FancyLogger),
                         msg='logging.root is a FancyLogger after setRootLogger')
        self.assertEqual(logging.root.level, fancylogger.getLevelInt('DEBUG'), msg='debug level set for root')
        self.assertEqual(logger.level, logging.NOTSET, msg='original root fancylogger level set to NOTSET')

        self.assertEqual(logging.root.handlers, [self.handler, handler],
                         msg='active handler for root logger from previous root fancylogger')
        self.assertEqual(logger.handlers, [], msg='no active handlers on previous root fancylogger')

        root_logger = logging.getLogger('')
        self.assertEqual(root_logger, logging.root,
                        msg='logging.getLogger() returns logging.root FancyLogger')

        frl = fancylogger.getLogger()
        self.assertEqual(frl, logging.root,
                        msg='fancylogger.getLogger() returns logging.root FancyLogger')

        logging.debug(msg)
        self.assertTrue(msg in stringfile.getvalue(),
                         msg="logging.debug reports when fancylogger loglevel is debug")

        fancylogger.resetroot()
        self.assertEqual(logging.root, orig_root,
                         msg='logging.root is the original root logger after resetroot')

        # restore
        fancylogger.logToScreen(enable=False, handler=handler)
开发者ID:hpcugent,项目名称:vsc-base,代码行数:58,代码来源:fancylogger.py


示例6: parse_options

def parse_options(args=None):
    """wrapper function for option parsing"""
    if os.environ.get('DEBUG_EASYBUILD_OPTIONS', '0').lower() in ('1', 'true', 'yes', 'y'):
        # very early debug, to debug the generaloption itself
        fancylogger.logToScreen(enable=True)
        fancylogger.setLogLevel('DEBUG')

    usage = "%prog [options] easyconfig [...]"
    description = ("Builds software based on easyconfig (or parse a directory).\n"
                   "Provide one or more easyconfigs or directories, use -H or --help more information.")

    eb_go = EasyBuildOptions(usage=usage, description=description, prog='eb', envvar_prefix='EASYBUILD', go_args=args)
    return eb_go
开发者ID:JackPerdue,项目名称:easybuild-framework,代码行数:13,代码来源:options.py


示例7: run

 def run(self, args):
     """Run 'clean' subcommand."""
     optparser = CleanOptions(go_args=args, envvar_prefix=self.envvar_prefix, usage=self.usage_txt)
     try:
         pbs = rm_pbs.Pbs(optparser)
         state = pbs.state()
         labels = hc.known_cluster_labels()
         rm_master = rm_pbs.master_hostname()
         info = hc.mk_cluster_info_dict(labels, state, master=rm_master)
         hc.clean_cluster_info(rm_master, info)
     except StandardError as err:
         fancylogger.setLogFormat(fancylogger.TEST_LOGGING_FORMAT)
         fancylogger.logToScreen(enable=True)
         _log.raiseException(err.message)
开发者ID:ehiggs,项目名称:hanythingondemand,代码行数:14,代码来源:clean.py


示例8: init_logging

def init_logging(logfile, logtostdout=False, testing=False):
    """Initialize logging."""
    if logtostdout:
        fancylogger.logToScreen(enable=True, stdout=True)
    else:
        if logfile is None:
            # mkstemp returns (fd,filename), fd is from os.open, not regular open!
            fd, logfile = tempfile.mkstemp(suffix='.log', prefix='easybuild-')
            os.close(fd)

        fancylogger.logToFile(logfile)
        print_msg('temporary log file in case of crash %s' % (logfile), log=None, silent=testing)

    log = fancylogger.getLogger(fname=False)

    return log, logfile
开发者ID:dnangellight,项目名称:easybuild-framework,代码行数:16,代码来源:build_log.py


示例9: __init__

 def __init__(self, hostname, port, log_dir, filename, pidfile):
     """Constructor"""
     stdin = '/dev/null'
     stdout = os.path.join(log_dir, 'logging_error.log')
     stderr = os.path.join(log_dir, 'logging_error.log')
     Daemon.__init__(self, pidfile, stdin, stdout, stderr)
     self.hostname = hostname
     self.port = port
     #Set up logging
     # get logger, we will log to file
     fancylogger.logToScreen(False)
     # we want to log absolutely everything that's comming at us
     fancylogger.setLogLevel(0)
     self.logfile = os.path.join(log_dir, filename)
     fancylogger.logToFile(self.logfile)
     self.logger = fancylogger.getLogger()
     self.socket_ = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
开发者ID:hpcugent,项目名称:vsc-base,代码行数:17,代码来源:logdaemon.py


示例10: run

    def run(self, args):
        """Run 'batch' subcommand."""
        optparser = BatchOptions(go_args=args, envvar_prefix=self.envvar_prefix, usage=self.usage_txt)
        options = optparser.options
        if not validate_pbs_option(options):
            sys.stderr.write('Missing config options. Exiting.\n')
            return 1

        if optparser.options.script is None:
            sys.stderr.write('Missing script. Exiting.\n')
            return 1

        # resolve script path to absolute path
        optparser.options.script = os.path.abspath(optparser.options.script)

        if not os.path.exists(optparser.options.script):
            sys.stderr.write("Specified script does not exist: %s. Exiting.\n" % optparser.options.script)
            return 1

        # make sure script is executable
        cur_perms = os.stat(optparser.options.script)[stat.ST_MODE]
        if not (cur_perms & stat.S_IXUSR):
            print "Specified script %s is not executable yet, fixing that..." % optparser.options.script
            os.chmod(optparser.options.script, cur_perms|stat.S_IXUSR)

        label = options.label

        if not hc.validate_label(label, hc.known_cluster_labels()):
            sys.exit(1)

        if not hc.validate_hodconf_or_dist(options.hodconf, options.dist):
            sys.exit(1)

        try:
            j = PbsHodJob(optparser)
            hc.report_cluster_submission(label)
            j.run()
            jobs = j.state()
            hc.post_job_submission(label, jobs, optparser.options.workdir)
            return 0
        except StandardError as e:
            fancylogger.setLogFormat(fancylogger.TEST_LOGGING_FORMAT)
            fancylogger.logToScreen(enable=True)
            _log.raiseException(e.message)
开发者ID:ehiggs,项目名称:hanythingondemand,代码行数:44,代码来源:batch.py


示例11: test_normal_logging

    def test_normal_logging(self):
        """
        Test if just using import logging, logging.warning still works after importing fancylogger
        """
        _stderr = sys.stderr
        stringfile = StringIO()
        sys.stderr = stringfile
        handler = fancylogger.logToScreen()
        import logging
        logging.warning('this is my string')
        self.assertTrue('this is my string' in stringfile.getvalue())

        logging.getLogger().warning('there are many like it')
        self.assertTrue('there are many like it' in stringfile.getvalue())

        logging.getLogger('mine').warning('but this one is mine')
        self.assertTrue('but this one is mine' in stringfile.getvalue())

        # restore
        fancylogger.logToScreen(enable=False, handler=handler)
        sys.stderr = _stderr
开发者ID:billy-mahimahi,项目名称:vsc-base,代码行数:21,代码来源:fancylogger.py


示例12: _stream_stdouterr

    def _stream_stdouterr(self, isstdout=True, expect_match=True):
        """Log to stdout or stderror, check stdout or stderror"""
        fd, logfn = tempfile.mkstemp()
        # fh will be checked
        fh = os.fdopen(fd, 'w')

        _stdout = sys.stdout
        _stderr = sys.stderr

        if isstdout == expect_match:
            sys.stdout = fh
            sys.stderr = open(os.devnull, 'w')
        else:
            sys.stdout = open(os.devnull, 'w')
            sys.stderr = fh

        fancylogger.setLogLevelInfo()
        name = 'test_stream_stdout'
        lh = fancylogger.logToScreen(stdout=isstdout)
        logger = fancylogger.getLogger(name, fname=True, clsname=False)
        # logfn makes it unique
        msg = 'TEST isstdout %s expect_match %s logfn %s' % (isstdout, expect_match, logfn)
        logger.info(msg)

        # restore
        fancylogger.logToScreen(enable=False, handler=lh)
        sys.stdout = _stdout
        sys.stderr = _stderr

        fh2 = open(logfn)
        txt = fh2.read().strip()
        fh2.close()
        reg_exp = re.compile(r"INFO\s+\S+.%s.%s\s+\S+\s+%s" % (name, '_stream_stdouterr', msg))
        match = reg_exp.search(txt) is not None
        self.assertEqual(match, expect_match)

        try:
            os.remove(logfn)
        except:
            pass
开发者ID:Iepoev,项目名称:vsc-base,代码行数:40,代码来源:fancylogger.py


示例13: test_zzz_logtostdout

    def test_zzz_logtostdout(self):
        """Testing redirecting log to stdout."""

        fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log')
        os.close(fd)

        for stdout_arg in ['--logtostdout', '-l']:

            _stdout = sys.stdout

            fd, fn = tempfile.mkstemp()
            fh = os.fdopen(fd, 'w')
            sys.stdout = fh

            args = [
                    '--software-name=somethingrandom',
                    '--robot', '.',
                    '--debug',
                    stdout_arg,
                   ]
            self.eb_main(args, logfile=dummylogfn)

            # make sure we restore
            sys.stdout.flush()
            sys.stdout = _stdout
            fancylogger.logToScreen(enable=False, stdout=True)

            outtxt = read_file(fn)

            self.assertTrue(len(outtxt) > 100, "Log messages are printed to stdout when %s is used (outtxt: %s)" % (stdout_arg, outtxt))

            # cleanup
            os.remove(fn)
            modify_env(os.environ, self.orig_environ)
            tempfile.tempdir = None

        if os.path.exists(dummylogfn):
            os.remove(dummylogfn)
        fancylogger.logToFile(self.logfile)
开发者ID:JackPerdue,项目名称:easybuild-framework,代码行数:39,代码来源:options.py


示例14: test_classname_in_log

    def test_classname_in_log(self):
        """Do a log and check if the classname is correctly in it"""
        _stderr = sys.stderr

        class Foobar:
            def somefunction(self):
                logger = fancylogger.getLogger(fname=True, clsname=True)
                logger.warn('we are logging something here')

        stringfile = StringIO()
        sys.stderr = stringfile
        handler = fancylogger.logToScreen()

        Foobar().somefunction()
        self.assertTrue('Foobar.somefunction' in stringfile.getvalue())
        stringfile.close()

        # restore
        fancylogger.logToScreen(enable=False, handler=handler)
        # and again
        stringfile = StringIO()
        sys.stderr = stringfile
        handler = fancylogger.logToScreen()
        classless_function()
        self.assertTrue('?.classless_function' in stringfile.getvalue())

        # restore
        fancylogger.logToScreen(enable=False, handler=handler)
        stringfile = StringIO()
        sys.stderr = stringfile

        fancylogger.setLogFormat("%(className)s blabla")
        handler = fancylogger.logToScreen()
        logger = fancylogger.getLogger(fname=False, clsname=False)
        logger.warn("blabla")
        print stringfile.getvalue()
        # this will only hold in debug mode, so also disable the test
        if __debug__:
            self.assertTrue('FancyLoggerTest' in stringfile.getvalue())
        # restore
        fancylogger.logToScreen(enable=False, handler=handler)
        sys.stderr = _stderr
开发者ID:Iepoev,项目名称:vsc-base,代码行数:42,代码来源:fancylogger.py


示例15: checkjob_data_location

This mimics the result of Moab's checkjob command, but without the
risks of letting users see job information of jobs that are not theirs.
"""
import cPickle
import os
import pwd
import time

from vsc.utils import fancylogger
from vsc.utils.generaloption import simple_option

MAXIMAL_AGE = 60 * 30  # 30 minutes

logger = fancylogger.getLogger("myshowq")
fancylogger.logToScreen(True)
fancylogger.setLogLevelWarning()


def checkjob_data_location(user_name, location):
    """Retrieve the pickled data form the right file.

    @type user_name: string
    @type location: string

    @param user_name: VSC user name (vscxyzuv)
    @param location: string defining the location of the pickle file
        - home: user's home directory
        - scratch: user's personal fileset on muk

    @returns: absolute path to the pickle file
开发者ID:piojo,项目名称:vsc-jobs,代码行数:30,代码来源:mycheckjob.py


示例16: in

# -*- encoding: utf-8 -*-
import os
import sys

sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))

import test.asyncprocess as a
import test.dateandtime as td
import test.generaloption as tg
import test.fancylogger as tf
import test.missing as tm
import test.run as trun
import test.optcomplete as topt
import test.wrapper as wrapt
import unittest


from vsc.utils import fancylogger
fancylogger.logToScreen(enable=False)

suite = unittest.TestSuite([x.suite() for  x in (a, td, tg, tf, tm, trun, topt, wrapt)])

try:
    import xmlrunner
    rs = xmlrunner.XMLTestRunner(output="test-reports").run(suite)
except ImportError, err:
    rs = unittest.TextTestRunner().run(suite)

if not rs.wasSuccessful():
    sys.exit(1)
开发者ID:kwaegema,项目名称:vsc-base,代码行数:30,代码来源:runner.py


示例17: ExtOptionParser

from vsc.utils import fancylogger
from vsc.utils.generaloption import ExtOptionParser

# add all keys to the keyring for which the comment field has this entry in it
ADD_IF_COMMENT = "keyring"
DEFAULT_FILE = "../../ugenthpc/documents/keys.kdb"

# parse options
parser = ExtOptionParser(usage="testusage\n%s" % __doc__)
parser.add_option(
    "-f", "--file", dest="filename", help="use FILE as keepass database", metavar="FILE", default=DEFAULT_FILE
)
(options, args) = parser.parse_args()

# set up logging
fancylogger.logToScreen()
log = fancylogger.getLogger()
fancylogger.setLogLevelInfo()

log.info("using file %s", os.path.abspath(options.filename))

db = Database(options.filename, password=getpass.getpass("Please enter keepass file password: "))

try:
    for group in db.groups:
        for entry in group.entries:
            if ADD_IF_COMMENT in entry.notes:
                log.info("adding %s", entry.title)
                keyring.set_password(entry.title, entry.username, entry.password)
finally:
    db.close()
开发者ID:JensTimmerman,项目名称:vsc-passwords,代码行数:31,代码来源:add_keys_to_keyring.py


示例18: user

RELEASEJOB_LIMITS = {
    # jobs in hold per user (maximum of all users)
    'peruser_warning': 10,
    'peruser_critical': 20,
    # total number of jobs in hold
    'total_warning': 50,
    'total_critical': 100,
    # per job release attempts (maximum of all jobs)
    'release_warning': 50,
    'release_critical': 70,
}

RELEASEJOB_SUPPORTED_HOLDTYPES = ('BatchHold',)

_log = getLogger(__name__, fname=False)
logToScreen(True)
setLogLevelInfo()

def process_hold(clusters, dry_run=False):
    """Process a filtered queueinfo dict"""
    releasejob_cache = FileCache(RELEASEJOB_CACHE_FILE)

    # get the showq data
    for hosts, data in clusters.items():
        data['path'] = data['spath']  # showq path
    showq = Showq(clusters, cache_pickle=True)
    (queue_information, reported_hosts, failed_hosts) = showq.get_moab_command_information()

    # release the jobs, prepare the command
    m = MoabCommand(cache_pickle=False, dry_run=dry_run)
    for hosts, data in clusters.items():
开发者ID:hpcugent,项目名称:master-scripts,代码行数:31,代码来源:release_jobholds.py


示例19: main

def main(testing_data=(None, None, None)):
    """
    Main function:
    @arg options: a tuple: (options, paths, logger, logfile, hn) as defined in parse_options
    This function will:
    - read easyconfig
    - build software
    """

    # purposely session state very early, to avoid modules loaded by EasyBuild meddling in
    init_session_state = session_state()

    # disallow running EasyBuild as root
    if os.getuid() == 0:
        sys.stderr.write("ERROR: You seem to be running EasyBuild with root privileges.\n"
                         "That's not wise, so let's end this here.\n"
                         "Exiting.\n")
        sys.exit(1)

    # steer behavior when testing main
    testing = testing_data[0] is not None
    args, logfile, do_build = testing_data

    # initialise options
    eb_go = eboptions.parse_options(args=args)
    options = eb_go.options
    orig_paths = eb_go.args
    eb_config = eb_go.generate_cmd_line(add_default=True)
    init_session_state.update({'easybuild_configuration': eb_config})

    # set umask (as early as possible)
    if options.umask is not None:
        new_umask = int(options.umask, 8)
        old_umask = os.umask(new_umask)

    # set temporary directory to use
    eb_tmpdir = set_tmpdir(options.tmpdir)

    # initialise logging for main
    if options.logtostdout:
        fancylogger.logToScreen(enable=True, stdout=True)
    else:
        if logfile is None:
            # mkstemp returns (fd,filename), fd is from os.open, not regular open!
            fd, logfile = tempfile.mkstemp(suffix='.log', prefix='easybuild-')
            os.close(fd)

        fancylogger.logToFile(logfile)
        print_msg('temporary log file in case of crash %s' % (logfile), log=None, silent=testing)

    global _log
    _log = fancylogger.getLogger(fname=False)

    if options.umask is not None:
        _log.info("umask set to '%s' (used to be '%s')" % (oct(new_umask), oct(old_umask)))

    # hello world!
    _log.info(this_is_easybuild())

    # how was EB called?
    eb_command_line = eb_go.generate_cmd_line() + eb_go.args
    _log.info("Command line: %s" % (" ".join(eb_command_line)))

    _log.info("Using %s as temporary directory" % eb_tmpdir)

    if not options.robot is None:
        if options.robot:
            _log.info("Using robot path(s): %s" % options.robot)
        else:
            _log.error("No robot paths specified, and unable to determine easybuild-easyconfigs install path.")

    # do not pass options.robot, it's not a list instance (and it shouldn't be modified)
    robot_path = []
    if options.robot:
        robot_path = list(options.robot)

    # determine easybuild-easyconfigs package install path
    easyconfigs_paths = get_paths_for("easyconfigs", robot_path=robot_path)
    # keep track of paths for install easyconfigs, so we can obtain find specified easyconfigs
    easyconfigs_pkg_full_paths = easyconfigs_paths[:]
    if not easyconfigs_paths:
        _log.warning("Failed to determine install path for easybuild-easyconfigs package.")

    # process software build specifications (if any), i.e.
    # software name/version, toolchain name/version, extra patches, ...
    (try_to_generate, build_specs) = process_software_build_specs(options)

    # specified robot paths are preferred over installed easyconfig files
    # --try-X and --dep-graph both require --robot, so enable it with path of installed easyconfigs
    if robot_path or try_to_generate or options.dep_graph:
        robot_path.extend(easyconfigs_paths)
        easyconfigs_paths = robot_path[:]
        _log.info("Extended list of robot paths with paths for installed easyconfigs: %s" % robot_path)

    # prepend robot path with location where tweaked easyconfigs will be placed
    tweaked_ecs_path = None
    if try_to_generate and build_specs:
        tweaked_ecs_path = os.path.join(eb_tmpdir, 'tweaked_easyconfigs')
        robot_path.insert(0, tweaked_ecs_path)

#.........这里部分代码省略.........
开发者ID:ebgregory,项目名称:easybuild-framework,代码行数:101,代码来源:main.py


示例20: in

# -*- encoding: utf-8 -*-
import os
import sys

sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))

import test.managertests as m
import unittest



suite = unittest.TestSuite([x.suite() for x in (m,)])

try:
    import xmlrunner
    rs = xmlrunner.XMLTestRunner(output="test-reports").run(suite)
except ImportError, err:
    rs = unittest.TextTestRunner().run(suite)

if not rs.wasSuccessful():
    sys.exit(1)

if __name__ == '__main__':
    from vsc.utils import fancylogger
    fancylogger.logToScreen(enable=True)
开发者ID:stdweird,项目名称:vsc-manage,代码行数:25,代码来源:runner.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python fancylogger.setLogFormat函数代码示例发布时间:2022-05-26
下一篇:
Python fancylogger.logToFile函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap