Ejemplo n.º 1
0
    def f(*args, **kw):
      
      # check kw's
      kw = validate_kw(kw, requires)

      # optionally connect to the api
      api = opt_connect(**kw)

      # add defautls to kw's
      kw = dict(kw.items() + default.items())
        
      # get args
      args = catch_err(func, api, **kw)

      if gen:
        if kw.get('concurrent'):
          return concurrent_yield(parser, args, **kw)

        else:
          return (parser(a) for a in args)

      else:
        return parser(args)
Ejemplo n.º 2
0
        def f(*args, **kw):

            # check kw's
            kw = validate_kw(kw, requires)

            # optionally connect to the api
            api = opt_connect(**kw)

            # add defautls to kw's
            kw = dict(kw.items() + default.items())

            # if were not paginating simply
            # run the function
            if not kw['paginate']:
                tweets = catch_err(func, api, **kw)
            else:
                tweets = paginate(func, api, **kw)

            # optionally run concurrent
            if kw['concurrent']:
                return concurrent_yield(parse_tweet, tweets, **kw)

            else:
                return (parse_tweet(t) for t in tweets)
Ejemplo n.º 3
0
    def f(*args, **kw):
      
      # check kw's
      kw = validate_kw(kw, requires)

      # optionally connect to the api
      api = opt_connect(**kw)

      # add defautls to kw's
      kw = dict(kw.items() + default.items())

      # if were not paginating simply
      # run the function
      if not kw['paginate']:
        tweets = catch_err(func, api, **kw)
      else:
        tweets = paginate(func, api, **kw)

      # optionally run concurrent
      if kw['concurrent']:
        return concurrent_yield(parse_tweet, tweets, **kw)

      else:
        return (parse_tweet(t) for t in tweets)