コード例 #1
0
ファイル: tags.py プロジェクト: xkenneth/tkpyro
 def __call__(self,event=None):
     try:
         exec correct_indentation(self.tag.text)
     except Exception, e:
         print e
         print correct_indentation(self.tag.text)
         pdb.set_trace()
コード例 #2
0
ファイル: basetags.py プロジェクト: xkenneth/wildfire1
    def _init(self):

        # create the function text with the proper indentation
        func = ("def %s(%s):" % (self.name, self.args)) + "\n"
        for line in correct_indentation(self.tag.text).splitlines():
            func += "    " + line + "\n"

        # execute the function, it's now in the scope

        exec func in self.parent.__dict__
コード例 #3
0
ファイル: basetags.py プロジェクト: xkenneth/wildfire1
    def _init(self):

        func = ("def %s(%s):" % (self.on, self.arg)) + "\n"
        for line in correct_indentation(self.python_statement).splitlines():
            func += "    " + line + "\n"

        # execute the function, it's now in the scope
        exec func in self.parent.__dict__
        # create the function as a bound method
        # exec "new_bound_method = types.MethodType( new_temp_method, self.parent, wildfire.tags['%s'] )" % ( self.parent.__tag__ )

        self.parent.senders_[self.on] = {self: self.parent[self.on]}
コード例 #4
0
ファイル: tags.py プロジェクト: xkenneth/tkpyro
 def construct(self):
     exec correct_indentation(self.tag.text)