From be640d3a1f33634e11e7b72c13db74e4dc0be0c4 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 21 Jun 2011 14:52:55 +0530 Subject: [PATCH] [IMP]import_google : Improvement in get_data() bzr revid: dbr@tinyerp.com-20110621092255-opxr9s421w1ezfo8 --- addons/import_google/wizard/import_google.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/addons/import_google/wizard/import_google.py b/addons/import_google/wizard/import_google.py index a0dc08cbba0..b200661335b 100644 --- a/addons/import_google/wizard/import_google.py +++ b/addons/import_google/wizard/import_google.py @@ -67,19 +67,13 @@ class google_import(import_framework): } def get_data(self, table): - if table == "Contact": - val = { - self.TABLE_CONTACT: self.get_contact(), - } - if table == "Address": - val = { - self.TABLE_ADDRESS: self.get_contact(), - } - elif table == "Events": - val = { - self.TABLE_EVENT: self.get_events(), - } - return val.get(table) + data_fetching_function = { + self.TABLE_CONTACT: self.get_contact, + self.TABLE_ADDRESS: self.get_contact, + self.TABLE_EVENT: self.get_events, + } + + return data_fetching_function.get(table)() def _get_tinydates(self, stime, etime,context):