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


Python Environment.invoke方法代碼示例

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


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

示例1: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
 def invoke(self, tex):
     self.ownerDocument.context.push(self)
     esc = self.ownerDocument.context.categories[Token.CC_ESCAPE]
     begin = self.ownerDocument.context.categories[Token.CC_BGROUP]
     end = self.ownerDocument.context.categories[Token.CC_EGROUP]
     self.ownerDocument.context.setVerbatimCatcodes()
     for i in esc:
         self.ownerDocument.context.catcode(i, Token.CC_ESCAPE)
     for i in begin:
         self.ownerDocument.context.catcode(i, Token.CC_BGROUP)
     for i in end:
         self.ownerDocument.context.catcode(i, Token.CC_EGROUP)
     Environment.invoke(self, tex)
     self.ownerDocument.context.pop(self)
開發者ID:KatiaBorges,項目名稱:exeLearning,代碼行數:16,代碼來源:alltt.py

示例2: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
 def invoke(self, tex):
     res = Environment.invoke(self, tex)
     if self.macroMode == self.MODE_BEGIN:
         a = self.attributes['place'].lower()
         if a in ['r','o']:
             self.float = 'right'
     return res
開發者ID:AllenDowney,項目名稱:plastex-oreilly,代碼行數:9,代碼來源:wrapfig.py

示例3: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
 def invoke(self, tex):
     res = Environment.invoke(self, tex)
     doc = self.ownerDocument
     if self.macroMode != self.MODE_END:
         self.ownerDocument.userdata.setPath("babel/previouslanguage", doc.context.currentLanguage)
         doc.context.loadLanguage(self.attributes["lang"], self.ownerDocument)
     else:
         lang = doc.userdata.getPath("babel/previouslanguage")
         doc.context.loadLanguage(lang, self.ownerDocument)
     return res
開發者ID:AllenDowney,項目名稱:plastex-oreilly,代碼行數:12,代碼來源:babel.py

示例4: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
    def invoke(self, tex):
        if self.macroMode == Macro.MODE_END:
            self.ownerDocument.context.pop(self) # End of table, row, and cell
            return
        
        Environment.invoke(self, tex)

#!!!
#
# Need to handle colspec processing here so that tokens that must 
# be inserted before and after columns are known
#
#!!!
        if self.attributes.has_key('colspec'):
            self.colspec = Array.compileColspec(tex, self.attributes['colspec'])

        self.ownerDocument.context.push() # Beginning of cell
        # Add a phantom row and cell to absorb the appropriate tokens
        return [self, self.ownerDocument.createElement('ArrayRow'), 
                      self.ownerDocument.createElement('ArrayCell')]
開發者ID:PatrickMassot,項目名稱:plastex,代碼行數:22,代碼來源:Arrays.py

示例5: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
 def invoke(self, tex):
     """ Set list nesting depth """
     if self.macroMode != Environment.MODE_END:
         List.depth += 1
     else:
         List.depth -= 1
     try:
         for i in range(List.depth, len(List.counters)):
             self.ownerDocument.context.counters[List.counters[i]].setcounter(0)
     except (IndexError, KeyError):
         pass
     return Environment.invoke(self, tex)
開發者ID:AllenDowney,項目名稱:plastex-oreilly,代碼行數:14,代碼來源:Lists.py

示例6: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
    def invoke(self, tex):
        res = Environment.invoke(self, tex)

        # Set initial counter values
        if self.config.has_key("counters"):
            counters = self.config["counters"]
            for name in counters.keys():
                if name.startswith(";"):
                    continue
                self.ownerDocument.context.counters[name].setcounter(counters[name] - 1)

        return res
開發者ID:KatiaBorges,項目名稱:exeLearning,代碼行數:14,代碼來源:Document.py

示例7: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
    def invoke(self, tex):
        res = Environment.invoke(self, tex)

        # Set initial counter values
        if 'counters' in self.config:
            counters = self.config['counters']
            for name in list(counters.keys()):
                if name.startswith(';'):
                    continue
                try:
                    self.ownerDocument.context.counters[name].setcounter(counters[name]-1)
                except TypeError:
                    self.ownerDocument.context.counters[name].setcounter(int(counters[name])-1)

        return res
開發者ID:NextThought,項目名稱:nti.plasTeX,代碼行數:17,代碼來源:Document.py

示例8: invoke

# 需要導入模塊: from plasTeX import Environment [as 別名]
# 或者: from plasTeX.Environment import invoke [as 別名]
 def invoke(self, tex):
     if isinstance(self, Environment):
         Environment.invoke(self, tex)
     else:
         Command.invoke(self, tex)
     self.attributes['title'] = self.ownerDocument.createElement('indexname').expand(tex)
開發者ID:NextThought,項目名稱:nti.plasTeX,代碼行數:8,代碼來源:Index.py


注:本文中的plasTeX.Environment.invoke方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。