# Path: lib/_db.py
# def get_collection(db_name, collection_name, client='mongo'):
# def get_db(db_name, client='mongo'):


from lib._db import redis_client as r
#!/usr/bin/env python
# -*- coding: utf-8 -*-



class IncrId(object):
    """IncrId 用redis实现的简单的自增id"""
    def __init__(self, key):
        self.key = '_'.join([key, self.__class__.__name__])

    def get(self):

# Path: lib/_db.py
# def get_collection(db_name, collection_name, client='mongo'):
# def get_db(db_name, client='mongo'):


# Path: crawler/lagou/utils.py
from lib._db import redis_client as r

#!/usr/bin/env python
# -*- coding: utf-8 -*-



class IncrId(object):
    """IncrId 用redis实现的简单的自增id"""
    def __init__(self, key):
        self.key = '_'.join([key, self.__class__.__name__])

    def get(self):

        return int(r.incr(self.key))