diff options
Diffstat (limited to 'python/rvilib.py')
-rw-r--r-- | python/rvilib.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/rvilib.py b/python/rvilib.py index 647e333..8d2551c 100644 --- a/python/rvilib.py +++ b/python/rvilib.py @@ -44,7 +44,7 @@ class RVI(SimpleJSONRPCServer): # Arguments will be an array of fully qualified service names no longer available. def set_services_unavailable_callback(self, function): self.register_function(function, 'services_unavailable') - + def get_available_services(self): # We need at least one dummy argument for the RPC to go # through on the RVI side. @@ -107,6 +107,9 @@ class RVI(SimpleJSONRPCServer): # def unregister_service(self, service_name): + if service_name[0] != '/': + service_name = '/' + service_name + # Check that the service has been previously registered # If not just return if service_name not in self.registered_services: @@ -153,8 +156,8 @@ class RVI(SimpleJSONRPCServer): # Redefined shutdown method that first unregisters all services. # def shutdown(self): - for service in self.registered_services: - self.unregister_service(service) + for svc in self.registered_services.keys(): + self.unregister_service(svc) SimpleJSONRPCServer.shutdown(self) |