[gnome-applets] invest-applet: import correct PanelApplet version
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] invest-applet: import correct PanelApplet version
- Date: Fri, 19 Sep 2014 11:11:19 +0000 (UTC)
commit 7f44f09f37d8ebaff05e1c65588bff6053e8c67a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Fri Sep 19 13:57:56 2014 +0300
invest-applet: import correct PanelApplet version
configure.ac | 7 +++++--
invest-applet/invest/defs.py.in | 1 +
invest-applet/invest/invest-applet.py | 8 +++++++-
3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1f4c2d0..595ac4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,6 +129,9 @@ fi
AC_MSG_NOTICE([installing applets in $LIBPANEL_APPLET_DIR])
AC_SUBST(LIBPANEL_APPLET_DIR)
+LIBPANEL_APPLET_API_VERSION=`$PKG_CONFIG --variable=libpanel_applet_api_version libpanelapplet-4.0`
+AC_SUBST(LIBPANEL_APPLET_API_VERSION)
+
dnl -- check for libgtop (optional) -------------------------------------------
build_gtop_applets=false
PKG_CHECK_MODULES(GTOP_APPLETS,
@@ -242,7 +245,7 @@ AC_SUBST(GUCHARMAP_CFLAGS)
AC_SUBST(GUCHARMAP_LIBS)
dnl -- check for Python/GNOME modules (optional) ------------------------------
-PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0, HAVE_PYGOBJECT="yes", HAVE_PYGOBJECT="no")
+PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0, HAVE_PYGOBJECT=yes, HAVE_PYGOBJECT=no)
dnl -- check for libxml2 (required) ------------------------------------------
PKG_CHECK_MODULES(XML2, libxml-2.0 >= $LIBXML_REQUIRED)
@@ -701,7 +704,7 @@ gnome-applets-$VERSION configure summary:
- drivemount always
- geyes always
- gweather $build_libgweather_applets
- - invest-applet $BUILD_INVEST_APPLET
+ - invest-applet $HAVE_PYGOBJECT
- mini-commander $enable_mini_commander
- modemlights $BUILD_MODEM_LIGHTS
- mixer $enable_mixer
diff --git a/invest-applet/invest/defs.py.in b/invest-applet/invest/defs.py.in
index 97fa171..febb01c 100644
--- a/invest-applet/invest/defs.py.in
+++ b/invest-applet/invest/defs.py.in
@@ -7,3 +7,4 @@ PYTHONDIR = "@PYTHONDIR@"
GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"
GNOMELOCALEDIR = "@GNOMELOCALEDIR@"
BUILDERDIR = "@BUILDERDIR@"
+LIBPANEL_APPLET_API_VERSION = "@LIBPANEL_APPLET_API_VERSION@"
diff --git a/invest-applet/invest/invest-applet.py b/invest-applet/invest/invest-applet.py
index 5951fcc..f7fb2fc 100755
--- a/invest-applet/invest/invest-applet.py
+++ b/invest-applet/invest/invest-applet.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-from gi.repository import GObject, Gtk, PanelApplet
+from gi.repository import GObject, Gtk
import getopt, sys
from os.path import *
@@ -15,6 +15,12 @@ if _check(name):
else:
sys.path.insert(0, abspath("@PYTHONDIR@"))
+from invest.defs import LIBPANEL_APPLET_API_VERSION
+
+import gi
+gi.require_version('PanelApplet', LIBPANEL_APPLET_API_VERSION)
+from gi.repository import PanelApplet
+
# Now the path is set, import our applet
import invest, invest.applet, invest.defs, invest.help, invest.networkmanager
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]