Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1.     def get_return_params(self):
  2.         return param_building_functions = {
  3.             country_code in ['FR'] + DOMTOM_CODES: lambda: self._build_return_params_EU(),
  4.             country_code in EU_RETURN_CODES: lambda: self._build_return_params_EU(product_code='CORI'),
  5.             country_code not in EU_CODES + DOMTOM_CODES: lambda: self._build_return_params_INT()
  6.         }
  7.  
  8.     def get_sending_params(self):
  9.         return param_building_functions = {
  10.             country_code in EU_CODES: lambda: self._build_sending_params_EU(),
  11.             country_code in DOMTOM_CODES: lambda: self._build_sending_params_EU(product_code='COM'),
  12.             country_code not in EU_CODES + DOMTOM_CODES: lambda: self._build_sending_params_INT()
  13.         }
  14.  
  15.     def build_params(self, param_building_functions):
  16.         country_code = self.order['shippingAddress']['countryCode']
  17.         for key, func in filter(lambda x: x[0], param_building_functions.items()):
  18.             func()
  19.  
  20. build_params(get_return_params())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement