本文整理汇总了Python中tweepy.utils.convert_to_utf8_str函数的典型用法代码示例。如果您正苦于以下问题:Python convert_to_utf8_str函数的具体用法?Python convert_to_utf8_str怎么用?Python convert_to_utf8_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了convert_to_utf8_str函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: build_parameters
def build_parameters(self, args, kargs):
self.parameters = {}
for idx, arg in enumerate(args):
try:
self.parameters[self.allowed_param[idx]] = convert_to_utf8_str(arg)
except IndexError:
raise TweepError("Too many parameters supplied!")
for k, arg in kargs.items():
if arg is None:
continue
if k in self.parameters:
raise TweepError("Multiple values for parameter %s supplied!" % k)
self.parameters[k] = convert_to_utf8_str(arg)
开发者ID:badar,项目名称:ssql,代码行数:16,代码来源:binder.py
示例2: build_parameters
def build_parameters(self, args, kwargs):
self.session.params = {}
for idx, arg in enumerate(args):
if arg is None:
continue
try:
self.session.params[self.allowed_param[idx]] = convert_to_utf8_str(arg)
except IndexError:
raise TweepError('Too many parameters supplied!')
for k, arg in kwargs.items():
if arg is None:
continue
if k in self.session.params:
raise TweepError('Multiple values for parameter %s supplied!' % k)
self.session.params[k] = convert_to_utf8_str(arg)
log.info("PARAMS: %r", self.session.params)
开发者ID:BethyDiakabananas,项目名称:tweepy,代码行数:19,代码来源:binder.py
示例3: build_parameters
def build_parameters(self, args, kargs):
self.parameters = {}
for idx, arg in enumerate(args):
try:
self.parameters[self.allowed_param[idx]] = convert_to_utf8_str(arg)
except IndexError:
raise TweepError('Too many parameters supplied!')
for k, arg in kargs.items():
if arg is None:
continue
if k in self.parameters:
raise TweepError('Multiple values for parameter %s supplied!' % k)
self.parameters[k] = convert_to_utf8_str(arg)
# Set 'user' paramter to the authenticated user's name
# if no 'user' parameter value provided
if(self.api.auth and 'user' not in self.parameters):
self.parameters['user'] = self.api.auth.get_username()
开发者ID:JNRowe-retired,项目名称:tweepy,代码行数:21,代码来源:binder.py
示例4: build_parameters
def build_parameters(self, args, kargs):
self.parameters = {}
for idx, arg in enumerate(args):
if arg is None:
continue
try:
self.parameters[self.allowed_param[idx]] = convert_to_utf8_str(arg)
except IndexError:
raise TweepError("Too many parameters supplied!")
for k, arg in kargs.items():
if arg is None:
continue
if k in deprecated_params:
warnings.warn("The use of parameter %s is deprecated" % k, DeprecationWarning)
if deprecated_params[k] is None:
continue
k = deprecated_params[k]
if k in self.parameters:
raise TweepError("Multiple values for parameter %s supplied!" % k)
self.parameters[k] = convert_to_utf8_str(arg)
开发者ID:QiaozhiWang,项目名称:tweepy,代码行数:23,代码来源:binder.py
示例5: bulk_load
def bulk_load(listkey, tweets):
with open("/home/marcua/data/tweets/%s" % (listkey), "w") as tmpfile:
print "file %s" % (tmpfile.name)
for jsontweet in tweets:
tweet = Status.parse(api, json.loads(jsontweet))
tmpfile.write(convert_to_utf8_str(tweet.text) + "\n")
开发者ID:praneeth130,项目名称:tweeql,代码行数:6,代码来源:streamfilewriter.py
示例6: gen_tuple
def gen_tuple(jsontweet):
tweet = Status.parse(api, json.loads(jsontweet))
retweeted = (getattr(tweet, 'retweeted_status', None) != None)
return (tweet.author.id, tweet.created_at, convert_to_utf8_str(tweet.text), retweeted)
开发者ID:GordonMac007,项目名称:tweeql,代码行数:4,代码来源:streambulkloader.py
注:本文中的tweepy.utils.convert_to_utf8_str函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论