A Qua, 2003-10-29 �s 17:24, Will Newton escreveu:
> This code does not work for me:
>
> import gnomeprint
> cfg = gnomeprint.config_default()
> print cfg.get_int(key=gnomeprint.KEY_PAGE_MARGIN_LEFT)
> print cfg.get_length(key=gnomeprint.KEY_PAGE_MARGIN_LEFT)
>
> get_int() works, but it returns a value in cm, which is not very useful when
> the context uses points for all calculations. It looks like get_length()
> should do what I want but I get this error:
>
> RuntimeError: more keyword list entries than argument specifiers
>
OK, this is a bug in the gnomeprint bindings. Patch that fixes it in
[1]. Then, try the following code:
(...)
>>> value, unit = cfg.get_length(key=gnomeprint.KEY_PAGE_MARGIN_LEFT)
>>> print gnomeprint.convert_distance(value, unit,
gnomeprint.unit_get_by_name("point"))
56.6929133858
Regards.
[1] http://bugzilla.gnome.org/show_bug.cgi?id=125794
--
Gustavo Jo�o Alves Marques Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/