Skip to content

Commit 8a2cdc3

Browse files
committed
FIx pep8 on database.py file, refs #42
1 parent 391abcf commit 8a2cdc3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

database.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
13
import pymongo
24

5+
36
class MongoDb(object):
47

58
_fields = [
@@ -15,15 +18,15 @@ def __init__(self, address='localhost'):
1518
self._db = self._client.postmon
1619

1720
def get_one(self, cep, **kwargs):
18-
return self._db.ceps.find_one({ 'cep': cep }, **kwargs)
21+
return self._db.ceps.find_one({'cep': cep}, **kwargs)
1922

2023
def insert_or_update(self, obj, **kwargs):
2124

22-
update = { '$set': obj }
25+
update = {'$set': obj}
2326
empty_fields = set(self._fields) - set(obj)
2427
update['$unset'] = dict((x, 1) for x in empty_fields)
2528

26-
self._db.ceps.update({ 'cep': obj['cep'] }, update, upsert=True)
29+
self._db.ceps.update({'cep': obj['cep']}, update, upsert=True)
2730

2831
def remove(self, cep):
29-
self._db.ceps.remove({ 'cep': cep })
32+
self._db.ceps.remove({'cep': cep})

0 commit comments

Comments
 (0)