本文整理汇总了Python中_util.isstringlike方法的典型用法代码示例。如果您正苦于以下问题:Python _util.isstringlike方法的具体用法?Python _util.isstringlike怎么用?Python _util.isstringlike使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_util
的用法示例。
在下文中一共展示了_util.isstringlike方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import _util [as 别名]
# 或者: from _util import isstringlike [as 别名]
def __init__(self, filename=None, delayload=False, policy=None):
"""
See FileCookieJar.__doc__ for argument documentation.
Cookies are NOT loaded from the named file until either the load or
revert method is called.
"""
CookieJar.__init__(self, policy)
if filename is not None and not isstringlike(filename):
raise ValueError("filename must be string-like")
self.filename = filename
self.delayload = bool(delayload)
示例2: __init__
# 需要导入模块: import _util [as 别名]
# 或者: from _util import isstringlike [as 别名]
def __init__(self, filename, autoconnect=True, policy=None):
experimental("Firefox3CookieJar is experimental code")
CookieJar.__init__(self, policy)
if filename is not None and not isstringlike(filename):
raise ValueError("filename must be string-like")
self.filename = filename
self._conn = None
if autoconnect:
self.connect()
示例3: _request
# 需要导入模块: import _util [as 别名]
# 或者: from _util import isstringlike [as 别名]
def _request(self, url_or_req, data, visit,
timeout=_sockettimeout._GLOBAL_DEFAULT_TIMEOUT):
if isstringlike(url_or_req):
req = Request(url_or_req, data, visit=visit, timeout=timeout)
else:
# already a mechanize.Request instance
req = url_or_req
if data is not None:
req.add_data(data)
# XXX yuck
set_request_attr(req, "visit", visit, None)
set_request_attr(req, "timeout", timeout,
_sockettimeout._GLOBAL_DEFAULT_TIMEOUT)
return req