当前位置: 首页>>代码示例>>Python>>正文


Python HTML.p方法代码示例

本文整理汇总了Python中HTML.HTML.p方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.p方法的具体用法?Python HTML.p怎么用?Python HTML.p使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTML.HTML的用法示例。


在下文中一共展示了HTML.p方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from HTML import HTML [as 别名]
# 或者: from HTML.HTML import p [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:
#.........这里部分代码省略.........
开发者ID:LaboJeanPerrin,项目名称:Lab.notes,代码行数:103,代码来源:Spot.py


注:本文中的HTML.HTML.p方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。