コード例 #1
0
ファイル: views.py プロジェクト: sannorozco/metapolator
    def GET(self, name, glyphid):
        if not is_loggedin():
            raise seeother('/login')

        master = models.Master.get(fontname=name)
        if not master:
            return web.notfound()

        localparameters = models.LocalParam.all()
        globalparams = models.GlobalParam.all()

        globalparamform = GlobalParamForm()

        globalparam = models.GlobalParam.get(idglobal=master.idglobal)
        globalparamform.idglobal.args = [(o.idglobal, o.idglobal) for o in globalparams]
        if globalparam:
            globalparamform.fill(globalparam)

        localparamform_a = LocalParamForm()

        local_params = Settings.get_local_params(master.idlocala, 'a')
        localparamform_a.idlocal.args = [(o.idlocal, o.idlocal) for o in localparameters]
        localparamform_a.fill(local_params)

        localparamform_b = LocalParamForm()

        local_params = Settings.get_local_params(master.idlocalb, 'b')
        localparamform_b.idlocal.args = [(o.idlocal, o.idlocal) for o in localparameters]
        localparamform_b.fill(local_params)

        return render.settings(master, glyphid, localparameters, globalparams,
                               globalparamform, localparamform_a, localparamform_b)
コード例 #2
0
ファイル: views.py プロジェクト: sannorozco/metapolator
 def getform(self, localparam):
     form = LocalParamForm()
     form.fill({'px': localparam.px, 'width': localparam.width, 'space': localparam.space,
                'xheight': localparam.xheight, 'capital': localparam.capital,
                'boxheight': localparam.boxheight, 'ascender': localparam.ascender,
                'descender': localparam.descender, 'inktrap': localparam.inktrap,
                'stemcut': localparam.stemcut, 'skeleton': localparam.skeleton,
                'superness': localparam.superness, 'over': localparam.over})
     return form
コード例 #3
0
ファイル: views.py プロジェクト: vitalyvolkov/metapolator
 def getform(self, localparam=None):
     form = LocalParamForm()
     if localparam:
         form.fill(localparam.as_dict())
     return form