当前位置: 首页>>代码示例>>Python>>正文


Python User.search方法代码示例

本文整理汇总了Python中users.User.search方法的典型用法代码示例。如果您正苦于以下问题:Python User.search方法的具体用法?Python User.search怎么用?Python User.search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在users.User的用法示例。


在下文中一共展示了User.search方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import search [as 别名]
def main():
    if len(sys.argv) == 1:
        print 'Available Functions:'
        print '  --setup'
        print
        print '  --account/verify_credentials(email, password)'
        print '  --account/settings (user_id)'
        print '  --account/update_settings (user_id, email, password, privacy, locale, timezone)'
        print '  --account/update_profile(user_id, username, name, bio, website, image)'
        print '  --account/create(email, password, username, name, privacy)'
        print 
        print '  --blocks/exists (user_id, follower_id)'
        print '  --blocks/blocking/ids (user_id)'
        print '  --blocks/create (user_id, follower_id)'
        print '  --blocks/destroy (user_id, follower_id)'
        print
        print '  --users/show (user_id)'
        print '  --users/lookup (user_ids)'
        print '  --users/search (query)'
        print '  --users/flag (user_id)'
        print
        print '  --friends/ids (user_id)'
        print '  --followers/ids (user_id)'
        print
        print '  --friendships/create (user_id, following_id)'
        print '  --friendships/destroy (user_id, following_id)'
        print '  --friendships/exists (user_id, following_id)'
        print '  --friendships/show (user_id, following_id)'
        print '  --friendships/incoming (user_id)'
        print '  --friendships/outgoing (user_id)'
        print
        print '  --entities/show (entity_id)'
        print '  --entities/create (title, category)'
        print '  --entities/destroy (entity_id)'
        print '  --entities/update (entity_id, title, category)'
        print '  --entities/match (query)'
        print
        print '  --stamps/create (uid, entity_id, comment)'
        print '  --stamps/show (stamp_id)'
        print '  --stamps/destroy (stamp_id)'
        print '  --stamps/flag (stamp_id, [is_flagged])'
        print '  --stamps/read (stamp_id, [user_id], [is_read])'
        print 
        print '  --conversation/show (comment_id)'
        print '  --conversation/create (user_id, stamp_id, comment)'
        print '  --conversation/destroy (comment_id)'
        print '  --conversation/flag (comment_id, [is_flagged])'
        print
        print '  --mentions/create (stamp_id, user_id)'
        print '  --mentions/destroy (stamp_id, user_id)'
        print '  --mentions/user (user_id)'
        print 
        print '  --collections/inbox (user_id)'
        print '  --collections/user (user_id)'
        print '  --collections/add_stamp (stamp_id)'
        print
        print '  --favorites/show (user_id)'
        print '  --favorites/create (stamp_id, user_id)'
        print '  --favorites/destroy (stamp_id, user_id)'
        print
        sys.exit(1)
    
    option = sys.argv[1]
    
    
    # Setup:
    if option == '--setup':
        setup.setup()
    
    
    # Account:
    elif option == '--account/verify_credentials':
        account = Account()
        checkNumberOfArguments(2, len(sys.argv))
        response = account.verify_credentials(sys.argv[2], sys.argv[3])
        print 'Response: ', response
        
    elif option == '--account/settings':
        account = Account()
        checkNumberOfArguments(1, len(sys.argv))
        response = account.settings(sys.argv[2])
        print 'Response: ', response
        
    elif option == '--account/update_settings':
        account = Account()
        checkNumberOfArguments(6, len(sys.argv))
        response = account.update_settings(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6], sys.argv[7])
        print 'Response: ', response
        
    elif option == '--account/update_profile':
        account = Account()
        checkNumberOfArguments(6, len(sys.argv))
        response = account.update_profile(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6], sys.argv[7])
        print 'Response: ', response
        
    elif option == '--account/create':
        account = Account()
        checkNumberOfArguments(5, len(sys.argv))
        response = account.create(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6])
        print 'Response: ', response
#.........这里部分代码省略.........
开发者ID:Stamped,项目名称:Stamped,代码行数:103,代码来源:mysql-api.py


注:本文中的users.User.search方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。