Skip to content

Commit

Permalink
Ajustes para uso de MONGODB URI
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobatalha committed Sep 1, 2017
1 parent 2284b03 commit a25e6a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions exportsci.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
FTP_USER = settings['ftp_user']
FTP_PASSWD = settings['ftp_passwd']
MONGODB_HOST = settings['mongodb_host']
MONGODB_PORT = int(settings['mongodb_port'])
MONGODB_SLAVEOK = bool(settings['mongodb_slaveok'])


def _config_logging(logging_level='INFO', logging_file=None):

allowed_levels = {
Expand Down Expand Up @@ -63,9 +63,9 @@ def run(task='add', clean_garbage=False, normalize=True):
exit()

# Setup a connection to SciELO Network Collection
logger.debug("Connecting to mongodb with DataHandler thru %s:%s" % (MONGODB_HOST, MONGODB_PORT))
logger.debug("Connecting to mongodb with DataHandler thru %s" % (MONGODB_HOST))

dh = tools.DataHandler(MONGODB_HOST, MONGODB_PORT)
dh = tools.DataHandler(MONGODB_HOST)

now = datetime.now().isoformat()[0:10]
index_issn = 0
Expand Down Expand Up @@ -96,10 +96,10 @@ def run(task='add', clean_garbage=False, normalize=True):

issns = tools.load_journals_list(journals_file='controller/keepinto.txt')

# logger.debug("Remove previous inbound files")
# tools.remove_previous_unbound_files_from_ftp(ftp_host=FTP_HOST,
# user=FTP_USER,
# passwd=FTP_PASSWD)
logger.debug("Remove previous inbound files")
tools.remove_previous_unbound_files_from_ftp(ftp_host=FTP_HOST,
user=FTP_USER,
passwd=FTP_PASSWD)

logger.debug("Syncing XML's status according to WoS validated files")
tools.get_sync_file_from_ftp(ftp_host=FTP_HOST,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name="exportsci",
version='0.3.7',
version='0.4.0',
description="Export metadata to SciELO CI",
author="SciELO",
author_email="[email protected]",
Expand Down
3 changes: 2 additions & 1 deletion tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ def __init__(
mongodb_collection='articles'
):

db = MongoClient(mongodb_host, mongodb_port)[mongodb_database]
import pdb; pdb.set_trace()
db = MongoClient(mongodb_host)[mongodb_database]

self._articles_coll = self._set_articles_coll(db)
self._collections_coll = self._set_collections_coll(db)
Expand Down

0 comments on commit a25e6a8

Please sign in to comment.