From a25e6a8e8261b5d2fc180583dc7aad6785c5371a Mon Sep 17 00:00:00 2001 From: fabiobatalha Date: Fri, 1 Sep 2017 10:47:50 -0300 Subject: [PATCH] Ajustes para uso de MONGODB URI --- exportsci.py | 14 +++++++------- setup.py | 2 +- tools.py | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/exportsci.py b/exportsci.py index 3c6dd07..7932c38 100644 --- a/exportsci.py +++ b/exportsci.py @@ -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 = { @@ -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 @@ -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, diff --git a/setup.py b/setup.py index e5e9b3d..a41f884 100644 --- a/setup.py +++ b/setup.py @@ -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="scielo-dev@googlegroups.com", diff --git a/tools.py b/tools.py index 833bf98..e9377e4 100644 --- a/tools.py +++ b/tools.py @@ -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)