changeset 861:5cefc6ab302f

server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
author Goffi <goffi@goffi.org>
date Mon, 25 Jan 2016 16:41:38 +0100
parents 05cd9dc775e6
children e3e2effc9a4c
files src/__init__.py src/common/constants.py src/server/constants.py
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/__init__.py	Mon Jan 25 16:39:40 2016 +0100
+++ b/src/__init__.py	Mon Jan 25 16:41:38 2016 +0100
@@ -1,3 +1,6 @@
-from server.constants import Const as C
-
-__version__ = C.APP_VERSION
+try:
+    from common.constants import Const as C
+except ImportError:
+    pass # import doesn't work at this stage with pyjamas
+else:
+    __version__ = C.APP_VERSION
--- a/src/common/constants.py	Mon Jan 25 16:39:40 2016 +0100
+++ b/src/common/constants.py	Mon Jan 25 16:41:38 2016 +0100
@@ -23,6 +23,9 @@
 
 class Const(constants.Const):
 
+    # XXX: we don't want to use the APP_VERSION inherited from sat.core.constants version
+    #      as we use this version to check that there is not a mismatch with backend
+    APP_VERSION = u'0.6.0D'  # Please add 'D' at the end for dev versions
     LIBERVIA_MAIN_PAGE = "libervia.html"
 
     # MISC
--- a/src/server/constants.py	Mon Jan 25 16:39:40 2016 +0100
+++ b/src/server/constants.py	Mon Jan 25 16:41:38 2016 +0100
@@ -24,9 +24,6 @@
 
     APP_NAME = 'Libervia'
     APP_NAME_FILE = "libervia"
-    # XXX: we don't want to use the APP_VERSION inherited from sat.core.constants version
-    #      as we use this version to check that there is not a mismatch with backend
-    APP_VERSION = u'0.6.0D'  # Please add 'D' at the end for dev versions
     SERVICE_PROFILE = 'libervia'  # the SàT profile that is used for exporting the service
 
     SESSION_TIMEOUT = 300  # Session's timeout, after that the user will be disconnected