Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
norstbox
gajim
Commits
37bd1142
Commit
37bd1142
authored
18 years ago
by
jimpp
Browse files
Options
Downloads
Patches
Plain Diff
Coding standards, include real date of 0.11 release in Changelog
parent
9178c9cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+1
-1
1 addition, 1 deletion
ChangeLog
src/htmltextview.py
+15
-15
15 additions, 15 deletions
src/htmltextview.py
with
16 additions
and
16 deletions
ChangeLog
+
1
−
1
View file @
37bd1142
Gajim 0.11 (
XX
December 2006)
Gajim 0.11 (
19
December 2006)
* New build system, using GNU autotools. See README.html
* Support for link-local messaging via Zeroconf using Avahi (XEP-0174)
* Automatically connect and disconnect to accounts according to network availability (if Network Manager is present)
...
...
This diff is collapsed.
Click to expand it.
src/htmltextview.py
+
15
−
15
View file @
37bd1142
...
...
@@ -50,7 +50,7 @@ __all__ = ['HtmlTextView']
whitespace_rx
=
re
.
compile
(
"
\\
s+
"
)
allwhitespace_rx
=
re
.
compile
(
"
^
\\
s*$
"
)
#
# pixels = points * display_resolution
# pixels = points * display_resolution
display_resolution
=
0.3514598
*
(
gtk
.
gdk
.
screen_height
()
/
float
(
gtk
.
gdk
.
screen_height_mm
()))
...
...
@@ -266,7 +266,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
else
:
#
#
Workaround http://bugzilla.gnome.org/show_bug.cgi?id=317455
# Workaround http://bugzilla.gnome.org/show_bug.cgi?id=317455
def
_get_current_style_attr
(
self
,
propname
,
comb_oper
=
None
):
tags
=
[
tag
for
tag
in
self
.
styles
if
tag
is
not
None
]
tags
.
reverse
()
...
...
@@ -311,10 +311,10 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
font_size
=
attrs
.
font
.
get_size
()
/
pango
.
SCALE
callback
(
frac
*
display_resolution
*
font_size
,
*
args
)
else
:
#
#
CSS says "Percentage values: refer to width of the closest
#
#
block-level ancestor"
#
#
This is difficult/impossible to implement, so we use
#
#
textview width instead; a reasonable approximation..
# CSS says "Percentage values: refer to width of the closest
# block-level ancestor"
# This is difficult/impossible to implement, so we use
# textview width instead; a reasonable approximation..
alloc
=
self
.
textview
.
get_allocation
()
self
.
__parse_length_frac_size_allocate
(
self
.
textview
,
alloc
,
frac
,
callback
,
args
)
...
...
@@ -331,8 +331,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
callback
(
float
(
value
[:
-
2
])
*
display_resolution
*
font_size
,
*
args
)
elif
value
.
endswith
(
'
ex
'
):
# x-height, ~ the height of the letter 'x'
#
#
FIXME: figure out how to calculate this correctly
#
#
for now 'em' size is used as approximation
# FIXME: figure out how to calculate this correctly
# for now 'em' size is used as approximation
attrs
=
self
.
_get_current_attributes
()
font_size
=
attrs
.
font
.
get_size
()
/
pango
.
SCALE
callback
(
float
(
value
[:
-
2
])
*
display_resolution
*
font_size
,
*
args
)
...
...
@@ -405,7 +405,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
tag
,
"
right-margin
"
)
def
_parse_style_font_weight
(
self
,
tag
,
value
):
#
#
TODO: missing 'bolder' and 'lighter'
# TODO: missing 'bolder' and 'lighter'
try
:
weight
=
{
'
100
'
:
pango
.
WEIGHT_ULTRALIGHT
,
...
...
@@ -469,7 +469,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
tag
.
set_property
(
"
wrap_mode
"
,
gtk
.
WRAP_NONE
)
#
#
build a dictionary mapping styles to methods, for greater speed
# build a dictionary mapping styles to methods, for greater speed
__style_methods
=
dict
()
for
style
in
[
"
background-color
"
,
"
color
"
,
"
font-family
"
,
"
font-size
"
,
"
font-style
"
,
"
font-weight
"
,
"
margin-left
"
,
"
margin-right
"
,
...
...
@@ -481,7 +481,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
else
:
__style_methods
[
style
]
=
method
del
style
#
#
--
# --
def
_get_style_tags
(
self
):
return
[
tag
for
tag
in
self
.
styles
if
tag
is
not
None
]
...
...
@@ -681,11 +681,11 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
self
.
_jump_line
()
elif
name
==
'
img
'
:
try
:
#
#
Max image size = 2 MB (to try to prevent DoS)
# Max image size = 2 MB (to try to prevent DoS)
mem
=
urllib2
.
urlopen
(
attrs
[
'
src
'
]).
read
(
2
*
1024
*
1024
)
#
#
Caveat: GdkPixbuf is known not to be safe to load
#
#
images from network... this program is now potentially
#
#
hackable ;)
# Caveat: GdkPixbuf is known not to be safe to load
# images from network... this program is now potentially
# hackable ;)
loader
=
gtk
.
gdk
.
PixbufLoader
()
loader
.
write
(
mem
);
loader
.
close
()
pixbuf
=
loader
.
get_pixbuf
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment