Пример #1
0
 def _prefill_custom_data(self):
     caller_id = str(app.get_session_var("caller_id"))
     self['cd1'] = util.get_systype()
     self['cd2'] = "Python/%s %s" % (platform.python_version(),
                                     platform.platform())
     self['cd4'] = 1 if (not util.is_ci() and
                         (caller_id or not util.is_container())) else 0
     if caller_id:
         self['cd5'] = caller_id.lower()
Пример #2
0
def set_caller(caller=None):
    if not caller:
        if getenv("PLATFORMIO_CALLER"):
            caller = getenv("PLATFORMIO_CALLER")
        elif getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
            caller = "vscode"
        elif util.is_container():
            if getenv("C9_UID"):
                caller = "C9"
            elif getenv("USER") == "cabox":
                caller = "CA"
            elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
                caller = "Che"
    app.set_session_var("caller_id", caller)
Пример #3
0
def set_caller(caller=None):
    if not caller:
        if getenv("PLATFORMIO_CALLER"):
            caller = getenv("PLATFORMIO_CALLER")
        elif getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
            caller = "vscode"
        elif util.is_container():
            if getenv("C9_UID"):
                caller = "C9"
            elif getenv("USER") == "cabox":
                caller = "CA"
            elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
                caller = "Che"
    app.set_session_var("caller_id", caller)
Пример #4
0
def on_platformio_start(ctx, force, caller):
    if not caller:
        if getenv("PLATFORMIO_CALLER"):
            caller = getenv("PLATFORMIO_CALLER")
        elif util.is_container():
            if getenv("C9_UID"):
                caller = "C9"
            elif getenv("USER") == "cabox":
                caller = "CA"
            elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
                caller = "Che"

    app.set_session_var("command_ctx", ctx)
    app.set_session_var("force_option", force)
    app.set_session_var("caller_id", caller)
    telemetry.on_command()

    if not in_silence(ctx):
        after_upgrade(ctx)
Пример #5
0
def on_platformio_start(ctx, force, caller):
    if not caller:
        if getenv("PLATFORMIO_CALLER"):
            caller = getenv("PLATFORMIO_CALLER")
        elif util.is_container():
            if getenv("C9_UID"):
                caller = "C9"
            elif getenv("USER") == "cabox":
                caller = "CA"
            elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")):
                caller = "Che"

    app.set_session_var("command_ctx", ctx)
    app.set_session_var("force_option", force)
    app.set_session_var("caller_id", caller)
    telemetry.on_command()

    if ctx.args and (ctx.args[0] == "upgrade" or "update" in ctx.args):
        clean_cache()
    if not in_silence(ctx):
        after_upgrade(ctx)
Пример #6
0
    def _prefill_custom_data(self):
        def _filter_args(items):
            result = []
            stop = False
            for item in items:
                item = str(item).lower()
                result.append(item)
                if stop:
                    break
                if item == "account":
                    stop = True
            return result

        caller_id = str(app.get_session_var("caller_id"))
        self['cd1'] = util.get_systype()
        self['cd2'] = "Python/%s %s" % (platform.python_version(),
                                        platform.platform())
        # self['cd3'] = " ".join(_filter_args(sys.argv[1:]))
        self['cd4'] = 1 if (not util.is_ci() and
                            (caller_id or not util.is_container())) else 0
        if caller_id:
            self['cd5'] = caller_id.lower()
Пример #7
0
    def _prefill_custom_data(self):

        def _filter_args(items):
            result = []
            stop = False
            for item in items:
                item = str(item).lower()
                result.append(item)
                if stop:
                    break
                if item == "account":
                    stop = True
            return result

        caller_id = str(app.get_session_var("caller_id"))
        self['cd1'] = util.get_systype()
        self['cd2'] = "Python/%s %s" % (platform.python_version(),
                                        platform.platform())
        # self['cd3'] = " ".join(_filter_args(sys.argv[1:]))
        self['cd4'] = 1 if (not util.is_ci() and
                            (caller_id or not util.is_container())) else 0
        if caller_id:
            self['cd5'] = caller_id.lower()