Add logo to the community.
337192
def addlogo(community_id, logo):
    """"""
    # Create the bucket
    c = Community.get(community_id)
    if not c:
        click.secho('Community {0} does not exist.'.format(community_id),
                    fg='red')
        return
    ext = save_and_validate_logo(logo, logo.name, c.id)
    c.logo_ext = ext
    db.session.commit()
870444
protected function addImageStyle()
    {
        if (!$this->isError()) {
            $id = $this->image_style->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
617003
def add(self, **kwargs):
        """"""
        if "path" in kwargs:
            path = kwargs["path"]
            if isinstance(path, bytes):
                path = String(path)
            if not path[0].startswith("/"):
                paths = self.normalize_paths(self.path, path)
            else:
                paths = self.normalize_paths(path)
            kwargs["path"] = "/".join(paths)
        return self.create(self, **kwargs)
1005404
def add_label(self, name, addr):
        

        # set the label
        self._symbolization_needed = True

        self.symbol_manager.new_label(addr, name=name, force=True)
1029504
public function add()
    {
        $group = $this->Groups->newEntity();
        if ($this->request->is('post')) {
            $group  = $this->Groups->patchEntity($group, $this->request->getData());
            $result = $this->Groups->save($group);
            if ($result) {
                $this->Flash->success(__d('community', 'The group has been saved.'));
                return $this->App->redirect([
                    'apply' => ['action' => 'edit', $result->id],
                ]);
            } else {
                $this->Flash->error(__d('community', 'The group could not be saved. Please, try again.'));
            }
        }

        $parents = $this->Groups->getTreeList();
        $this->set(compact('group', 'parents'));
        $this->set('page_title', __d('community', 'Add new group'));
    }
257226
public function apply()
    {
        if (!($this->config->hasKey(self::HEIGHT) && $this->config->hasKey(self::WIDTH))) {
            return;
        }

        add_theme_support('custom-logo', [
            'height'      => $this->config->getKey(self::HEIGHT),
            'width'       => $this->config->getKey(self::WIDTH),
            'flex-height' => $this->config->hasKey(self::FLEX_HEIGHT) ? $this->config->getKey(self::FLEX_HEIGHT) : true,
            'flex-width'  => $this->config->hasKey(self::FLEX_WIDTH) ? $this->config->getKey(self::FLEX_WIDTH) : true,
        ]);

        add_filter('genesis_seo_title', [$this, 'inlineLogoMarkup'], 10, 3);

        if (false === $this->config->getKey(self::SITE_DESCRIPTION)) {
            add_filter('genesis_attr_site-description', [$this, 'hideSiteDescription']);
        }
    }
1169386
protected function copyright()
    {
        // LOGO
        $this->comment("   __                           _   __                   ");
        $this->comment("  / /  __ _ _ __ __ ___   _____| | / /  __ _ _ __   __ _ ");
        $this->comment(" / /  / _` | '__/ _` \ \ / / _ \ |/ /  / _` | '_ \ / _` |");
        $this->comment("/ /__| (_| | | | (_| |\ V /  __/ / /__| (_| | | | | (_| |");
        $this->comment("\____/\__,_|_|  \__,_| \_/ \___|_\____/\__,_|_| |_|\__, |");
        $this->comment("                                                   |___/ ");
        $this->line('');

        // Copyright
        $this->comment('Version '.LaravelLang::VERSION.' - Created by ARCANEDEV'.chr(169));
        $this->line('');
    }
217681
def edit(community):
    """"""
    form = EditCommunityForm(formdata=request.values, obj=community)
    deleteform = DeleteCommunityForm()
    ctx = mycommunities_ctx()
    ctx.update({
        'form': form,
        'is_new': False,
        'community': community,
        'deleteform': deleteform,
    })

    if form.validate_on_submit():
        for field, val in form.data.items():
            setattr(community, field, val)

        file = request.files.get('logo', None)
        if file:
            if not community.save_logo(file.stream, file.filename):
                form.logo.errors.append(_(
                    'Cannot add this file as a logo. Supported formats: '
                    'PNG, JPG and SVG. Max file size: 1.5 MB.'))

        if not form.logo.errors:
            db.session.commit()
            flash("Community successfully edited.", category='success')
            return redirect(url_for('.edit', community_id=community.id))

    return render_template(
        current_app.config['COMMUNITIES_EDIT_TEMPLATE'],
        **ctx
    )
231350
public function makeAdd(){		
		if(OWEB_DEBUG > 0)
			$code .= $this->makeAddNormal ();
		else
			$code .= $this->makeAddNormal ();
		
		Headers::getInstance()->addHeader($code, Headers::jsCode);
	}
67261
def addthisbunch(bunchdt, data, commdct, thisbunch, theidf):
    """"""
    key = thisbunch.key.upper()
    obj = copy.copy(thisbunch.obj)
    abunch = obj2bunch(data, commdct, obj)
    bunchdt[key].append(abunch)
    return abunch
170371
def get_logo_url(self, obj):
        """"""
        if current_app and obj.logo_url:
            return u'{site_url}{path}'.format(
                site_url=current_app.config.get('THEME_SITEURL'),
                path=obj.logo_url,
            )
737731
def main():
    """"""
    mod_choices = ('banned', 'contributor', 'moderator')
    mod_choices_dsp = ', '.join(['`{}`'.format(x) for x in mod_choices])
    msg = {
        'add': ('Add users to one of the following categories: {}'
                .format(mod_choices_dsp)),
        'clear': 'Remove users who have no flair set.',
        'css': 'Ignore the CSS field when synchronizing flair.',
        'edit': 'When adding flair templates, mark them as editable.',
        'file': 'The file containing contents for --message',
        'flair': 'List flair for the subreddit.',
        'flair_stats': 'Display the number of users with each flair.',
        'json': 'Output the results as json. Applies to --flair',
        'limit': ('The minimum number of users that must have the specified '
                  'flair in order to add as a template. default: %default'),
        'list': ('List the users in one of the following categories: '
                 '{}. May be specified more than once.'
                 .format(mod_choices_dsp)),
        'msg': ('Send message to users of one of the following categories: '
                '{}. Message subject provided via --subject, content provided '
                'via --file or STDIN.').format(mod_choices_dsp),
        'sort': ('The order to add flair templates. Available options are '
                 '`alpha` to add alphabetically, and `size` to first add '
                 'flair that is shared by the most number of users. '
                 'default: %default'),
        'static': ('Add this template when syncing flair templates. When '
                   'syncing text and css use a comma to separate the two.'),
        'subject': 'The subject of the message to send for --message.',
        'sync': 'Synchronize flair templates with current user flair.',
        'text': 'Ignore the text field when synchronizing flair.'}

    usage = 'Usage: %prog [options] SUBREDDIT'
    parser = arg_parser(usage=usage)
    parser.add_option('-a', '--add', help=msg['add'])
    parser.add_option('-l', '--list', action='append', help=msg['list'],
                      choices=mod_choices, metavar='CATEGORY', default=[])
    parser.add_option('-c', '--clear-empty', action='store_true',
                      help=msg['clear'])
    parser.add_option('-F', '--file', help=msg['file'])
    parser.add_option('-f', '--flair', action='store_true', help=msg['flair'])
    parser.add_option('', '--flair-stats', action='store_true',
                      help=msg['flair_stats'])
    parser.add_option('-m', '--message', choices=mod_choices, help=msg['msg'])
    parser.add_option('', '--subject', help=msg['subject'])

    group = OptionGroup(parser, 'Format options')
    group.add_option('-j', '--json', action='store_true', help=msg['json'])
    parser.add_option_group(group)

    group = OptionGroup(parser, 'Sync options')
    group.add_option('', '--sync', action='store_true', help=msg['sync'])
    group.add_option('-s', '--static', action='append', help=msg['static'])
    group.add_option('', '--editable', action='store_true', help=msg['edit'])
    group.add_option('', '--ignore-css', action='store_true',
                     default=False, help=msg['css'])
    group.add_option('', '--ignore-text', action='store_true',
                     default=False, help=msg['text'])
    group.add_option('', '--limit', type='int', help=msg['limit'], default=2)
    group.add_option('', '--sort', action='store', choices=('alpha', 'size'),
                     default='alpha', help=msg['sort'])
    parser.add_option_group(group)

    options, args = parser.parse_args()
    if len(args) == 0:
        parser.error('Must provide subreddit name.')
    if options.message and not options.subject:
        parser.error('Must provide --subject when providing --message.')
    subreddit = args[0]

    check_for_updates(options)

    modutils = ModUtils(subreddit, options.site, options.verbose)

    if options.add:
        modutils.add_users(options.add)
    if options.clear_empty:
        modutils.clear_empty()
    for category in options.list:
        modutils.output_list(category)
    if options.flair:
        modutils.output_current_flair(as_json=options.json)
    if options.flair_stats:
        modutils.output_flair_stats()
    if options.sync:
        modutils.flair_template_sync(editable=options.editable,
                                     limit=options.limit,
                                     static=options.static, sort=options.sort,
                                     use_css=not options.ignore_css,
                                     use_text=not options.ignore_text)
    if options.message:
        modutils.message(options.message, options.subject, options.file)
159192
public function addOwners()
    {
        foreach ($this->attributes as $attr) {
            if ($mediafile = $this->loadModel($this->owner->$attr)) {
                $mediafile->addOwner($this->owner->primaryKey, $this->name, $attr);
            }
        }
    }
917350
def update_logo_preview(self):
        """"""
        logo_path = self.organisation_logo_path_line_edit.text()
        if os.path.exists(logo_path):
            icon = QPixmap(logo_path)
            label_size = self.organisation_logo_label.size()
            label_size.setHeight(label_size.height() - 2)
            label_size.setWidth(label_size.width() - 2)
            scaled_icon = icon.scaled(
                label_size, Qt.KeepAspectRatio)
            self.organisation_logo_label.setPixmap(scaled_icon)
        else:
            self.organisation_logo_label.setText(tr("Logo not found"))
82977
def add_label(self):
        """"""
        txt = _('Autosave files found. What would you like to do?\n\n'
                'This dialog will be shown again on next startup if any '
                'autosave files are not restored, moved or deleted.')
        label = QLabel(txt, self)
        label.setWordWrap(True)
        self.layout.addWidget(label)
983802
def create_add_on(self, add_on):
        """"""
        url = urljoin(self._url, '/add_ons')
        return add_on.post(url)
417802
public function build()
    {
        // first step is to set the icon name itself
        $this->css[] = 'fa-' . $this->icon;

        if (isset($this->on)) {
            $stack = $this->factory->create('Elements\Span');
            $stack->addCss('fa fa-stack');
            $this->addCss('fa-stack-1x');

            // Create the on icon
            $on = $this->factory->create('Fontawesome\Icon');
            $on->useIcon($this->on);
            $on->addCss([
                'fa-stack-2x',
                'icon_bg'
            ]);
            $icon_1 = $on->build();
        }

        // size set for icon?
        if (isset($this->size)) {

            if (isset($stack)) {
                $stack->addCss('fa-' . $this->size);
            }
            else {
                $this->addCss('fa-' . $this->size);
            }
        }

        // any floating wanted?
        if (isset($this->pull)) {

            if (isset($stack)) {
                $stack->addCss('fa-pull-' . $this->pull);
            }
            else {
                $this->addCss('fa-pull-' . $this->pull);
            }
        }

        // draw border?
        if ($this->border && !isset($stack)) {
            $this->css[] = 'fa-border';
        }

        // is muted?
        if ($this->muted) {

            if (isset($stack)) {
                $stack->addCss('fa-muted');
            }
            else {
                $this->css[] = 'fa-muted';
            }
        }

        // flip icon?
        if (isset($this->flip)) {

            if (isset($stack)) {
                $stack->addCss('fa-flip-' . $this->flip);
            }
            else {
                $this->css[] = 'fa-flip-' . $this->flip;
            }
        }

        // rotate icon?
        if (isset($this->rotation)) {
            if (isset($stack)) {
                $stack->addCss('fa-rotate-' . $this->rotation);
            }
            else {
                $this->css[] = 'fa-rotate-' . $this->rotation;
            }
        }

        // spin icon?
        if ($this->spin) {
            if (isset($stack)) {
                $stack->addCss('fa-spin');
            }
            else {
                $this->css[] = 'fa-spin';
            }
        }

        $icon_2 = parent::build();

        if (isset($stack)) {
            $stack->setInner($icon_1 . PHP_EOL . $icon_2);
            $html = $stack->build();
        }
        else {
            $html = $icon_2;
        }

        return $html;
    }