def on_languagebar_realize(self, widget): try: size = open(os.path.join(CONFIG_ROOT, 'gimpanel-state')).read().strip() x, y = size.split() self.panel_x, self.panel_y = int(x), int(y) except Exception, e: log_traceback(log)
def on_languagebar_destroy(self, widget): try: f = open(os.path.join(CONFIG_ROOT, 'gimpanel-state'), 'w') f.write("%d %d" % (self.panel_x, self.panel_y)) f.close() except Exception, e: log_traceback(log)
def on_languagebar_realize(self, widget): try: with open(os.path.join(CONFIG_ROOT, 'gimpanel-state'), 'w+') as f: size = f.read().strip() if size: x, y = size.split() self.panel_x, self.panel_y = int(x), int(y) except Exception, e: log_traceback(log)
def is_default_im(self): #TODO do not hard code try: value = self.get_property('im').split(':')[2] log.debug("Current IM: %s" % value) return value == 'fcitx-kbd' except Exception, e: log_traceback(log) return True
def _init_languagebar_position(self): try: with open(os.path.join(CONFIG_ROOT, 'gimpanel-state')) as f: size = f.read().strip() if size: x, y = size.split() self.panel_x, self.panel_y = int(x), int(y) except Exception, e: log_traceback(log)
def is_default_im(self): #TODO do not hard code try: value = self.get_property('im').split(':')[2] if value != 'fcitx-kbd': return True else: return False except Exception, e: log_traceback(log) return True
def on_languagebar_destroy(self, widget): try: with open(os.path.join(CONFIG_ROOT, 'gimpanel-state'), 'w') as f: f.write("%d %d" % (self.panel_x, self.panel_y)) except Exception, e: log_traceback(log)
def get_current_im_icon_name(self): try: return self.get_property('im').split(':')[2] except Exception, e: log_traceback(log) return ''