Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: 9b/pastycake
base: c0efc9888a
...
head fork: 9b/pastycake
compare: b9554ddc34
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
Commits on Mar 04, 2012
@coh2 coh2 * config: disabled the printing of a misleading exception.
* gather: fixed a bug where a non-keyword capable db would still be accessed
          like if it had the functionality.
* mongodb: all the known connection params should work now.
840a94c
@9b Merge pull request #34 from coh2/master
3 small improvements
b9554dd
View
4 pastycake/config.py
@@ -27,8 +27,8 @@ def _do_load(package, section_name, epname):
try:
return load_entry_point(package, section_name, epname)
except ImportError as e:
- print >> sys.stderr, 'failed to load entry point %s: %s' % (epname,
- e)
+ #print >> sys.stderr, 'failed to load entry point %s: %s' % (
+ # epname, e)
return None
if not section_name:
View
6 pastycake/gather.py
@@ -74,8 +74,10 @@ def _load_conf(args=None):
conf['backend'] = _backend_or_exit(conf['backend'])
backend = conf['backend']
- for _ in conf['keywords']:
- backend.enable_keyword(_ if not hasattr(_, '__call__') else _.__name__)
+ if isinstance(backend, KeywordStorage):
+ for _ in conf['keywords']:
+ backend.enable_keyword(_ if not hasattr(_, '__call__')
+ else _.__name__)
conf['modefunc'](conf)
View
10 pastycake/mongodb_backend.py
@@ -15,11 +15,9 @@ class MongoBackend(StorageBackend):
DEFAULT_PORT = 27017
DEFAULT_DB = 'pastycake'
- def __init__(self, db_name=DEFAULT_DB, host=DEFAULT_HOST,
- port=DEFAULT_PORT):
- self._db_name = db_name
- self._host = host
- self._port = port
+ def __init__(self, kwargs):
+ self._mongo_kwargs = kwargs
+ self._db_name = kwargs.get('db_name', self.DEFAULT_DB)
self._connected = False
def already_visited_url(self, url):
@@ -48,7 +46,7 @@ def _do_save_url(self, url, match_text):
def connect(self):
try:
- self._con = M.Connection(self._host, self._port)
+ self._con = M.Connection(**self._mongo_kwargs)
self._db = self._con[self._db_name]
self._connected = True
except M.errors.PyMongoError as e:

No commit comments for this range

Something went wrong with that request. Please try again.