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


Python Config.debug方法代碼示例

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


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

示例1: dump_float

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def dump_float(self, obj, tag, typed = 1, ns_map = {}):
        if Config.debug: print "In dump_float."
        tag = tag or self.gentag()

        tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

        if Config.strict_range:
            doubleType(obj)

        if fpconst.isPosInf(obj):
            obj = "INF"
        elif fpconst.isNegInf(obj):
            obj = "-INF"
        elif fpconst.isNaN(obj):
            obj = "NaN"
        else:
            obj = repr(obj)

        # Note: python 'float' is actually a SOAP 'double'.
        self.out.append(self.dumper(
            None, "double", obj, tag, typed, ns_map, self.genroot(ns_map))) 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:23,代碼來源:SOAPBuilder.py

示例2: dump_dictionary

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def dump_dictionary(self, obj, tag, typed = 1, ns_map = {}):
        if Config.debug: print "In dump_dictionary."
        tag = tag or self.gentag()
        tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

        id = self.checkref(obj, tag, ns_map)
        if id == None:
            return

        try: a = obj._marshalAttrs(ns_map, self)
        except: a = ''

        self.out.append('<%s%s%s%s>\n' % 
                        (tag, id, a, self.genroot(ns_map)))

        for (k, v) in obj.items():
            if k[0] != "_":
                self.dump(v, k, 1, ns_map)

        self.out.append('</%s>\n' % tag) 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:22,代碼來源:SOAPBuilder.py

示例3: gentag

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def gentag(self):
        if Config.debug: print "In gentag."
        self.tcounter += 1
        return "v%d" % self.tcounter 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:6,代碼來源:SOAPBuilder.py

示例4: dump

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def dump(self, obj, tag = None, typed = 1, ns_map = {}):
        if Config.debug: print "In dump.", "obj=", obj
        ns_map = ns_map.copy()
        self.depth += 1

        if type(tag) not in (NoneType, StringType, UnicodeType):
            raise KeyError, "tag must be a string or None"

        self.dump_dispatch(obj, tag, typed, ns_map)
        self.depth -= 1

    # generic dumper 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:14,代碼來源:SOAPBuilder.py

示例5: dumper

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def dumper(self, nsURI, obj_type, obj, tag, typed = 1, ns_map = {},
               rootattr = '', id = '',
               xml = '<%(tag)s%(type)s%(id)s%(attrs)s%(root)s>%(data)s</%(tag)s>\n'):
        if Config.debug: print "In dumper."

        if nsURI == None:
            nsURI = self.config.typesNamespaceURI

        tag = tag or self.gentag()

        tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

        a = n = t = ''
        if typed and obj_type:
            ns, n = self.genns(ns_map, nsURI)
            ins = self.genns(ns_map, self.config.schemaNamespaceURI)[0]
            t = ' %stype="%s%s"%s' % (ins, ns, obj_type, n)

        try: a = obj._marshalAttrs(ns_map, self)
        except: pass

        try: data = obj._marshalData()
        except:
            if (obj_type != "string"): # strings are already encoded
                data = cgi.escape(str(obj))
            else:
                data = obj



        return xml % {"tag": tag, "type": t, "data": data, "root": rootattr,
            "id": id, "attrs": a} 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:34,代碼來源:SOAPBuilder.py

示例6: dump_int

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def dump_int(self, obj, tag, typed = 1, ns_map = {}):
        if Config.debug: print "In dump_int."
        self.out.append(self.dumper(None, 'integer', obj, tag, typed,
                                     ns_map, self.genroot(ns_map))) 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:6,代碼來源:SOAPBuilder.py

示例7: dump_string

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def dump_string(self, obj, tag, typed = 0, ns_map = {}):
        if Config.debug: print "In dump_string."
        tag = tag or self.gentag()
        tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding

        id = self.checkref(obj, tag, ns_map)
        if id == None:
            return

        try: data = obj._marshalData()
        except: data = obj

        self.out.append(self.dumper(None, "string", cgi.escape(data), tag,
                                    typed, ns_map, self.genroot(ns_map), id)) 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:16,代碼來源:SOAPBuilder.py

示例8: dump_None

# 需要導入模塊: from Config import Config [as 別名]
# 或者: from Config.Config import debug [as 別名]
def dump_None(self, obj, tag, typed = 0, ns_map = {}):
        if Config.debug: print "In dump_None."
        tag = tag or self.gentag()
        tag = toXMLname(tag) # convert from SOAP 1.2 XML name encoding
        ns = self.genns(ns_map, self.config.schemaNamespaceURI)[0]

        self.out.append('<%s %snull="1"%s/>\n' %
                        (tag, ns, self.genroot(ns_map))) 
開發者ID:amarian12,項目名稱:p2pool-bch,代碼行數:10,代碼來源:SOAPBuilder.py


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