Changeset 7845 for branches/gajim_0.11/src
- Timestamp:
- 01/16/07 19:21:46 (23 months ago)
- Location:
- branches/gajim_0.11/src
- Files:
-
- 2 modified
-
common/config.py (modified) (1 diff)
-
htmltextview.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11/src/common/config.py
r7841 r7845 98 98 'remove */_ . So *abc* will be bold but with * * not removed.')], 99 99 'rst_formatting_outgoing_messages': [ opt_bool, False, 100 _('Uses ReStructured text markup for HTML, plus ascii formatting if selected.(If you want to use this, install docutils)')],100 _('Uses ReStructured text markup to send HTML, plus ascii formatting if selected. For syntax, see http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html (If you want to use this, install docutils)')], 101 101 'sounds_on': [ opt_bool, True ], 102 102 # 'aplay', 'play', 'esdplay', 'artsplay' detected first time only -
branches/gajim_0.11/src/htmltextview.py
r7829 r7845 51 51 allwhitespace_rx = re.compile("^\\s*$") 52 52 53 # #pixels = points * display_resolution53 # pixels = points * display_resolution 54 54 display_resolution = 0.3514598*(gtk.gdk.screen_height() / 55 55 float(gtk.gdk.screen_height_mm())) … … 267 267 else: 268 268 269 # #Workaround http://bugzilla.gnome.org/show_bug.cgi?id=317455269 # Workaround http://bugzilla.gnome.org/show_bug.cgi?id=317455 270 270 def _get_current_style_attr(self, propname, comb_oper=None): 271 271 tags = [tag for tag in self.styles if tag is not None] … … 312 312 callback(frac*display_resolution*font_size, *args) 313 313 else: 314 # #CSS says "Percentage values: refer to width of the closest315 # #block-level ancestor"316 # #This is difficult/impossible to implement, so we use317 # #textview width instead; a reasonable approximation..314 # CSS says "Percentage values: refer to width of the closest 315 # block-level ancestor" 316 # This is difficult/impossible to implement, so we use 317 # textview width instead; a reasonable approximation.. 318 318 alloc = self.textview.get_allocation() 319 319 self.__parse_length_frac_size_allocate(self.textview, alloc, … … 332 332 333 333 elif value.endswith('ex'): # x-height, ~ the height of the letter 'x' 334 # #FIXME: figure out how to calculate this correctly335 # #for now 'em' size is used as approximation334 # FIXME: figure out how to calculate this correctly 335 # for now 'em' size is used as approximation 336 336 attrs = self._get_current_attributes() 337 337 font_size = attrs.font.get_size() / pango.SCALE … … 406 406 407 407 def _parse_style_font_weight(self, tag, value): 408 # #TODO: missing 'bolder' and 'lighter'408 # TODO: missing 'bolder' and 'lighter' 409 409 try: 410 410 weight = { … … 470 470 471 471 472 # #build a dictionary mapping styles to methods, for greater speed472 # build a dictionary mapping styles to methods, for greater speed 473 473 __style_methods = dict() 474 474 for style in ["background-color", "color", "font-family", "font-size", … … 482 482 __style_methods[style] = method 483 483 del style 484 # #--484 # -- 485 485 486 486 def _get_style_tags(self): … … 682 682 elif name == 'img': 683 683 try: 684 # # Max image size = 10MB (to try to prevent DoS)685 mem = urllib2.urlopen(attrs['src']).read( 10*1024*1024)686 # #Caveat: GdkPixbuf is known not to be safe to load687 # #images from network... this program is now potentially688 # #hackable ;)684 # Max image size = 2 MB (to try to prevent DoS) 685 mem = urllib2.urlopen(attrs['src']).read(2*1024*1024) 686 # Caveat: GdkPixbuf is known not to be safe to load 687 # images from network... this program is now potentially 688 # hackable ;) 689 689 loader = gtk.gdk.PixbufLoader() 690 690 loader.write(mem); loader.close()
