Displays the price rule overview page
435421
public function listPriceRule()
    {
        $this->actionListPriceRule();
        $this->setTitleListPriceRule();
        $this->setBreadcrumbListPriceRule();
        $this->setFilterListPriceRule();
        $this->setPagerListPriceRule();

        $this->setData('stores', $this->store->getList());
        $this->setData('price_rules', $this->getListPriceRule());

        $this->outputListPriceRule();
    }
1254320
def preview(self, limit=None, width=None):
        
        heading = self.heading
        rel = self.proj(*heading.non_blobs)
        if limit is None:
            limit = config['display.limit']
        if width is None:
            width = config['display.width']
        tuples = rel.fetch(limit=limit+1, format="array")
        has_more = len(tuples) > limit
        tuples = tuples[:limit]
        columns = heading.names
        widths = {f: min(max([len(f)] +
            [len(str(e)) for e in tuples[f]] if f in tuples.dtype.names else [len('=BLOB=')]) + 4, width) for f in columns}
        templates = {f: '%%-%d.%ds' % (widths[f], widths[f]) for f in columns}
        return (
            ' '.join([templates[f] % ('*' + f if f in rel.primary_key else f) for f in columns]) + '\n' +
            ' '.join(['+' + '-' * (widths[column] - 2) + '+' for column in columns]) + '\n' +
            '\n'.join(' '.join(templates[f] % (tup[f] if f in tup.dtype.names else '=BLOB=')
                for f in columns) for tup in tuples) +
            ('\n   ...\n' if has_more else '\n') +
            (' (Total: %d)\n' % len(rel) if config['display.show_tuple_count'] else ''))
138466
protected function setBreadcrumbEditPriceRule()
    {
        $breadcrumbs = array();

        $breadcrumbs[] = array(
            'url' => $this->url('admin'),
            'text' => $this->text('Dashboard')
        );

        $breadcrumbs[] = array(
            'text' => $this->text('Price rules'),
            'url' => $this->url('admin/sale/price')
        );

        $this->setBreadcrumbs($breadcrumbs);
    }
1023010
protected function submitEditPriceRule()
    {
        if ($this->isPosted('delete')) {
            $this->deletePriceRule();
        } else if ($this->isPosted('save') && $this->validateEditPriceRule()) {
            if (isset($this->data_rule['price_rule_id'])) {
                $this->updatePriceRule();
            } else {
                $this->addPriceRule();
            }
        }
    }
773821
public function display() {
        global $PAGE, $COURSE;

        $this->require_definition_after_data();

        $config = new stdClass;
        if ($this->uistage->get_ui() instanceof import_ui) {
            $config->title = get_string('confirmcancelimport', 'backup');
        } else if ($this->uistage->get_ui() instanceof restore_ui) {
            $config->title = get_string('confirmcancelrestore', 'backup');
        } else {
            $config->title = get_string('confirmcancel', 'backup');
        }
        $config->question = get_string('confirmcancelquestion', 'backup');
        $config->yesLabel = $config->title;
        $config->noLabel = get_string('confirmcancelno', 'backup');
        $config->closeButtonTitle = get_string('close', 'editor');
        $PAGE->requires->yui_module(
            'moodle-backup-confirmcancel',
            'M.core_backup.confirmcancel.watch_cancel_buttons',
            array($config)
        );

        // Get list of module types on course.
        $modinfo = get_fast_modinfo($COURSE);
        $modnames = $modinfo->get_used_module_names(true);
        $PAGE->requires->yui_module('moodle-backup-backupselectall', 'M.core_backup.backupselectall',
                array($modnames));
        $PAGE->requires->strings_for_js(array('select', 'all', 'none'), 'moodle');
        $PAGE->requires->strings_for_js(array('showtypes', 'hidetypes'), 'backup');

        parent::display();
    }
936345
public function display()
    {
        extract($this->args);

        $this->display_tablenav('top');

?>
<table class="wp-list-table <?php echo implode(' ', $this->get_table_classes()) ?>" cellspacing="0">
    <thead>
    <tr>
        <?php $this->print_column_headers(); ?>
    </tr>
    </thead>

    <tfoot>
    <tr>
        <?php $this->print_column_headers( false ); ?>
    </tr>
    </tfoot>

    <tbody id="the-list"<?php if ( $singular ) echo " data-wp-lists='list:$singular'"; ?>>
        <?php $this->display_rows_or_placeholder(); ?>
    </tbody>
</table>
<?php
        $this->display_tablenav('bottom');
    }
144129
public function display_header() {
        echo '<th class="header ' . $this->get_classes() . '" scope="col">';
        $sortable = $this->is_sortable();
        $name = get_class($this);
        $title = $this->get_title();
        $tip = $this->get_title_tip();
        if (is_array($sortable)) {
            if ($title) {
                echo '<div class="title">' . $title . '</div>';
            }
            $links = array();
            foreach ($sortable as $subsort => $details) {
                $links[] = $this->make_sort_link($name . '-' . $subsort,
                        $details['title'], isset($details['tip']) ? $details['tip'] : '', !empty($details['reverse']));
            }
            echo '<div class="sorters">' . implode(' / ', $links) . '</div>';
        } else if ($sortable) {
            echo $this->make_sort_link($name, $title, $tip);
        } else {
            if ($tip) {
                echo '<span title="' . $tip . '">';
            }
            echo $title;
            if ($tip) {
                echo '</span>';
            }
        }
        echo "</th>\n";
    }
1023752
def display_reports(self, layout):
        """"""
        try:
            score = self.linter.stats['global_note']
        except (AttributeError, KeyError):
            pass
        else:
            self.tc.message('buildStatisticValue', key='PyLintScore', value=str(score))
596806
def price_change(self):
        
        try:
            if self._data_from_search:
                return self._data_from_search.find('div', {'class': 'price-changes-sr'}).text
            else:
                return self._ad_page_content.find('div', {'class': 'price-changes-sr'}).text
        except Exception as e:
            if self._debug:
                logging.error(
                    "Error getting price_change. Error message: " + e.args[0])
            return
503935
def pricing width, height, pcb_layers, quantity = nil
      post_request "pricing", {width_in_mils: width, height_in_mils: height, pcb_layers: pcb_layers, quantity: quantity}
    end
587327
protected function addPriceRule()
    {
        if (!$this->isError()) {
            $id = $this->price_rule->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
1061611
public function display()
	{
		$ul_tag = new SwatHtmlTag('ul');
		$ul_tag->id = $this->id;
		$ul_tag->class = 'demo-menu-bar';

		$a_tag = new SwatHtmlTag('a');
		$span_tag = new SwatHtmlTag('span');
		$li_tag = new SwatHtmlTag('li');

		$ul_tag->open();

		foreach ($this->entries as $demo => $title) {
			$li_tag->class = ($this->selected_entry == $demo) ?
				'demo-menu-bar-selected' : null;

			$li_tag->open();

			if ($this->selected_entry == $demo) {
				$span_tag->setContent($title);
				$span_tag->display();
			} else {
				$a_tag->href = 'index.php?demo='.$demo;
				$a_tag->setContent($title);
				$a_tag->display();
			}

			$li_tag->close();
		}

		$ul_tag->close();
	}
99402
protected function submitAddPriceRule()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('price_rule');
        $this->addPriceRule();
    }
730898
protected function getListPriceRule()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return (array) $this->price_rule->getList($conditions);
    }
124979
public function formatDisplayRules()
    {
        $holderSelector = $this->getSelectorOnly();
        $result = [
            'targetFieldID' => $holderSelector,
            'conjunction'   => $this->DisplayRulesConjunctionNice(),
            'selectors'     => [],
            'events'        => [],
            'operations'    => [],
            'initialState'  => $this->ShowOnLoadNice(),
            'view'          => [],
            'opposite'      => [],
        ];

        // Check for field dependencies / default
        /** @var EditableCustomRule $rule */
        foreach ($this->EffectiveDisplayRules() as $rule) {
            // Get the field which is effected
            /** @var EditableFormField $formFieldWatch */
            $formFieldWatch = DataObject::get_by_id(EditableFormField::class, $rule->ConditionFieldID);
            // Skip deleted fields
            if (!$formFieldWatch) {
                continue;
            }

            $fieldToWatch = $formFieldWatch->getSelectorFieldOnly();

            $expression = $rule->buildExpression();
            if (!in_array($fieldToWatch, $result['selectors'])) {
                $result['selectors'][] = $fieldToWatch;
            }
            if (!in_array($expression['event'], $result['events'])) {
                $result['events'][] = $expression['event'];
            }
            $result['operations'][] = $expression['operation'];

            // View/Show should read
            $result['view'] = $rule->toggleDisplayText($result['initialState']);
            $result['opposite'] = $rule->toggleDisplayText($result['initialState'], true);
            $result['holder'] = $this->getSelectorHolder();
            $result['holder_event'] = $rule->toggleDisplayEvent($result['initialState']);
            $result['holder_event_opposite'] = $rule->toggleDisplayEvent($result['initialState'], true);
        }

        return (count($result['selectors'])) ? $result : null;
    }
825600
public function display()
    {
        $options = $this->getOptions();

        if (!$this->visible || count($options) === 0) {
            return;
        }

        parent::display();

        // outer div is required because the check-all widget is outside the
        // unordered list
        $div_tag = new SwatHtmlTag('div');
        $div_tag->id = $this->id;
        $div_tag->class = $this->getCSSClassString();
        $div_tag->open();

        $current_column = 1;
        $current_option = 0;
        $columns = is_array($this->columns)
            ? $this->columns
            : array(
                ceil(
                    count($options) / ($this->columns > 0 ? $this->columns : 1)
                )
            );

        $multiple_columns = count($options) > $columns[0];
        $maximum_options = array_shift($columns);

        $ul_tag = new SwatHtmlTag('ul');
        if ($multiple_columns) {
            $ul_tag->id = sprintf('%s_column_%s', $this->id, $current_column);
            $ul_tag->class = 'swat-checkbox-list-column';
        }
        $ul_tag->open();

        foreach ($options as $index => $option) {
            if ($current_option == $maximum_options) {
                $ul_tag->close();

                $current_column++;
                $current_option = 0;
                $maximum_options =
                    count($columns) > 0
                        ? array_shift($columns)
                        : $maximum_options;

                $ul_tag->id = sprintf(
                    '%s_column_%s',
                    $this->id,
                    $current_column
                );

                $ul_tag->class = 'swat-checkbox-list-column';

                $ul_tag->open();
            }

            $current_option++;
            $this->displayOption($option, $index);
        }

        $ul_tag->close();

        // Show clear div if columns are used
        if ($multiple_columns) {
            echo '<div class="swat-clear"></div>';
        }

        // Show the check all if more than one checkable item is displayed.
        $check_all = $this->getCompositeWidget('check_all');
        $check_all->visible = $this->show_check_all && count($options) > 1;
        $check_all->display();

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
526140
def display_db_info(self):
        """"""
        with self.open_book() as book:
            default_currency = book.default_currency
            print("Default currency is ", default_currency.mnemonic)