本文整理汇总了Python中HTML.HTML.style方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.style方法的具体用法?Python HTML.style怎么用?Python HTML.style使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML.HTML
的用法示例。
在下文中一共展示了HTML.style方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from HTML import HTML [as 别名]
# 或者: from HTML.HTML import style [as 别名]
class Spot:
"""
The Spot class
"""
# ----------------------------------------------------------------------
def __init__(self, settings, session, data, inputs):
# --- Definitions
self.settings = settings
self.session = session
self.data = data
self.inputs = inputs
self.html = HTML(self)
self.display = True;
# --- Pre-processing
self.pre_process()
# --- Actions
if self.inputs.getvalue('form_action') is not None:
# NB: stop is for redirection
stop = self.form_action()
else:
stop = None
# --- Html
if stop is None:
self.html.meta(Language=self.session.language)
self.html.favicon('Core/Style/Icons/favicon.ico?v={0}'.format(time()))
self.html.style('fonts')
self.html.style('common')
self.html.jsfile('Core/JS/jquery.js')
self.html.jsfile('Core/JS/common.js')
self.set_html()
# ----------------------------------------------------------------------
def pre_process(self):
'''
Pre-processing method
Inputs:
-
Output:
None
'''
# --- Set language
self.set_lang()
# ----------------------------------------------------------------------
def set_html(self):
'''
Sets html code
Inputs:
-
Output:
None
'''
pass
# ----------------------------------------------------------------------
def set_lang(self):
'''
Determine spot language
Inputs:
-
Output:
None
'''
# self.session.language
# --- Modification
lang = self.inputs.getvalue('lang')
if lang is not None and lang in self.settings.LANGUAGES:
# Update database
self.session.DB.update('Sessions', 'lang', lang, 'sid=?', self.session.id)
# Update session
self.session.language = lang
# --- Conversion
self.LangIdx = self.settings.LANGUAGES.index(self.session.language)
# ----------------------------------------------------------------------
def mlt(self, M, decode=True, newlines=True):
'''
Multi-language text handler
#.........这里部分代码省略.........
示例2: __init__
# 需要导入模块: from HTML import HTML [as 别名]
# 或者: from HTML.HTML import style [as 别名]
class Spot:
"""
The Spot class
"""
# ----------------------------------------------------------------------
def __init__(self, settings, session, inputs):
# --- Definitions
self.settings = settings
self.session = session
self.inputs = inputs
self.html = HTML(self)
self.display = True
# --- Pre-processing
self.pre_process()
# --- Actions
if self.inputs.getvalue("form_action") is not None:
# NB: stop is for redirection
stop = self.form_action()
else:
stop = None
# --- Html
if stop is None:
self.html.meta(Language=self.session.language)
self.html.favicon("Core/Style/Icons/favicon.ico?v={0}".format(time()))
self.html.style("fonts")
self.html.style("common")
self.html.jsfile("Core/JS/jquery.js")
self.html.jsfile("Core/JS/common.js")
self.set_html()
# ----------------------------------------------------------------------
def pre_process(self):
"""
Pre-processing method
Inputs:
-
Output:
None
"""
# --- Set language
self.set_lang()
# ----------------------------------------------------------------------
def set_html(self):
"""
Sets html code
Inputs:
-
Output:
None
"""
pass
# ----------------------------------------------------------------------
def set_lang(self):
"""
Determine spot language
Inputs:
-
Output:
None
"""
# self.session.language
# --- Modification
lang = self.inputs.getvalue("lang")
if lang is not None and lang in self.settings.LANGUAGES:
# Update database
self.session.DB.update("Sessions", "lang", lang, "sid=?", self.session.id)
# Update session
self.session.language = lang
# --- Conversion
self.LangIdx = self.settings.LANGUAGES.index(self.session.language)
# ----------------------------------------------------------------------
def mlt(self, M, decode=True, newlines=True):
"""
Multi-language text handler
Inputs:
#.........这里部分代码省略.........