Skip to content

Commit

Permalink
[FIX] get_depends_modules: odoo-8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
moylop260 committed Apr 19, 2016
1 parent bcc837a commit e0aaf48
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions get_depends_modules.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import re
#logfile = "/Users/moylop260/Desktop/log1.log"
logfile = "/Users/moylop260/Desktop/log1_error.log"
re_module_log = "(: module )(?P<module>[\w,\-,\_]+):( loading )(?P<file>[\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<module>[\w,\-,\_]+):( creating or updating database tables)"
module_to_search_previous_depends = 'mail_notification_picking'

modules = []
files = []
with open(logfile, "r") as f:
for line in f.readlines():
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)

0 comments on commit e0aaf48

Please sign in to comment.