@@ -164,7 +164,7 @@ def _update_client_version(self):
164164 version_file = os .path .join (path , client_version_file )
165165
166166 try :
167- version = open (version_file , 'rb ' )
167+ version = open (version_file , 'r ' )
168168 client_version = version .read ()
169169 version .close ()
170170 version_number = client_version .rstrip ()[len ('version: ' ):]
@@ -224,7 +224,7 @@ def _update_locale_mapping(self):
224224 locale_map = self .process_locales (locales )
225225 self .remote_config .update ({'locale_map' : locale_map })
226226
227- def _update_project_type (self ):
227+ def update_project_type (self ):
228228 """
229229 This fetches project_type from server
230230 """
@@ -271,7 +271,7 @@ def get_remote_configs(self):
271271 """
272272 context_remote_configs = {
273273 'default' : [self ._update_server_version , self ._update_locale_mapping ,
274- self ._update_project_type ],
274+ self .update_project_type ],
275275 'init' : [],
276276 }
277277 return context_remote_configs [self .mode ]
@@ -287,14 +287,18 @@ def get_context_data(self):
287287 """
288288 updates context_data with remote_config, local_config and command_dict
289289 """
290+
291+ def merge_dicts (i , j ):
292+ z = i .copy ()
293+ z .update (j )
294+ return z
295+
290296 build_configs = [self .build_local_config ,
291297 self .build_remote_config ]
292298 [method () for method in build_configs ]
293- # lowest to higest
299+ # lowest to highest
294300 precedence = [self .remote_config , self .local_config , self .command_dict ]
295- context_data = functools .reduce (
296- lambda option , value : dict (option .items () + value .items ()), precedence
297- )
301+ context_data = functools .reduce (lambda option , value : merge_dicts (option , value ), precedence )
298302 return self .filter_context_data (context_data )
299303
300304 def filter_context_data (self , data ):
0 commit comments