Exemple #1
0
    def _save_telemetry(self):
        # set telemetry configs
        # pyrevit telemetry
        telemetry.set_telemetry_utc_timestamp(
            self.telemetry_timestamp_cb.IsChecked)
        telemetry.set_telemetry_state(self.telemetry_cb.IsChecked)
        telemetry.set_telemetry_file_dir(self.telemetryfile_tb.Text)
        telemetry.set_telemetry_server_url(self.telemetryserver_tb.Text)
        telemetry.set_telemetry_include_hooks(
            self.telemetry_hooks_cb.IsChecked)
        # host app telemetry
        telemetry.set_apptelemetry_state(self.apptelemetry_cb.IsChecked)
        telemetry.set_apptelemetry_server_url(self.apptelemetryserver_tb.Text)

        event_flags = telemetry.get_apptelemetry_event_flags()
        for event_checkbox, event_type in zip(
                self._get_event_telemetry_checkboxes(),
                telemetry.get_apptelemetry_event_types()):
            if event_checkbox.IsChecked:
                event_flags = telemetry.set_apptelemetry_event_state(
                    event_flags, event_type)
            else:
                event_flags = telemetry.unset_apptelemetry_event_state(
                    event_flags, event_type)
        telemetry.set_apptelemetry_event_flags(event_flags)
        telemetry.setup_telemetry()
Exemple #2
0
def _perform_onsessionloadstart_ops():
    # clear the cached engines
    if not _clear_running_engines():
        mlogger.debug('No Engine Manager exists...')

    # check for updates
    if user_config.auto_update \
            and not _check_autoupdate_inprogress():
        mlogger.info('Auto-update is active. Attempting update...')
        _set_autoupdate_inprogress(True)
        updater.update_pyrevit()
        _set_autoupdate_inprogress(False)

    # once pre-load is complete, report environment conditions
    uuid_str = sessioninfo.new_session_uuid()
    sessioninfo.report_env()

    # reset the list of assemblies loaded under pyRevit session
    sessioninfo.set_loaded_pyrevit_assemblies([])

    # init executor
    runtime_types.ScriptExecutor.Initialize()

    # init routes
    routes.init()

    # asking telemetry module to setup the telemetry system
    # (active or not active)
    telemetry.setup_telemetry(uuid_str)

    # apply Upgrades
    upgrade.upgrade_existing_pyrevit()

    # setup hooks
    hooks.setup_hooks()