Prints tabs for badge editing.
541606
public function print_badge_tabs($badgeid, $context, $current = 'overview') {
        global $DB;

        $badge = new badge($badgeid);
        $row = array();

        $row[] = new tabobject('overview',
                    new moodle_url('/badges/overview.php', array('id' => $badgeid)),
                    get_string('boverview', 'badges')
                );

        if (has_capability('moodle/badges:configuredetails', $context)) {
            $row[] = new tabobject('details',
                        new moodle_url('/badges/edit.php', array('id' => $badgeid, 'action' => 'details')),
                        get_string('bdetails', 'badges')
                    );
        }

        if (has_capability('moodle/badges:configurecriteria', $context)) {
            $row[] = new tabobject('criteria',
                        new moodle_url('/badges/criteria.php', array('id' => $badgeid)),
                        get_string('bcriteria', 'badges')
                    );
        }

        if (has_capability('moodle/badges:configuremessages', $context)) {
            $row[] = new tabobject('message',
                        new moodle_url('/badges/edit.php', array('id' => $badgeid, 'action' => 'message')),
                        get_string('bmessage', 'badges')
                    );
        }

        if (has_capability('moodle/badges:viewawarded', $context)) {
            $awarded = $DB->count_records_sql('SELECT COUNT(b.userid)
                                               FROM {badge_issued} b INNER JOIN {user} u ON b.userid = u.id
                                               WHERE b.badgeid = :badgeid AND u.deleted = 0', array('badgeid' => $badgeid));
            $row[] = new tabobject('awards',
                        new moodle_url('/badges/recipients.php', array('id' => $badgeid)),
                        get_string('bawards', 'badges', $awarded)
                    );
        }

        if (has_capability('moodle/badges:configuredetails', $context)) {
            $row[] = new tabobject('bendorsement',
                new moodle_url('/badges/endorsement.php', array('id' => $badgeid)),
                get_string('bendorsement', 'badges')
            );
        }

        if (has_capability('moodle/badges:configuredetails', $context)) {
            $sql = "SELECT COUNT(br.badgeid)
                      FROM {badge_related} br
                     WHERE (br.badgeid = :badgeid OR br.relatedbadgeid = :badgeid2)";
            $related = $DB->count_records_sql($sql, ['badgeid' => $badgeid, 'badgeid2' => $badgeid]);
            $row[] = new tabobject('brelated',
                new moodle_url('/badges/related.php', array('id' => $badgeid)),
                get_string('brelated', 'badges', $related)
            );
        }

        if (has_capability('moodle/badges:configuredetails', $context)) {
            $alignments = $DB->count_records_sql("SELECT COUNT(bc.id)
                      FROM {badge_alignment} bc WHERE bc.badgeid = :badgeid", array('badgeid' => $badgeid));
            $row[] = new tabobject('balignment',
                new moodle_url('/badges/alignment.php', array('id' => $badgeid)),
                get_string('balignment', 'badges', $alignments)
            );
        }

        echo $this->tabtree($row, $current);
    }
867075
protected function print_badge_alignments(badge $badge) {
        $output = '';
        $output .= $this->heading(get_string('alignment', 'badges'), 3);
        $alignments = $badge->get_alignments();
        if (!empty($alignments)) {
            $items = array();
            foreach ($alignments as $alignment) {
                $urlaligment = new moodle_url('alignment.php',
                    array('id' => $badge->id, 'alignmentid' => $alignment->id)
                );
                $items[] = html_writer::link($urlaligment, $alignment->targetname, array('target' => '_blank'));
            }
            $output .= html_writer::alist($items, array(), 'ul');
        } else {
            $output .= get_string('noalignment', 'badges');
        }
        return $output;
    }
117957
protected void doPrint() {

        PrintablePage pageInView = previewPane.getPrintablePage();
        PrintablePage pageToPrint = new PrintablePage();

        try {
            pageInView.bindPage(pageToPrint);

            Printer printer = Printer.getDefaultPrinter();

            if (printer == null || settingsView.getPaperView()
                    .getAvailablePapers().isEmpty()) {
                // Show an Error
                Alert alert = new Alert(AlertType.INFORMATION);
                alert.initOwner(dialog);
                alert.setTitle(Messages
                        .getString("DateControl.TITLE_CALENDAR_PROBLEM"));
                alert.setHeaderText(
                        Messages.getString("PrintView.NO_PRINTERS"));
                alert.setContentText(
                        Messages.getString("PrintView.ERROR_NO_PRINTER"));
                alert.show();
                return;
            }

            hide();
            LoggingDomain.PRINTING.fine("printer = " + printer);

            PageLayout layout = null;

            final Paper paper = pageInView.getPaper();
            final PageOrientation pageOrientation = pageInView.getViewType()
                    .getPageOrientation();
            final PaperView.MarginType marginType = pageInView.getMarginType();

            LoggingDomain.PRINTING.fine("paper = " + paper);
            LoggingDomain.PRINTING.fine("pageOrientation = " + pageOrientation);
            LoggingDomain.PRINTING.fine("marginType = " + marginType);
            LoggingDomain.PRINTING
                    .fine("custom margins = left: " + pageInView.getLeftMargin()
                            + ", right: " + pageInView.getRightMargin()
                            + ", top: " + pageInView.getTopMargin()
                            + ", bottom: " + pageInView.getBottomMargin());

            switch (marginType) {
            case DEFAULT:
                layout = printer.createPageLayout(paper, pageOrientation,
                        Printer.MarginType.DEFAULT);
                break;
            case MINIMUM:
                layout = printer.createPageLayout(paper, pageOrientation,
                        Printer.MarginType.HARDWARE_MINIMUM);
                break;
            case CUSTOM:
                layout = printer.createPageLayout(paper, pageOrientation,
                        pageInView.getLeftMargin(), pageInView.getRightMargin(),
                        pageInView.getTopMargin(),
                        pageInView.getBottomMargin());
                break;
            }

            // sizes of print page and physical page
            double pageWidth = pageToPrint.prefWidth(-1);
            double pageHeight = pageToPrint.prefHeight(-1);

            double printableWidth = layout.getPrintableWidth();
            double printableHeight = layout.getPrintableHeight();

            // scaling
            double scaleX = printableWidth / pageWidth;
            double scaleY = printableHeight / pageHeight;
            double scale = Math.min(scaleX, scaleY);

            LoggingDomain.PRINTING.fine("pageWidth / pageHeight = " + pageWidth
                    + " / " + pageHeight);
            LoggingDomain.PRINTING.fine("printableWidth / printableHeight = "
                    + printableWidth + " / " + printableHeight);
            LoggingDomain.PRINTING
                    .fine("scaleX / scaleY = " + scaleX + " / " + scaleY);
            LoggingDomain.PRINTING.fine("scale = " + scale);

            pageToPrint.applyCss();
            pageToPrint.layout();
            pageToPrint.getTransforms().add(new Scale(scale, scale));

            // transformation = center
            final double translateX = (printableWidth - (pageWidth * scale))
                    / 2;
            final double translateY = (printableHeight - (pageHeight * scale))
                    / 2;

            LoggingDomain.PRINTING.fine("translateX / translateY = "
                    + translateX + " / " + translateY);

            pageToPrint.setTranslateX(translateX);
            pageToPrint.setTranslateY(translateY);

            PrinterJob job = PrinterJob.createPrinterJob(printer);
            JobSettings settings = job.getJobSettings();
            settings.setJobName(Messages.getString("PrintView.TITLE_LABEL"));
            settings.setPageLayout(layout);

            if (job.showPrintDialog(getScene().getWindow())) {
                do {
                    boolean success = job.printPage(pageToPrint);
                    if (!success) {
                        break;
                    }
                } while (pageToPrint.next());

                job.endJob();
            }
        } finally {
            pageInView.unbindPage(pageToPrint);
        }
    }
1199572
def write_badge(self, file_path, overwrite=False):
        """"""

        # Validate path (part 1)
        if file_path.endswith('/'):
            raise Exception('File location may not be a directory.')

        # Get absolute filepath
        path = os.path.abspath(file_path)
        if not path.lower().endswith('.svg'):
            path += '.svg'

        # Validate path (part 2)
        if not overwrite and os.path.exists(path):
            raise Exception('File "{}" already exists.'.format(path))

        with open(path, mode='w') as file_handle:
            file_handle.write(self.badge_svg_text)
247481
def _print_dot(targets, components, tasks):
    
    print("Warning: dot option is deprecated.  Use graph instead.", file=sys.stderr)
    _print_graph(targets, components, tasks)
577329
def attach(self, events):
        

        if events is not None:
            events.add_event_listener("print", self._print)
            events.add_event_listener("backspace", self._backspace)
            events.add_event_listener("tab", self._tab)
            events.add_event_listener("linefeed", self._linefeed)
            events.add_event_listener("reverse-linefeed", 
                                      self._reverse_linefeed)
            events.add_event_listener("carriage-return", self._carriage_return)
            events.add_event_listener("index", self._index)
            events.add_event_listener("reverse-index", self._reverse_index)
            events.add_event_listener("store-cursor", self._save_cursor)
            events.add_event_listener("restore-cursor", self._restore_cursor)
            events.add_event_listener("cursor-up", self._cursor_up)
            events.add_event_listener("cursor-down", self._cursor_down)
            events.add_event_listener("cursor-right", self._cursor_forward)
            events.add_event_listener("cursor-left", self._cursor_back)
            events.add_event_listener("cursor-move", self._cursor_position)
            events.add_event_listener("erase-in-line", self._erase_in_line)
            events.add_event_listener("erase-in-display", 
                                      self._erase_in_display)
            events.add_event_listener("delete-characters", 
                                      self._delete_character)
            events.add_event_listener("insert-lines", self._insert_line)
            events.add_event_listener("delete-lines", self._delete_line)
            events.add_event_listener("select-graphic-rendition",
                                      self._select_graphic_rendition)
            events.add_event_listener("charset-g0", self._charset_g0)
            events.add_event_listener("charset-g1", self._charset_g1)
            events.add_event_listener("shift-in", self._shift_in)
            events.add_event_listener("shift-out", self._shift_out)
            events.add_event_listener("bell", self._bell)
143112
def _update_id_list(self):
        """"""
        self.id_list = [id(self.editor.tabs.widget(_i))
                        for _i in range(self.editor.tabs.count())]
38000
def print_usage(actions):
    """"""
    actions = actions.items()
    actions.sort()
    print('usage: %s <action> [<options>]' % basename(sys.argv[0]))
    print('       %s --help' % basename(sys.argv[0]))
    print()
    print('actions:')
    for name, (func, doc, arguments) in actions:
        print('  %s:' % name)
        for line in doc.splitlines():
            print('    %s' % line)
        if arguments:
            print()
        for arg, shortcut, default, argtype in arguments:
            if isinstance(default, bool):
                print('    %s' % (
                    (shortcut and '-%s, ' % shortcut or '') + '--' + arg
                ))
            else:
                print('    %-30s%-10s%s' % (
                    (shortcut and '-%s, ' % shortcut or '') + '--' + arg,
                    argtype, default
                ))
        print()
75870
public void traverseAndPrint(final String tabs) {
		logger.info(tabs + toString());
		final int len = this.subEntries.size();
		for (int i = 0; i < len; i++) {
			final MagicMimeEntry me = this.subEntries.get(i);
			me.traverseAndPrint(tabs + "\t");
		}
	}
29574
public function print_header_and_tabs($cm, $course, $quiz, $reportmode = 'overview') {
        global $PAGE, $OUTPUT;

        // Print the page header.
        $PAGE->set_title($quiz->name);
        $PAGE->set_heading($course->fullname);
        echo $OUTPUT->header();
        $context = context_module::instance($cm->id);
        echo $OUTPUT->heading(format_string($quiz->name, true, array('context' => $context)));
    }
856494
def show_notes(self):
        
        if self.notes:
            bytecode._PrintSubBanner("Notes")
            for i in self.notes:
                bytecode._PrintNote(i)
            bytecode._PrintSubBanner()
766888
def OnPrint(self, event):
        """"""

        print_area = self._get_print_area()
        print_data = self.main_window.print_data

        self.main_window.actions.printout(print_area, print_data)
1035233
def print(self, indent=0):
        """"""
        text = (
            '{indent}{magenta}{name}{none} ({dim}{cls}{none}, '
            'default {dim}{default}{none})'
        ).format(
            indent=' ' * indent,
            dim=Style.DIM,
            magenta=Fore.MAGENTA,
            none=Style.RESET_ALL,
            name=self.name,
            cls=self.cls,
            default=self.default
        )

        if self.description:
            text += ':\n' + pretty_description(self.description,
                                               indent=indent + 2)

        print(text)
590917
def report(self):
        """"""
        from pprint import pprint
        print "s2n"
        pprint(self.symbol2number)
        print "n2s"
        pprint(self.number2symbol)
        print "states"
        pprint(self.states)
        print "dfas"
        pprint(self.dfas)
        print "labels"
        pprint(self.labels)
        print "start", self.start
617641
def print_entitlements(opts, data, page_info=None, show_list_info=True):
    """"""
    if utils.maybe_print_as_json(opts, data, page_info):
        return

    headers = ["Name", "Token", "Created / Updated", "Identifier"]

    rows = []
    for entitlement in sorted(data, key=itemgetter("name")):
        rows.append(
            [
                click.style(
                    "%(name)s (%(type)s)"
                    % {
                        "name": click.style(entitlement["name"], fg="cyan"),
                        "type": "user" if entitlement["user"] else "token",
                    }
                ),
                click.style(entitlement["token"], fg="yellow"),
                click.style(entitlement["updated_at"], fg="blue"),
                click.style(entitlement["slug_perm"], fg="green"),
            ]
        )

    if data:
        click.echo()
        utils.pretty_print_table(headers, rows)

    if not show_list_info:
        return

    click.echo()

    num_results = len(data)
    list_suffix = "entitlement%s" % ("s" if num_results != 1 else "")
    utils.pretty_print_list_info(num_results=num_results, suffix=list_suffix)
666278
def print_ac(self):
        ""
        print("digraph g{")
        def print_node(node):
            for subnode_key in node.transition_table.keys():
                subnode = node.transition_table[subnode_key]
                print("%d -> %d [label=%s] //%s" %
                      (node.id, subnode.id, type_repr(subnode_key), str(subnode.fixers)))
                if subnode_key == 1:
                    print(subnode.content)
                print_node(subnode)
        print_node(self.root)
        print("}")
899182
def p_print_list_tab(p):
    
    p[0] = make_sentence('PRINT_TAB',
                         make_typecast(TYPE.ubyte, p[2], p.lineno(1)))