From e0aaf482f8c5a368d593638e0bf892dbb6b51442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20L=C3=B3pez?= Date: Tue, 19 Apr 2016 00:26:10 -0500 Subject: [PATCH] [FIX] get_depends_modules: odoo-8.0 --- get_depends_modules.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/get_depends_modules.py b/get_depends_modules.py index 6802c7c..da66f14 100644 --- a/get_depends_modules.py +++ b/get_depends_modules.py @@ -1,10 +1,10 @@ import re - -#logfile = "/Users/moylop260/Desktop/log1.log" -logfile = "/Users/moylop260/Desktop/log1_error.log" -re_module_log = "(: module )(?P[\w,\-,\_]+):( loading )(?P[\w,-,_/.]+)" -module_to_search_previous_depends = 'sale_stock' - + + +logfile = "/Users/moylop260/Downloads/job_20_test_all.txt" +re_module_log = r"( openerp.modules.module: module )(?P[\w,\-,\_]+):( creating or updating database tables)" +module_to_search_previous_depends = 'mail_notification_picking' + modules = [] files = [] with open(logfile, "r") as f: @@ -12,11 +12,12 @@ match_object = re.search( re_module_log, line ) if match_object: module = match_object.group("module") - if not module in modules: + if not module in modules: modules.append( module ) - files.append( module + '/' + match_object.group("file") ) - + # files.append( module + '/' + match_object.group("file") ) + if module_to_search_previous_depends in modules: - print ','.join( modules[ :modules.index('sale_stock') +1 ] ) + print ','.join( + modules[:modules.index(module_to_search_previous_depends) + 1] ) -print '\n'.join(files) +# print '\n'.join(files)