Prints action icons for the badge.
550172
public function print_badge_table_actions($badge, $context) {
        $actions = "";

        if (has_capability('moodle/badges:configuredetails', $context) && $badge->has_criteria()) {
            // Activate/deactivate badge.
            if ($badge->status == BADGE_STATUS_INACTIVE || $badge->status == BADGE_STATUS_INACTIVE_LOCKED) {
                // "Activate" will go to another page and ask for confirmation.
                $url = new moodle_url('/badges/action.php');
                $url->param('id', $badge->id);
                $url->param('activate', true);
                $url->param('sesskey', sesskey());
                $return = new moodle_url(qualified_me());
                $url->param('return', $return->out_as_local_url(false));
                $actions .= $this->output->action_icon($url, new pix_icon('t/show', get_string('activate', 'badges'))) . " ";
            } else {
                $url = new moodle_url(qualified_me());
                $url->param('lock', $badge->id);
                $url->param('sesskey', sesskey());
                $actions .= $this->output->action_icon($url, new pix_icon('t/hide', get_string('deactivate', 'badges'))) . " ";
            }
        }

        // Award badge manually.
        if ($badge->has_manual_award_criteria() &&
                has_capability('moodle/badges:awardbadge', $context) &&
                $badge->is_active()) {
            $url = new moodle_url('/badges/award.php', array('id' => $badge->id));
            $actions .= $this->output->action_icon($url, new pix_icon('t/award', get_string('award', 'badges'))) . " ";
        }

        // Edit badge.
        if (has_capability('moodle/badges:configuredetails', $context)) {
            $url = new moodle_url('/badges/edit.php', array('id' => $badge->id, 'action' => 'details'));
            $actions .= $this->output->action_icon($url, new pix_icon('t/edit', get_string('edit'))) . " ";
        }

        // Duplicate badge.
        if (has_capability('moodle/badges:createbadge', $context)) {
            $url = new moodle_url('/badges/action.php', array('copy' => '1', 'id' => $badge->id, 'sesskey' => sesskey()));
            $actions .= $this->output->action_icon($url, new pix_icon('t/copy', get_string('copy'))) . " ";
        }

        // Delete badge.
        if (has_capability('moodle/badges:deletebadge', $context)) {
            $url = new moodle_url(qualified_me());
            $url->param('delete', $badge->id);
            $actions .= $this->output->action_icon($url, new pix_icon('t/delete', get_string('delete'))) . " ";
        }

        return $actions;
    }
549377
def labelForAction(self, action):
        
        for label in self.actionLabels():
            if label.action() == action:
                return label
        return None
264267
def _print_installed_apps(self, controller):
        
        print('\nInstalled Sprockets %s Apps\n' % controller.upper())
        print("{0:<25} {1:>25}".format('Name', 'Module'))
        print(string.ljust('', 51, '-'))
        for app in self._get_applications(controller):
            print('{0:<25} {1:>25}'.format(app.name, '(%s)' % app.module_name))
        print('')
254002
public function get_action_icons(stdClass $instance) {
        global $OUTPUT;

        $icons = array();
        if ($this->use_standard_editing_ui()) {
            $linkparams = array('courseid' => $instance->courseid, 'id' => $instance->id, 'type' => $instance->enrol);
            $editlink = new moodle_url("/enrol/editinstance.php", $linkparams);
            $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('t/edit', get_string('edit'), 'core',
                array('class' => 'iconsmall')));
        }
        return $icons;
    }
1043059
def draw_actions(self):
    """"""
    now = time.time()
    for act in self._past_actions:
      if act.pos and now < act.deadline:
        remain = (act.deadline - now) / (act.deadline - act.time)
        if isinstance(act.pos, point.Point):
          size = remain / 3
          self.all_surfs(_Surface.draw_circle, act.color, act.pos, size, 1)
        else:
          # Fade with alpha would be nice, but doesn't seem to work.
          self.all_surfs(_Surface.draw_rect, act.color, act.pos, 1)
826278
private static void printUsage() {
		FeatureTiles featureTiles = new DefaultFeatureTiles(null);
		System.out.println();
		System.out.println("USAGE");
		System.out.println();
		System.out
				.println("\t["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_MAX_FEATURES_PER_TILE
						+ " max_features_per_tile] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_COMPRESS_FORMAT
						+ " compress_format] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_COMPRESS_QUALITY
						+ " compress_quality] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_GOOGLE_TILES
						+ "] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_BOUNDING_BOX
						+ " minLon,minLat,maxLon,maxLat] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_EPSG
						+ " epsg] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_TILE_WIDTH
						+ " width] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_TILE_HEIGHT
						+ " height] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_TILE_SCALE
						+ " scale] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_POINT_RADIUS
						+ " radius] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_POINT_COLOR
						+ " color] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_POINT_ICON
						+ " image_file] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_ICON_WIDTH
						+ " width] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_ICON_HEIGHT
						+ " height] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_POINT_CENTER_ICON
						+ "] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_LINE_STROKE_WIDTH
						+ " stroke_width] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_LINE_COLOR
						+ " color] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_POLYGON_STROKE_WIDTH
						+ " stroke_width] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_POLYGON_COLOR
						+ " color] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_FILL_POLYGON
						+ "] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_POLYGON_FILL_COLOR
						+ " color] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_SIMPLIFY_GEOMETRIES
						+ " true|false] ["
						+ ARGUMENT_PREFIX
						+ ARGUMENT_IGNORE_GEOPACKAGE_STYLES
						+ " true|false] feature_geopackage_file feature_table tile_geopackage_file tile_table min_zoom max_zoom");
		System.out.println();
		System.out.println("DESCRIPTION");
		System.out.println();
		System.out
				.println("\tGenerates tiles from a GeoPackage feature table into a tile table");
		System.out.println();
		System.out.println("ARGUMENTS");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX
				+ ARGUMENT_MAX_FEATURES_PER_TILE + " max_features_per_tile");
		System.out
				.println("\t\tMax features to generate into a tile before generating a numbered feature count tile (default is "
						+ DEFAULT_MAX_FEATURES_PER_TILE
						+ ", use -1 for no max)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_COMPRESS_FORMAT
				+ " compress_format");
		System.out
				.println("\t\tTile compression image format: png, jpg, jpeg (default is no compression, native format)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_COMPRESS_QUALITY
				+ " compress_quality");
		System.out
				.println("\t\tTile compression image quality between 0.0 and 1.0 (not valid for png, default is 1.0)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_GOOGLE_TILES);
		System.out
				.println("\t\tGenerate tiles in Google tile format (default is GeoPackage format with minimum bounds)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_BOUNDING_BOX
				+ " minLon,minLat,maxLon,maxLat");
		System.out
				.println("\t\tOnly tiles overlapping the bounding box are requested (default is the world)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_EPSG + " epsg");
		System.out
				.println("\t\tEPSG number of the provided bounding box (default is 4326, WGS 84)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_TILE_WIDTH
				+ " width");
		System.out
				.println("\t\tWidth used when creating each tile (default is "
						+ featureTiles.getTileWidth() + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_TILE_HEIGHT
				+ " height");
		System.out
				.println("\t\tHeight used when creating each tile (default is "
						+ featureTiles.getTileHeight() + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_TILE_SCALE
				+ " scale");
		System.out
				.println("\t\tScale factor used when creating each tile (default is "
						+ featureTiles.getScale() + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_POINT_RADIUS
				+ " radius");
		System.out
				.println("\t\tFloating point circle radius used when drawing points (default is "
						+ featureTiles.getPointRadius() + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_POINT_COLOR
				+ " color");
		System.out
				.println("\t\tColor used when drawing points formatted as one of: [ name | r,g,b | r,g,b,a ] (default is "
						+ colorString(featureTiles.getPointColor()) + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_POINT_ICON
				+ " image_file");
		System.out
				.println("\t\tImage file containing image to use when drawing points in place of a drawn circle");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_ICON_WIDTH
				+ " width");
		System.out
				.println("\t\tPoint icon display width (default is actual icon width)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_ICON_HEIGHT
				+ " height");
		System.out
				.println("\t\tPoint icon display height (default is actual icon height)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_POINT_CENTER_ICON);
		System.out
				.println("\t\tDraw point icons by centering the icon image to the location (default is pinning to bottom center)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_LINE_STROKE_WIDTH
				+ " stroke_width");
		System.out
				.println("\t\tFloating point stroke width when drawing lines (default is "
						+ featureTiles.getLineStrokeWidth() + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_LINE_COLOR
				+ " color");
		System.out
				.println("\t\tColor used when drawing lines formatted as one of: [ name | r,g,b | r,g,b,a ] (default is "
						+ colorString(featureTiles.getLineColor()) + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX
				+ ARGUMENT_POLYGON_STROKE_WIDTH + " stroke_width");
		System.out
				.println("\t\tFloating point stroke width when drawing polygons (default is "
						+ featureTiles.getPolygonStrokeWidth() + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_POLYGON_COLOR
				+ " color");
		System.out
				.println("\t\tColor used when drawing polygons formatted as one of: [ name | r,g,b | r,g,b,a ] (default is "
						+ colorString(featureTiles.getPolygonColor()) + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_FILL_POLYGON);
		System.out.println("\t\tFill polygons with color (default is "
				+ featureTiles.isFillPolygon() + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX + ARGUMENT_POLYGON_FILL_COLOR
				+ " color");
		System.out
				.println("\t\tColor used when filling polygons formatted as one of: [ name | r,g,b | r,g,b,a ] (default is "
						+ colorString(featureTiles.getPolygonFillColor()) + ")");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX
				+ ARGUMENT_SIMPLIFY_GEOMETRIES + " true|false");
		System.out
				.println("\t\tFlag indicating whether geometries should be simplified with a similar curve with fewer points before drawn (default is true)");
		System.out.println();
		System.out.println("\t" + ARGUMENT_PREFIX
				+ ARGUMENT_IGNORE_GEOPACKAGE_STYLES + " true|false");
		System.out
				.println("\t\tFlag indicating whether styles saved within the GeoPackage should be ignored (default is false)");
		System.out.println();
		System.out.println("\tfeature_geopackage_file");
		System.out
				.println("\t\tpath to the GeoPackage file containing the feature table to generate tiles from");
		System.out.println();
		System.out.println("\tfeature_table");
		System.out
				.println("\t\tfeature table name within the GeoPackage file to generate tiles from");
		System.out.println();
		System.out.println("\ttile_geopackage_file");
		System.out
				.println("\t\tpath to the GeoPackage file to create with tiles, or existing file to update");
		System.out.println();
		System.out.println("\ttile_table");
		System.out
				.println("\t\ttile table name within the GeoPackage file to create or update");
		System.out.println();
		System.out.println("\tmin_zoom");
		System.out.println("\t\tMinimum zoom level to request tiles for");
		System.out.println();
		System.out.println("\tmax_zoom");
		System.out.println("\t\tMaximum zoom level to request tiles for");
		System.out.println();
	}
133023
def get_python_symbol_icons(oedata):
    """"""
    class_icon = ima.icon('class')
    method_icon = ima.icon('method')
    function_icon = ima.icon('function')
    private_icon = ima.icon('private1')
    super_private_icon = ima.icon('private2')

    symbols = process_python_symbol_data(oedata)

    # line - 1, name, fold level
    fold_levels = sorted(list(set([s[2] for s in symbols])))
    parents = [None]*len(symbols)
    icons = [None]*len(symbols)
    indexes = []

    parent = None
    for level in fold_levels:
        for index, item in enumerate(symbols):
            line, name, fold_level, token = item
            if index in indexes:
                continue

            if fold_level == level:
                indexes.append(index)
                parent = item
            else:
                parents[index] = parent

    for index, item in enumerate(symbols):
        parent = parents[index]

        if item[-1] == 'def':
            icons[index] = function_icon
        elif item[-1] == 'class':
            icons[index] = class_icon
        else:
            icons[index] = QIcon()

        if parent is not None:
            if parent[-1] == 'class':
                if item[-1] == 'def' and item[1].startswith('__'):
                    icons[index] = super_private_icon
                elif item[-1] == 'def' and item[1].startswith('_'):
                    icons[index] = private_icon
                else:
                    icons[index] = method_icon

    return icons
281291
private void enableActions() {
        restoreAction.setEnabled(frame.isMaximum() || frame.isIcon());
        maximizeAction.setEnabled((frame.isMaximizable() && !frame.isMaximum() && !frame.isIcon())
                                      || (frame.isMaximizable() && frame.isIcon()));
        iconifyAction.setEnabled(frame.isIconifiable() && !frame.isIcon());
        closeAction.setEnabled(frame.isClosable());
        sizeAction.setEnabled(false);
        moveAction.setEnabled(false);
    }
665854
function maybeCopyIcons(options, appPath, callback) {
  if (!options.icon) {
    callback();
    return;
  }

  if (options.platform === 'darwin' || options.platform === 'mas') {
    callback();
    return;
  }

  // windows & linux
  // put the icon file into the app
  const destIconPath = path.join(appPath, 'resources/app');
  const destFileName = `icon${path.extname(options.icon)}`;
  copy(options.icon, path.join(destIconPath, destFileName), (error) => {
    callback(error);
  });
}
251584
public function iconAction()
    {
        header('Content-Type: image/x-icon');
        // open our file
        $fp = fopen(__DIR__.'/../Resources/assets/favicon.ico', 'r');
        fpassthru($fp);
        fclose($fp);
        exit;
    }
634711
public function renderBadges()
    {
        $badges = $this->badges;
        if (!$badges) {
            return '';
        }
        $pm = $this->take('package')->getPackageManager();
        $res = '';
        foreach ($badges as $badge => $tpl) {
            if (!$tpl) {
                $tpl = $this->knownBadges[$badge];
            }
            if ($tpl === 'disabled') {
                continue;
            }
            $res .= $this->renderBadge($tpl) . "\n";
        }

        return $res ? "\n$res" : '';
    }
1367074
def _lookup_symbols(self, symbols_filename):
        """"""
        symbol_lookup = GenewaysSymbols(symbols_filename)
        for action in self.actions:
            action.up_symbol = symbol_lookup.id_to_symbol(action.up)
            action.dn_symbol = symbol_lookup.id_to_symbol(action.dn)
762588
def badge_label(self, badge):
        ''''''
        kind = badge.kind if isinstance(badge, Badge) else badge
        return self.__badges__[kind]
368495
def refreshUi(self):
        
        font = self.currentFont()
        
        for name in ('underline', 'bold', 'italic', 'strikeOut'):
            getter = getattr(font, name)
            act = self._actions[name]
            act.blockSignals(True)
            act.setChecked(getter())
            act.blockSignals(False)
332461
def actionLabels(self):
        
        l = self.layout()
        return [l.itemAt(i).widget() for i in range(1, l.count() - 1)]
324338
def get_badge_image_url(pid, ext='svg'):
    """"""
    return url_for('invenio_formatter_badges.badge',
                   title=pid.pid_type, value=pid.pid_value, ext=ext)
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()