Avoid misleading warning every time an activity starts (#4266)
This commit is contained in:
		
							parent
							
								
									4f41f300d8
								
							
						
					
					
						commit
						3227653cd3
					
				
							
								
								
									
										1
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								NEWS
									
									
									
									
									
								
							| @ -1,3 +1,4 @@ | |||||||
|  | * #4266 Avoid misleading warning every time an activity starts (smcv) | ||||||
| * #4027 Try to make sugar.presence log messages less misleading (smcv) | * #4027 Try to make sugar.presence log messages less misleading (smcv) | ||||||
| 
 | 
 | ||||||
| Snapshot 24fbd1ce1c | Snapshot 24fbd1ce1c | ||||||
|  | |||||||
| @ -318,9 +318,11 @@ class Activity(Window, gtk.Container): | |||||||
|             self._jobject = None |             self._jobject = None | ||||||
| 
 | 
 | ||||||
|         # handle activity share/join |         # handle activity share/join | ||||||
|         mesh_instance = self._pservice.get_activity(self._activity_id) |         mesh_instance = self._pservice.get_activity(self._activity_id, | ||||||
|         logging.debug("*** Act %s, mesh instance %r, scope %s" % (self._activity_id, mesh_instance, share_scope)) |                                                     warn_if_none=False) | ||||||
|         if mesh_instance: |         logging.debug("*** Act %s, mesh instance %r, scope %s", | ||||||
|  |                       self._activity_id, mesh_instance, share_scope) | ||||||
|  |         if mesh_instance is not None: | ||||||
|             # There's already an instance on the mesh, join it |             # There's already an instance on the mesh, join it | ||||||
|             logging.debug("*** Act %s joining existing mesh instance %r", self._activity_id, mesh_instance) |             logging.debug("*** Act %s joining existing mesh instance %r", self._activity_id, mesh_instance) | ||||||
|             self._shared_activity = mesh_instance |             self._shared_activity = mesh_instance | ||||||
|  | |||||||
| @ -302,7 +302,7 @@ class PresenceService(gobject.GObject): | |||||||
|              error_handler=lambda e:self._get_activities_error_cb(error_handler, e)) |              error_handler=lambda e:self._get_activities_error_cb(error_handler, e)) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     def get_activity(self, activity_id): |     def get_activity(self, activity_id, warn_if_none=True): | ||||||
|         """Retrieve single Activity object for the given unique id |         """Retrieve single Activity object for the given unique id | ||||||
| 
 | 
 | ||||||
|         activity_id -- unique ID for the activity |         activity_id -- unique ID for the activity | ||||||
| @ -313,10 +313,9 @@ class PresenceService(gobject.GObject): | |||||||
|         try: |         try: | ||||||
|             act_op = self._ps.GetActivityById(activity_id) |             act_op = self._ps.GetActivityById(activity_id) | ||||||
|         except dbus.exceptions.DBusException, err: |         except dbus.exceptions.DBusException, err: | ||||||
|             _logger.warn( |             if warn_if_none: | ||||||
|                 """Unable to retrieve activity handle for %r from presence service: %s""" |                 _logger.warn("Unable to retrieve activity handle for %r from " | ||||||
|                 % (activity_id, err) |                              "presence service: %s", activity_id, err) | ||||||
|             ) |  | ||||||
|             return None |             return None | ||||||
|         return self._new_object(act_op) |         return self._new_object(act_op) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Simon McVittie
						Simon McVittie