當前位置: 首頁>>代碼示例>>Python>>正文


Python HTML.favicon方法代碼示例

本文整理匯總了Python中HTML.HTML.favicon方法的典型用法代碼示例。如果您正苦於以下問題:Python HTML.favicon方法的具體用法?Python HTML.favicon怎麽用?Python HTML.favicon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HTML.HTML的用法示例。


在下文中一共展示了HTML.favicon方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from HTML import HTML [as 別名]
# 或者: from HTML.HTML import favicon [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
        
#.........這裏部分代碼省略.........
開發者ID:LaboJeanPerrin,項目名稱:Data.Manager,代碼行數:103,代碼來源:Spot.py

示例2: __init__

# 需要導入模塊: from HTML import HTML [as 別名]
# 或者: from HTML.HTML import favicon [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.favicon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。