comparison browser_side/contact.py @ 439:d52f529a6d42

browser side: use of new log system (first draft): - configuration is hardcoded in libervia.py, it will change in the (hopefuly) near future - log level is DEBUG for the moment, will be changed to INFO when configuration will not be hardcoded anymore - the basic log backend is used, in the future, a console.debug/info/etc should be used instead. A log widget which HTML colors is also an option
author Goffi <goffi@goffi.org>
date Thu, 08 May 2014 17:21:34 +0200
parents 7a8991cda2fa
children
comparison
equal deleted inserted replaced
438:582c435dab6b 439:d52f529a6d42
16 16
17 # You should have received a copy of the GNU Affero General Public License 17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 import pyjd # this is dummy in pyjs 20 import pyjd # this is dummy in pyjs
21 from sat.core.log import getLogger
22 log = getLogger(__name__)
21 from pyjamas.ui.SimplePanel import SimplePanel 23 from pyjamas.ui.SimplePanel import SimplePanel
22 from pyjamas.ui.ScrollPanel import ScrollPanel 24 from pyjamas.ui.ScrollPanel import ScrollPanel
23 from pyjamas.ui.VerticalPanel import VerticalPanel 25 from pyjamas.ui.VerticalPanel import VerticalPanel
24 from pyjamas.ui.ClickListener import ClickHandler 26 from pyjamas.ui.ClickListener import ClickHandler
25 from pyjamas.ui.Label import Label 27 from pyjamas.ui.Label import Label
262 def onWindowResized(self, width, height): 264 def onWindowResized(self, width, height):
263 contact_panel_elt = self.getElement() 265 contact_panel_elt = self.getElement()
264 classname = 'widgetsPanel' if isinstance(self.getParent().getParent(), UniBoxPanel) else'gwt-TabBar' 266 classname = 'widgetsPanel' if isinstance(self.getParent().getParent(), UniBoxPanel) else'gwt-TabBar'
265 _elts = doc().getElementsByClassName(classname) 267 _elts = doc().getElementsByClassName(classname)
266 if not _elts.length: 268 if not _elts.length:
267 print ("ERROR: no element of class %s found, it should exist !" % classname) 269 log.error("no element of class %s found, it should exist !" % classname)
268 tab_bar_h = height 270 tab_bar_h = height
269 else: 271 else:
270 tab_bar_h = DOM.getAbsoluteTop(_elts.item(0)) or height # getAbsoluteTop can be 0 if tabBar is hidden 272 tab_bar_h = DOM.getAbsoluteTop(_elts.item(0)) or height # getAbsoluteTop can be 0 if tabBar is hidden
271 273
272 ideal_height = tab_bar_h - DOM.getAbsoluteTop(contact_panel_elt) - 5 274 ideal_height = tab_bar_h - DOM.getAbsoluteTop(contact_panel_elt) - 5