[Xfce4-commits] [xfce/libxfce4util] 02/02: Add a super basic python example

noreply at xfce.org noreply at xfce.org
Sat Jun 24 19:34:12 CEST 2017


This is an automated email from the git hooks/post-receive script.

e   r   i   c       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/libxfce4util.

commit 25cf4ef6b157193de66a60ea0eb2fce05ad9c33e
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Jun 24 10:50:35 2017 +0300

    Add a super basic python example
---
 .gitignore                           |  2 ++
 python-example/test-introspection.py | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/.gitignore b/.gitignore
index 2b94efd..2cecfe0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,3 +47,5 @@ libxfce4util/libxfce4util-config.h
 libxfce4util/test-suite.log
 xfce4-kiosk-query/xfce4-kiosk-query
 xfce4-kiosk-query/xfce4_kiosk_query-main.o
+
+python-example/html/
diff --git a/python-example/test-introspection.py b/python-example/test-introspection.py
new file mode 100755
index 0000000..959521d
--- /dev/null
+++ b/python-example/test-introspection.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+# You can generate python documentation with the following commands:
+# g-ir-doc-tool --language Python -o ./html ../libxfce4util/libxfce4util-1.0.gir
+# yelp ./html/
+
+import gi.repository
+# Set the search path to use the newly generated introspection files
+gi.require_version('GIRepository', '2.0')
+from gi.repository import GIRepository
+GIRepository.Repository.prepend_search_path('../libxfce4util/')
+# Now import 4util
+gi.require_version('libxfce4util', '1.0')
+from gi.repository import libxfce4util
+
+# print out some stuff to see if it works
+print("homedir: ", libxfce4util.get_homedir())
+print("get_dir_localized: ", libxfce4util.get_dir_localized(libxfce4util.get_homedir()))
+print("version: ", libxfce4util.version_string())

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list