Beispiel #1
0
class BasePara(object):
    '''
    页面的公共参数类
    '''

    title = "fixmath"  #页面的title
    keyword = ""  #banner的关键字
    description = ""  #banner的描述
    mathjax = True  #是否数学公式加载
    currentmodule = fixmathproperty.CurrentPage().home  #高亮显示字符串
    bannerstylename = fixmathproperty.CurrentStyleName().home  #页面样式banner名称
Beispiel #2
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.title = "AsciiMath"
     parames.keyword = ""
     parames.description = ""
     parames.currentmodule = fixmathproperty.CurrentPage().source
     parames.bannerstylename = fixmathproperty.CurrentStyleName().source
     return RENDER.modules.source.index(parames)
Beispiel #3
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.title = "Analytic Geometry"
     parames.keyword = "Analytic Geometry"
     parames.description = "借助于解析式进行图形研究的几何学,定义图形的概念与参数"
     parames.currentmodule = fixmathproperty.CurrentPage().geometry
     parames.bannerstylename = fixmathproperty.CurrentStyleName().geometry
     return RENDER.modules.geometry.index(parames)
Beispiel #4
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.title = "algebra"
     parames.keyword = "Algebra"
     parames.description = "研究线性空间(向量空间)、模和其上的线性变换以及与之有关的问题"
     parames.currentmodule = fixmathproperty.CurrentPage().algebra
     parames.bannerstylename = fixmathproperty.CurrentStyleName().algebra
     return RENDER.modules.algebra.index(parames)
Beispiel #5
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.title = "inequality-with-absolute-value"
     parames.keyword = ""
     parames.description = "从数轴上看,数 `a` 的绝对值 `|a|` 就是点 `a` 到原点的距离"
     parames.currentmodule = fixmathproperty.CurrentPage().calculus
     parames.bannerstylename = fixmathproperty.CurrentStyleName(
     ).inequality_with
     return RENDER.modules.calculus.inequality_with(parames)
Beispiel #6
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.title = "real-numbers-and-their-properties"
     parames.keyword = ""
     parames.description = "研究的基本对象是定义在实数集上的函数"
     parames.currentmodule = fixmathproperty.CurrentPage().calculus
     parames.bannerstylename = fixmathproperty.CurrentStyleName(
     ).real_numbers
     return RENDER.modules.calculus.real_numbers(parames)
Beispiel #7
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.title = "the-last-volume"
     parames.keyword = "Calculus"
     parames.description = "研究的基本对象是定义在实数集上的函数"
     parames.currentmodule = fixmathproperty.CurrentPage().calculus
     parames.bannerstylename = fixmathproperty.CurrentStyleName(
     ).the_last_volume
     return RENDER.modules.calculus.the_last_volume(parames)
Beispiel #8
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.mathjax = False
     parames.title = "关于我们"
     parames.keyword = ""
     parames.description = ""
     parames.currentmodule = fixmathproperty.CurrentPage().home
     parames.bannerstylename = fixmathproperty.CurrentStyleName().home
     return RENDER.about(parames)
Beispiel #9
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.mathjax = False
     parames.title = "巴科斯(Backus-Naur)范式"
     parames.keyword = ""
     parames.description = ""
     parames.currentmodule = fixmathproperty.CurrentPage().wiki
     parames.bannerstylename = fixmathproperty.CurrentStyleName().wiki
     return RENDER.modules.wiki.backus_naur(parames)
Beispiel #10
0
 def GET(self, url):
     '''
     返回视图
     '''
     if url in ['', '/']:
         pass
     parames = model.BasePara()
     parames.mathjax = True
     parames.title = "WIKI"
     parames.keyword = ""
     parames.description = ""
     parames.currentmodule = fixmathproperty.CurrentPage().wiki
     parames.bannerstylename = fixmathproperty.CurrentStyleName().wiki
     return RENDER.modules.wiki.index(parames)
Beispiel #11
0
    algebra_url="/zh-cn/algebra/",  #代数
    geometry_url="/zh-cn/geometry/",  #几何
    source_url="/zh-cn/source/",  #源
    game_url="/zh-cn/game/",  #游戏
    svg_url="/zh-cn/svg/",  #svg
    wiki_url="/zh-cn/wiki/",  #wiki
    profile_url="/zh-cn/profile/",  #用户中心
    other_url="/zh-cn/",  #其它
    favicon_url="/favicon.ico",  #fixmath图标位置
    init_day="2017/11/21",  #fixmath初始化day
    init_time="19:27:25",  #fixmath初始化time
    local_datetime=datetime.now(),  #当前时间
    locale="beijing china",  #fixmath地点
    cache=False,  #fixmath缓存
    debug=True,  #fixmath调试
    bannerstylename=fixmathproperty.CurrentStyleName(),  #fixmath每个页面的banner
    currentmodule=fixmathproperty.CurrentPage()  #当前模块
)

web.config.port = FIX_MATH_CONFIG.port
web.config.debug = FIX_MATH_CONFIG.debug
RENDER = web.template.render(FIX_MATH_CONFIG.template_dir,
                             cache=FIX_MATH_CONFIG.cache)

web.template.Template.globals['config'] = FIX_MATH_CONFIG
web.template.Template.globals['render'] = RENDER

URLS = (
    FIX_MATH_CONFIG.home_url,
    'controller.Home',  #首页
    FIX_MATH_CONFIG.calculus_url + 'the-first-volume(.*)',