changeset 436:73f767a9ac2f

server_side: added constant SERVICE_PROFILE to remove hard-coded value
author souliane <souliane@mailoo.org>
date Thu, 01 May 2014 11:31:51 +0200
parents e63fc04efef7
children fa3b65b68971
files constants.py libervia_server/blog.py
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/constants.py	Tue May 06 18:06:38 2014 +0200
+++ b/constants.py	Thu May 01 11:31:51 2014 +0200
@@ -24,6 +24,7 @@
 class Const(constants.Const):
 
     APP_NAME = 'Libervia'
+    SERVICE_PROFILE = 'libervia'  # the SàT profile that is used for exporting the service
 
     TIMEOUT = 300  # Session's time out, after that the user will be disconnected
     LIBERVIA_DIR = "output/"
--- a/libervia_server/blog.py	Tue May 06 18:06:38 2014 +0200
+++ b/libervia_server/blog.py	Thu May 01 11:31:51 2014 +0200
@@ -48,8 +48,9 @@
     def __init__(self, host):
         self.host = host
         Resource.__init__(self)
-        if not host.bridge.isConnected("libervia"):  # FIXME: hard coded value for test
-            host.bridge.connect("libervia")
+        # FIXME: this can be move to the beginning of Libervia.startService to avoid an initialization issue
+        if not host.bridge.isConnected(C.SERVICE_PROFILE):
+            host.bridge.connect(C.SERVICE_PROFILE)
 
     def render_GET(self, request):
         if not request.postpath: