示例#1
0
    def is_enabled(self):
        from dvc.config import Config, to_bool

        enabled = to_bool(
            Config(validate=False).get("core", {}).get("check_update", "true"))
        logger.debug(
            "Check for update is {}abled.".format("en" if enabled else "dis"))
        return enabled
示例#2
0
def is_enabled():
    if env2bool("DVC_TEST"):
        return False

    enabled = to_bool(
        Config(validate=False).get("core", {}).get("analytics", "true"))
    logger.debug("Analytics is {}abled.".format("en" if enabled else "dis"))

    return enabled
示例#3
0
文件: analytics.py 项目: woodshop/dvc
def is_enabled():
    if env2bool("DVC_TEST"):
        return False

    enabled = to_bool(
        Config(validate=False).config.get(Config.SECTION_CORE, {}).get(
            Config.SECTION_CORE_ANALYTICS, "true"))

    logger.debug("Analytics is {}abled.".format("en" if enabled else "dis"))

    return enabled
示例#4
0
def is_enabled():
    from dvc.config import Config, to_bool
    from dvc.utils import env2bool

    if env2bool("DVC_TEST"):
        return False

    enabled = not os.getenv(DVC_NO_ANALYTICS)
    if enabled:
        enabled = to_bool(
            Config(validate=False).get("core", {}).get("analytics", "true"))

    logger.debug("Analytics is {}abled.".format("en" if enabled else "dis"))

    return enabled
示例#5
0
    def is_enabled(cmd=None):
        from dvc.config import Config, to_bool
        from dvc.command.daemon import CmdDaemonBase

        if env2bool("DVC_TEST"):
            return False

        if isinstance(cmd, CmdDaemonBase):
            return False

        core = Config(validate=False).config.get(Config.SECTION_CORE, {})
        enabled = to_bool(core.get(Config.SECTION_CORE_ANALYTICS, "true"))
        logger.debug(
            "Analytics is {}.".format("enabled" if enabled else "disabled"))
        return enabled