Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorFrederic Leger2014-03-13 11:47:44 -0400
committerFrederic Leger2014-03-13 11:47:44 -0400
commitb98b7259bb0588a4189ea87716950b342d47109e (patch)
treec1f0ae1df0501dd3c4452d8eb82bcf6789ed71f0 /python
parent7a6c994129d8966017a00a3062cc018a1e79355f (diff)
downloadorg.eclipse.tcf-b98b7259bb0588a4189ea87716950b342d47109e.tar.gz
org.eclipse.tcf-b98b7259bb0588a4189ea87716950b342d47109e.tar.xz
org.eclipse.tcf-b98b7259bb0588a4189ea87716950b342d47109e.zip
Python documentation.
Most of this modification is for documentation. The DefaultServiceProvider class also relies on its module name rather than on a hard coded value to determine the proxies module names.
Diffstat (limited to 'python')
-rw-r--r--python/src/tcf/services/__init__.py34
1 files changed, 25 insertions, 9 deletions
diff --git a/python/src/tcf/services/__init__.py b/python/src/tcf/services/__init__.py
index f9c87dd52..e2e92514a 100644
--- a/python/src/tcf/services/__init__.py
+++ b/python/src/tcf/services/__init__.py
@@ -18,8 +18,7 @@ _lock = threading.RLock()
class ServiceProvider(object):
- """
- Clients can implement this abstract class if they want to provide
+ """Clients can implement this abstract class if they want to provide
implementation of a local service or remote service proxy.
"""
@@ -92,14 +91,31 @@ class GenericCallback(object):
class Service(object):
-
+ """TCF service base class."""
def getName(self):
+ """Abstract method to get the service name.
+
+ :returns: This service name
+ """
raise NotImplementedError("Abstract method")
def __str__(self):
+ """TCF service string representation.
+
+ :returns: The name of the service.
+ """
return self.getName()
def _makeCallback(self, done):
+ """Turn *done* into a callable.
+
+ If *done* is already a :class:`collections.Callable`, it is returned
+ as is, else, it is made callable, and returned.
+
+ :param done: The item to make callable.
+
+ :returns: The callable value of *done*
+ """
if isinstance(done, collections.Callable):
return GenericCallback(done)
return done
@@ -111,11 +127,11 @@ class ZeroCopy(Service):
class GenericProxy(Service):
- """
- * Objects of GenericProxy class represent remote services, which don't
- * have a proxy class defined for them.
- * Clients still can use such services, but framework will not provide
- * service specific utility methods for message formatting and parsing.
+ """Objects of GenericProxy class represent remote services, which don't
+ have a proxy class defined for them.
+
+ Clients still can use such services, but framework will not provide
+ service specific utility methods for message formatting and parsing.
"""
def __init__(self, channel, name):
@@ -130,7 +146,7 @@ class GenericProxy(Service):
class DefaultServiceProvider(ServiceProvider):
- package_base = "tcf.services.remote"
+ package_base = str(__package__) + ".remote"
def getLocalService(self, channel):
# TODO DiagnosticsService

Back to the top