comparison src/browser/libervia_main.py @ 613:deddd1cd8aa5 frontends_multi_profiles

browser side: added a base_location property to get location of current Libervia instance
author Goffi <goffi@goffi.org>
date Tue, 10 Feb 2015 20:42:39 +0100
parents ec77c2bc18d3
children 14bdf5394ae9
comparison
equal deleted inserted replaced
612:5983d6be4f07 613:deddd1cd8aa5
109 return self.profiles[C.PROF_KEY_NONE].whoami 109 return self.profiles[C.PROF_KEY_NONE].whoami
110 110
111 @property 111 @property
112 def contact_list(self): 112 def contact_list(self):
113 return self.contact_lists[C.PROF_KEY_NONE] 113 return self.contact_lists[C.PROF_KEY_NONE]
114
115 @property
116 def base_location(self):
117 """Return absolute base url of this Libervia instance"""
118 url = Window.getLocation().getHref()
119 if url.endswith(C.LIBERVIA_MAIN_PAGE):
120 url = url[:-len(C.LIBERVIA_MAIN_PAGE)]
121 if url.endswith("/"):
122 url = url[:-1]
123 return url
114 124
115 def registerSignal(self, functionName, handler=None, iface="core", with_profile=True): 125 def registerSignal(self, functionName, handler=None, iface="core", with_profile=True):
116 if handler is None: 126 if handler is None:
117 callback = getattr(self, "{}{}".format(functionName, "Handler")) 127 callback = getattr(self, "{}{}".format(functionName, "Handler"))
118 else: 128 else: