示例#1
0
文件: mfg.py 项目: davelab6/mfg-2013
    def POST (self,id):
        gml = list(model.get_globalparams())
        glo = list(model.get_localparams())
        idlA = cFont.idlocalA 
        cFont.idlocalB = id
        idlB =id 
#                id argument via the html
#
        gloB = list(model.get_localparam(id))
        gloA = list(model.get_localparam(idlA))
        formlB = self.formlocB()
        formlA = localParamA.formlocA()
        formg = GlobalParam.formg()
        formlB.fill()

        formlA.fill({'px':gloA[0].px,'width':gloA[0].width,'space':gloA[0].space,'xheight':gloA[0].xheight,'capital':gloA[0].capital,'boxheight':gloA[0].boxheight,'ascender':gloA[0].ascender,'descender':gloA[0].descender,'inktrap':gloA[0].inktrap,'stemcut':gloA[0].stemcut,'skeleton':gloA[0].skeleton,'superness':gloA[0].superness,'over':gloA[0].over})

        if formlB.validates() :
              model.update_localparam(idlB,formlB.d.px,formlB.d.width,formlB.d.space,formlB.d.xheight,formlB.d.capital,formlB.d.boxheight,formlB.d.ascender,formlB.d.descender,formlB.d.inktrap,formlB.d.stemcut,formlB.d.skeleton,formlB.d.superness,formlB.d.over)
        if not formlB.validates() :
               return render.font4(formg,gml,cFont,glo,formlA,formlB)

        model.writeGlobalParam()

        return render.font4(formg,gml,cFont,glo,formlA,formlB)
示例#2
0
文件: mfg.py 项目: davelab6/mfg-2013
    def GET(self,id):
        
        gml = list(model.get_globalparams())
        formg = GlobalParam.formg()
        glo = list(model.get_localparams())
        formlA = localParamA.formlocA()
        formlB = self.formlocB()
        gm = list(model.get_globalparam(cFont.idglobal))
        formg.fill({'metapolation':gm[0].metapolation,'fontsize':gm[0].fontsize,'mean':gm[0].mean,'cap':gm[0].cap,'ascl':gm[0].ascl,'des':gm[0].des,'box':gm[0].box})
        idlA = cFont.idlocalA  
        idlB =id 
        if idlA > '0' :
          gloA = list(model.get_localparam(idlA))
        else:
          gloA = None
        if idlB > '0' :
          gloB = list(model.get_localparam(id))
        else:
          gloB = None

        if gloA != None:
           formlA.fill({'px':gloA[0].px,'width':gloA[0].width,'space':gloA[0].space,'xheight':gloA[0].xheight,'capital':gloA[0].capital,'boxheight':gloA[0].boxheight,'ascender':gloA[0].ascender,'descender':gloA[0].descender,'inktrap':gloA[0].inktrap,'stemcut':gloA[0].stemcut,'skeleton':gloA[0].skeleton,'superness':gloA[0].superness,'over':gloA[0].over})
        if gloB != None:
           formlB.fill({'px':gloB[0].px,'width':gloB[0].width,'space':gloB[0].space,'xheight':gloB[0].xheight,'capital':gloB[0].capital,'boxheight':gloB[0].boxheight,'ascender':gloB[0].ascender,'descender':gloB[0].descender,'inktrap':gloB[0].inktrap,'stemcut':gloB[0].stemcut,'skeleton':gloB[0].skeleton,'superness':gloB[0].superness,'over':gloB[0].over})

        return render.font4(formg,gml,cFont,glo,formlA,formlB)
示例#3
0
文件: mfg.py 项目: davelab6/mfg-2013
    def GET(self,id):
        
        print "getparam",id
        gml = list(model.get_globalparams())
        formg = self.formg()
        if id > '0' :
          gm = list(model.get_globalparam(id))
        else:
          gm = None

        if gm != None:
             formg.fill({'metapolation':gm[0].metapolation,'fontsize':gm[0].fontsize,'mean':gm[0].mean,'cap':gm[0].cap,'ascl':gm[0].ascl,'des':gm[0].des,'box':gm[0].box})
        return render.font2(formg,gml,cFont)
示例#4
0
文件: mfg.py 项目: davelab6/mfg-2013
    def POST (self,id):
        print "postparam",id
        gml = list(model.get_globalparams())
        gm = list(model.get_globalparam(id))
        formg = self.formg()
        formg.fill()
        if formg.validates  :
               model.update_globalparam(id, formg.d.metapolation, formg.d.fontsize, formg.d.mean, formg.d.cap, formg.d.ascl, formg.d.des, formg.d.box)
        if not formg.validates() :
               return render.font2(formg,gml,cFont)

        model.writeGlobalParam()

        return render.font2(formg,gml,cFont)
示例#5
0
    def GET(self, id):
        if not is_loggedin():
            raise seeother('/login')

        gm = list(model.get_globalparam(id))
        if not gm:
            return web.notfound()

        formg = GlobalParamForm()
        formg.fill({'metapolation': gm[0].metapolation, 'fontsize': gm[0].fontsize,
                    'mean': gm[0].mean, 'cap': gm[0].cap, 'ascl': gm[0].ascl,
                    'des': gm[0].des, 'box': gm[0].box})

        gml = list(model.get_globalparams())
        return render.globals(gml, formg)
示例#6
0
    def POST(self, id):
        if not is_loggedin():
            raise seeother('/login')

        gm = list(model.get_globalparam(id))
        if not gm:
            return web.notfound()

        formg = GlobalParamForm()
        if formg.validates():
            model.update_globalparam(id, formg.d.metapolation, formg.d.fontsize,
                                     formg.d.mean, formg.d.cap, formg.d.ascl,
                                     formg.d.des, formg.d.box)
            return seeother('/settings/globals/')

        gml = list(model.get_globalparams())
        return render.globals(gml, formg)
示例#7
0
文件: mfg.py 项目: Kryndex/mfg-2013
    def POST(self, id):
        print "postparam", id
        gml = list(model.get_globalparams())
        gm = list(model.get_globalparam(id))
        formg = self.formg()
        formg.fill()
        if formg.validates:
            model.update_globalparam(id, formg.d.metapolation,
                                     formg.d.fontsize, formg.d.mean,
                                     formg.d.cap, formg.d.ascl, formg.d.des,
                                     formg.d.box)
        if not formg.validates():
            return render.font2(formg, gml, cFont)

        model.writeGlobalParam()

        return render.font2(formg, gml, cFont)
示例#8
0
文件: mfg.py 项目: Kryndex/mfg-2013
    def POST(self, id):
        gml = list(model.get_globalparams())
        glo = list(model.get_localparams())
        idlA = cFont.idlocalA
        cFont.idlocalB = id
        idlB = id
        #                id argument via the html
        #
        gloB = list(model.get_localparam(id))
        gloA = list(model.get_localparam(idlA))
        formlB = self.formlocB()
        formlA = localParamA.formlocA()
        formg = GlobalParam.formg()
        formlB.fill()

        formlA.fill({
            'px': gloA[0].px,
            'width': gloA[0].width,
            'space': gloA[0].space,
            'xheight': gloA[0].xheight,
            'capital': gloA[0].capital,
            'boxheight': gloA[0].boxheight,
            'ascender': gloA[0].ascender,
            'descender': gloA[0].descender,
            'inktrap': gloA[0].inktrap,
            'stemcut': gloA[0].stemcut,
            'skeleton': gloA[0].skeleton,
            'superness': gloA[0].superness,
            'over': gloA[0].over
        })

        if formlB.validates():
            model.update_localparam(idlB, formlB.d.px, formlB.d.width,
                                    formlB.d.space, formlB.d.xheight,
                                    formlB.d.capital, formlB.d.boxheight,
                                    formlB.d.ascender, formlB.d.descender,
                                    formlB.d.inktrap, formlB.d.stemcut,
                                    formlB.d.skeleton, formlB.d.superness,
                                    formlB.d.over)
        if not formlB.validates():
            return render.font4(formg, gml, cFont, glo, formlA, formlB)

        model.writeGlobalParam()

        return render.font4(formg, gml, cFont, glo, formlA, formlB)
示例#9
0
文件: mfg.py 项目: Kryndex/mfg-2013
    def GET(self, id):

        print "getparam", id
        gml = list(model.get_globalparams())
        formg = self.formg()
        if id > '0':
            gm = list(model.get_globalparam(id))
        else:
            gm = None

        if gm != None:
            formg.fill({
                'metapolation': gm[0].metapolation,
                'fontsize': gm[0].fontsize,
                'mean': gm[0].mean,
                'cap': gm[0].cap,
                'ascl': gm[0].ascl,
                'des': gm[0].des,
                'box': gm[0].box
            })
        return render.font2(formg, gml, cFont)
示例#10
0
文件: mfg.py 项目: Kryndex/mfg-2013
    def GET(self, id):

        gml = list(model.get_globalparams())
        formg = GlobalParam.formg()
        glo = list(model.get_localparams())
        formlA = localParamA.formlocA()
        formlB = self.formlocB()
        gm = list(model.get_globalparam(cFont.idglobal))
        formg.fill({
            'metapolation': gm[0].metapolation,
            'fontsize': gm[0].fontsize,
            'mean': gm[0].mean,
            'cap': gm[0].cap,
            'ascl': gm[0].ascl,
            'des': gm[0].des,
            'box': gm[0].box
        })
        idlA = cFont.idlocalA
        idlB = id
        if idlA > '0':
            gloA = list(model.get_localparam(idlA))
        else:
            gloA = None
        if idlB > '0':
            gloB = list(model.get_localparam(id))
        else:
            gloB = None

        if gloA != None:
            formlA.fill({
                'px': gloA[0].px,
                'width': gloA[0].width,
                'space': gloA[0].space,
                'xheight': gloA[0].xheight,
                'capital': gloA[0].capital,
                'boxheight': gloA[0].boxheight,
                'ascender': gloA[0].ascender,
                'descender': gloA[0].descender,
                'inktrap': gloA[0].inktrap,
                'stemcut': gloA[0].stemcut,
                'skeleton': gloA[0].skeleton,
                'superness': gloA[0].superness,
                'over': gloA[0].over
            })
        if gloB != None:
            formlB.fill({
                'px': gloB[0].px,
                'width': gloB[0].width,
                'space': gloB[0].space,
                'xheight': gloB[0].xheight,
                'capital': gloB[0].capital,
                'boxheight': gloB[0].boxheight,
                'ascender': gloB[0].ascender,
                'descender': gloB[0].descender,
                'inktrap': gloB[0].inktrap,
                'stemcut': gloB[0].stemcut,
                'skeleton': gloB[0].skeleton,
                'superness': gloB[0].superness,
                'over': gloB[0].over
            })

        return render.font4(formg, gml, cFont, glo, formlA, formlB)