From 9cd2754e1967ec5cd9055932f21e8689f75c0f8a Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Wed, 12 Oct 2011 20:18:48 +0000 Subject: [PATCH] Keep gtk out of includes, if possible svn: r18302 --- src/plugins/docgen/GtkPrint.py | 3 +-- src/plugins/lib/libcairodoc.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/docgen/GtkPrint.py b/src/plugins/docgen/GtkPrint.py index 9acd34043..c86c72c8a 100644 --- a/src/plugins/docgen/GtkPrint.py +++ b/src/plugins/docgen/GtkPrint.py @@ -45,7 +45,6 @@ from math import radians from gen.plug.docgen import PAPER_PORTRAIT import libcairodoc import Errors -from glade import Glade #import constfunc #------------------------------------------------------------------------ @@ -203,7 +202,7 @@ class PrintPreview(object): def __build_window(self): """Build the window from Glade. """ - + from glade import Glade glade_xml = Glade() self._window = glade_xml.toplevel #self._window.set_transient_for(parent) diff --git a/src/plugins/lib/libcairodoc.py b/src/plugins/lib/libcairodoc.py index 106a94b76..2d0860eb0 100644 --- a/src/plugins/lib/libcairodoc.py +++ b/src/plugins/lib/libcairodoc.py @@ -61,9 +61,7 @@ log = logging.getLogger(".libcairodoc") # GTK modules # #------------------------------------------------------------------------- -import gtk import pango -import pangocairo #------------------------------------------------------------------------ # @@ -102,6 +100,7 @@ font_families = _GNOME_FONT # FIXME debug logging does not work here. def set_font_families(): + import pangocairo ##def set_font_families(pango_context): """Set the used font families depending on availability. """ @@ -914,6 +913,7 @@ class GtkDocPicture(GtkDocBaseElement): return (None, self), 0 def draw(self, cr, layout, width, dpi_x, dpi_y): + import gtk img_width = self._width * dpi_x / 2.54 img_height = self._height * dpi_y / 2.54