示例#1
0
    def __hash__(self):
        if self.args:
            if isinstance(self.args, dict):
                sargs = encoder.encode(self.args)
            else:
                sargs = ', '.join(encoder.encode(a) for a in self.args)
        else:
            sargs = None

        return hash((hasattr(self, 'src') and self.src or '') + (sargs or ''))
示例#2
0
    def __hash__(self):
        if self.args:
            if isinstance(self.args, dict):
                sargs = encoder.encode(self.args)
            else:
                sargs = ', '.join(encoder.encode(a) for a in self.args)
        else:
            sargs = None

        return hash((hasattr(self, 'src') and self.src or '') + (sargs or ''))
示例#3
0
    def prepare(self):
        if not self.src:
            args = ''
            if isinstance(self.args, dict):
                args = encoder.encode(self.args)
            elif self.args:
                args = ', '.join(encoder.encode(a) for a in self.args)

            self.src = '%s(%s)' % (self.function, args)
        super(_JSFuncCall, self).prepare()
示例#4
0
    def prepare(self):
        if not self.src:
            args = ''
            if isinstance(self.args, dict):
                args = encoder.encode(self.args)
            elif self.args:
                args = ', '.join(encoder.encode(a) for a in self.args)

            self.src = '%s(%s)' % (self.function, args)
        super(_JSFuncCall, self).prepare()