开发者

How to set the max_results value from the gdata.codesearch API higher than 10?

Hi can someone tell me how to use the gdata Codesearch API and augment the number of results from the Query higher than 10 ?

I allr开发者_如何学编程eady check the CodesearchExample.py from Code Google Gdata - CodesearchExample , but couldn't find a way to do it.

Anyone got an idea ?


You can't directly use GetSnippetsFeed like the example does. GetSnippetsFeed is actually a wrapper that creates a CodesearchQuery object without any parameters. If you create that object yourself you can set the max_results property.

service = gdata.codesearch.service.CodesearchService(source='my_test_app-1.0')
query = gdata.codesearch.service.CodesearchQuery(text_query="search text")
query.max_results=15
feed = service.Query(query.ToUri())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜