diff --git a/config.py b/config.py index 2cbe003..0a6c1b1 100644 --- a/config.py +++ b/config.py @@ -14,11 +14,14 @@ with open(".modelignore", "r") as file: conf_files = os.listdir( CONFDIR ) -keyword = 'your_keyword' +COLS = { + '': [ 'id', 'name', 'create_uid' ], # default +} + for file in conf_files: if os.path.isfile( os.path.join(CONFDIR,file) ): if file.endswith('.tsv'): - eprint( 'Conf file: ', file ) + # eprint( 'Conf file: ', file ) f = open( os.path.join(CONFDIR,file), 'r' ) - eprint( file[:-4], f.split() ) + COLS[file[:-4]] = f.read().split() f.close() \ No newline at end of file diff --git a/renderers.py b/renderers.py index cdd8408..dea9b3a 100644 --- a/renderers.py +++ b/renderers.py @@ -1,12 +1,14 @@ from __future__ import print_function import json as JSON +from config import * # TABLE VIEW COLUMNS -cols = { - '': [ 'id', 'name', 'create_uid' ], # default - 'ir.model': [ 'id', 'model' ], - 'ir.model.fields': [ 'id', 'name', 'ttype', 'create_uid', 'relation', 'display_name', 'complete_name' ], -} +# cols = { +# '': [ 'id', 'name', 'create_uid' ], # default +# 'ir.model': [ 'id', 'model' ], +# 'ir.model.fields': [ 'id', 'name', 'ttype', 'create_uid', 'relation', 'display_name', 'complete_name' ], +# 'ir.module.module': [ 'id', 'name', 'display_name', 'application', 'write_uid', 'write_date', 'dependencies_id' ], +# } import os # import locale @@ -38,10 +40,10 @@ def json( obj ): def render_tsv( model, list ): - if model in cols: - _cols = cols[model] + if model in COLS: + _cols = COLS[model] else: - _cols = cols[''] + _cols = COLS[''] tsv( *_cols ) @@ -50,10 +52,10 @@ def render_tsv( model, list ): def render_csv( model, list ): - if model in cols: - _cols = cols[model] + if model in COLS: + _cols = COLS[model] else: - _cols = cols[''] + _cols = COLS[''] csv( *_cols )