set_channel: records progress from creating the tree
            Args: tree (ChannelManager): manager Ricecooker is using
            Returns: None
516849
def set_tree(self, tree):
        
        self.tree = tree
        self.__record_progress(Status.DOWNLOAD_FILES)
429673
def set_root_logger(root_log_level, log_path=None):
    
    handlers = []

    console_handler = logging.StreamHandler()
    handlers.append(console_handler)
    if log_path:
        file_handler = logging.FileHandler(log_path)
        handlers.append(file_handler)

    set_logging_config(root_log_level, handlers=handlers)
    root_logger = logging.getLogger("pypyr")
    root_logger.debug(
        f"Root logger {root_logger.name} configured with level "
        f"{root_log_level}")
103364
def set_channels(self, channels):
        
        for key in channels:
            self.set(key, channels[key])
364950
def set_uploaded(self, files_uploaded):
        
        self.files_uploaded = files_uploaded
        self.__record_progress(Status.UPLOAD_CHANNEL)
804630
def setActiveLevels(self, levels):
        
        self._activeLevels = levels
        tree = self.uiRecordTREE
        tree.setUpdatesEnabled(False)
        tree.blockSignals(True)
        
        for i in tree.topLevelItems():
            if levels and i.record().levelno not in levels:
                i.setHidden(True)
            else:
                i.setHidden(False)
        
        tree.blockSignals(False)
        tree.setUpdatesEnabled(True)
1158011
def _set_rabbitmq_channel(self, channel):
        
        setattr(self.application.attributes, self.CHANNEL, channel)
577945
def move_complete_channel(self):
        

        to_channel = Channel.objects.get(self.current.task_data['target_channel_key'])
        chosen_channels = self.current.task_data['chosen_channels']
        chosen_channels_names = self.current.task_data['chosen_channels_names']

        with BlockSave(Subscriber, query_dict={'channel_id': to_channel.key}):
            for s in Subscriber.objects.filter(channel_id__in=chosen_channels, typ=15):
                s.channel = to_channel
                s.save()

        with BlockDelete(Message):
            Message.objects.filter(channel_id__in=chosen_channels, typ=15).delete()

        with BlockDelete(Channel):
            Channel.objects.filter(key__in=chosen_channels).delete()

        self.current.task_data[
            'msg'] = _(u"Chosen channels(%s) have been merged to '%s' channel successfully.") % \
                     (', '.join(chosen_channels_names), to_channel.name)
1280813
public function editBlockConfiguration(Tree $tree, int $block_id): void
    {
        $title          = $this->getBlockSetting($block_id, 'title', '');
        $html           = $this->getBlockSetting($block_id, 'html', '');
        $show_timestamp = $this->getBlockSetting($block_id, 'show_timestamp', '0');
        $languages      = explode(',', $this->getBlockSetting($block_id, 'languages'));
        $all_trees      = Tree::getNameList();

        $templates = [
            $html                                    => I18N::translate('Custom'),
            view('modules/html/template-keywords')   => I18N::translate('Keyword examples'),
            view('modules/html/template-narrative')  => I18N::translate('Narrative description'),
            view('modules/html/template-statistics') => I18N::translate('Statistics'),
        ];

        echo view('modules/html/config', [
            'all_trees'      => $all_trees,
            'html'           => $html,
            'languages'      => $languages,
            'show_timestamp' => $show_timestamp,
            'templates'      => $templates,
            'title'          => $title,
        ]);
    }
972438
def set_header(self,header):
        
        self.header = header
        self.root.insert(0,header.get_node())
1180398
def set_header(self, port, channel):
        
        self._port = port
        self.channel = channel
        self._update_header()
1340124
def do_set_log_level(self, arg):
        
        if arg in ['i', 'v']:
            _LOGGING.info('Setting log level to %s', arg)
            if arg == 'i':
                _LOGGING.setLevel(logging.INFO)
                _INSTEONPLM_LOGGING.setLevel(logging.INFO)
            else:
                _LOGGING.setLevel(logging.DEBUG)
                _INSTEONPLM_LOGGING.setLevel(logging.DEBUG)
        else:
            _LOGGING.error('Log level value error.')
            self.do_help('set_log_level')
357233
def set_event(self, event):
        
        self._lock.acquire()
        try:
            self._event = event
            # Make sure the event starts in `set` state if we appear to already
            # be closed; otherwise, if we start in `clear` state & are closed,
            # nothing will ever call `.feed` and the event (& OS pipe, if we're
            # wrapping one - see `Channel.fileno`) will permanently stay in
            # `clear`, causing deadlock if e.g. `select`ed upon.
            if self._closed or len(self._buffer) > 0:
                event.set()
            else:
                event.clear()
        finally:
            self._lock.release()
511314
def set_process(self, process = None):
        
        if process is None:
            self.__process = None
        else:
            global Process      # delayed import
            if Process is None:
                from winappdbg.process import Process
            if not isinstance(process, Process):
                msg  = "Parent process must be a Process instance, "
                msg += "got %s instead" % type(process)
                raise TypeError(msg)
            self.__process = process
1193431
def set_level(self,
                  level,
                  console_only=False):
        
        self.queue.put(dill.dumps(SetLevelCommand(level=level,
                                                  console_only=console_only)))
427773
def print_tree(self, tree=None):
        
        if tree is None:
            self._print(self.root, '', '')
        else:
            self._print(tree, '', '')
265812
def update_parameters(self, treeWidget):
        

        if treeWidget == self.tree_settings:

            item = treeWidget.currentItem()



            instrument, path_to_instrument = item.get_instrument()

            # build nested dictionary to update instrument
            dictator = item.value
            for element in path_to_instrument:
                dictator = {element: dictator}

            # get old value from instrument
            old_value = instrument.settings
            path_to_instrument.reverse()
            for element in path_to_instrument:
                old_value = old_value[element]

            # send new value from tree to instrument
            instrument.update(dictator)

            new_value = item.value
            if new_value is not old_value:
                msg = "changed parameter {:s} from {:s} to {:s} on {:s}".format(item.name, str(old_value),
                                                                                str(new_value), instrument.name)
            else:
                msg = "did not change parameter {:s} on {:s}".format(item.name, instrument.name)

            self.log(msg)
        elif treeWidget == self.tree_scripts:

            item = treeWidget.currentItem()
            script, path_to_script, _ = item.get_script()

            # check if changes value is from an instrument
            instrument, path_to_instrument = item.get_instrument()
            if instrument is not None:

                new_value = item.value


                msg = "changed parameter {:s} to {:s} in {:s}".format(item.name,
                                                                                str(new_value),
                                                                                script.name)
            else:
                new_value = item.value
                msg = "changed parameter {:s} to {:s} in {:s}".format(item.name,
                                                                            str(new_value),
                                                                            script.name)
            self.log(msg)
241642
public function editBlockConfiguration(Tree $tree, int $block_id): void
    {
        $show_last_update     = $this->getBlockSetting($block_id, 'show_last_update', '1');
        $show_common_surnames = $this->getBlockSetting($block_id, 'show_common_surnames', '1');
        $number_of_surnames   = $this->getBlockSetting($block_id, 'number_of_surnames', self::DEFAULT_NUMBER_OF_SURNAMES);
        $stat_indi            = $this->getBlockSetting($block_id, 'stat_indi', '1');
        $stat_fam             = $this->getBlockSetting($block_id, 'stat_fam', '1');
        $stat_sour            = $this->getBlockSetting($block_id, 'stat_sour', '1');
        $stat_media           = $this->getBlockSetting($block_id, 'stat_media', '1');
        $stat_repo            = $this->getBlockSetting($block_id, 'stat_repo', '1');
        $stat_surname         = $this->getBlockSetting($block_id, 'stat_surname', '1');
        $stat_events          = $this->getBlockSetting($block_id, 'stat_events', '1');
        $stat_users           = $this->getBlockSetting($block_id, 'stat_users', '1');
        $stat_first_birth     = $this->getBlockSetting($block_id, 'stat_first_birth', '1');
        $stat_last_birth      = $this->getBlockSetting($block_id, 'stat_last_birth', '1');
        $stat_first_death     = $this->getBlockSetting($block_id, 'stat_first_death', '1');
        $stat_last_death      = $this->getBlockSetting($block_id, 'stat_last_death', '1');
        $stat_long_life       = $this->getBlockSetting($block_id, 'stat_long_life', '1');
        $stat_avg_life        = $this->getBlockSetting($block_id, 'stat_avg_life', '1');
        $stat_most_chil       = $this->getBlockSetting($block_id, 'stat_most_chil', '1');
        $stat_avg_chil        = $this->getBlockSetting($block_id, 'stat_avg_chil', '1');

        echo view('modules/gedcom_stats/config', [
            'show_last_update'     => $show_last_update,
            'show_common_surnames' => $show_common_surnames,
            'number_of_surnames'   => $number_of_surnames,
            'stat_indi'            => $stat_indi,
            'stat_fam'             => $stat_fam,
            'stat_sour'            => $stat_sour,
            'stat_media'           => $stat_media,
            'stat_repo'            => $stat_repo,
            'stat_surname'         => $stat_surname,
            'stat_events'          => $stat_events,
            'stat_users'           => $stat_users,
            'stat_first_birth'     => $stat_first_birth,
            'stat_last_birth'      => $stat_last_birth,
            'stat_first_death'     => $stat_first_death,
            'stat_last_death'      => $stat_last_death,
            'stat_long_life'       => $stat_long_life,
            'stat_avg_life'        => $stat_avg_life,
            'stat_most_chil'       => $stat_most_chil,
            'stat_avg_chil'        => $stat_avg_chil,
        ]);
    }