本文整理匯總了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