def _get_font(self): font_name = self.font_name if not font_name: stop_alert("render native unable to find a valid font name, please use --font_name or pymterm.json to set font name") sys.exit(1) return GUI.Font(family=font_name, size=self.font_size)
def report_error(self): """Display an appropriate error message for the most recent exception caught.""" try: raise except Cancel: pass except ApplicationError, e: from GUI.Alerts import stop_alert stop_alert(str(e))
def _get_font(self): font_path = self.font_file if not font_path: stop_alert("render pygame unable to find a valid font file, please use --font_file or pymterm.json to set font file") sys.exit(1) if use_freetype: font = pygame.freetype.Font(font_path, self.font_size) else: font = pygame.font.Font(font_path, int(self.font_size)) return font
def _get_font(self): font_map = pangocairo.cairo_font_map_get_default() font_name = self.font_name if not font_name: stop_alert("render cairoe unable to find a valid font name, please use --font_name or pymterm.json to set font name") sys.exit(1) font = self._find_font_desc(font_name) if not font: font = pango.FontDescription(' '.join([font_name, str(self.font_size)])) else: font.set_size(int(float(self.font_size) * pango.SCALE * 72 / font_map.get_resolution()) + 1) return font
def _select_view_render(self): render = self.cfg.render _cls_view = None if render and render in self.cfg.gui_renders: _cls_view = self._try_import_render(render) if _cls_view: return _cls_view for render in self.cfg.gui_renders: _cls_view = self._try_import_render(render) if _cls_view: return _cls_view logging.getLogger('term_pygui').error("unable to find a valid render") stop_alert("unable to find a valid render, supported render:{}".format(self.cfg.renders))
def _select_view_render(self): render = self.cfg.render _cls_view = None if render and render in self.cfg.gui_renders: _cls_view = self._try_import_render(render) if _cls_view: return _cls_view for render in self.cfg.gui_renders: _cls_view = self._try_import_render(render) if _cls_view: return _cls_view logging.getLogger('term_pygui').error("unable to find a valid render") stop_alert("unable to find a valid render, supported render:{}".format( self.cfg.renders))
def _get_font(self): font_map = pangocairo.cairo_font_map_get_default() font_name = self.font_name if not font_name: stop_alert( "render cairoe unable to find a valid font name, please use --font_name or pymterm.json to set font name" ) sys.exit(1) font = self._find_font_desc(font_name) if not font: font = pango.FontDescription(' '.join( [font_name, str(self.font_size)])) else: font.set_size( int( float(self.font_size) * pango.SCALE * 72 / font_map.get_resolution()) + 1) return font
def do_stop_alert(): stop_alert("Too much tapioca.")
def report_error(self, msg): self.__alert_task = Task(lambda: stop_alert(msg), .001)
def report_error(self, msg): self.__alert_task = Task(lambda : stop_alert(msg), .001)