def connect(self): 
        try:
            self.connection = pymongo.Connection(self.host, self.port)
            self.db = self.connection[self.name]
        except AutoReconnect:
            raise DatabaseException("It's not possible connect to the database")
def _kindpatsalwaysmatch(kindpats):
    """ "Checks whether the kindspats match everything, as e.g.
    'relpath:.' does.
    """
    for kind, pat, source in kindpats:
        # TODO: update me?
        if pat != "" or kind not in ["relpath", "glob"]:
            return False
    return True