[gegl] Fix introspection of gegl_init()
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Fix introspection of gegl_init()
- Date: Fri, 7 Jun 2013 16:24:34 +0000 (UTC)
commit eb99c24a649889d8935d32a362c46c6a1de185b5
Author: Daniel Sabo <DanielSabo gmail com>
Date: Fri Jun 7 09:23:51 2013 -0700
Fix introspection of gegl_init()
examples/gi-test.py | 5 ++---
examples/introspection.py | 4 ++--
examples/simple-graph.py | 3 ++-
gegl/gegl-init.h | 6 +++---
gegl/gegl.h | 4 ++--
tests/python/test-gegl-color.py | 3 +--
tests/python/test-gegl-node.py | 5 ++---
tests/python/test-gegl.py | 3 +--
8 files changed, 15 insertions(+), 18 deletions(-)
---
diff --git a/examples/gi-test.py b/examples/gi-test.py
index 9a7d08d..155eca1 100755
--- a/examples/gi-test.py
+++ b/examples/gi-test.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
-import gi
from gi.repository import Gegl
+import sys
# extend GEGL binding with some utility function, making it possible to lookup
# a node among the children of a node giving one with a specified name. A
@@ -21,8 +21,7 @@ Gegl.Node.locate_by_type = locate_by_type
if __name__ == '__main__':
-
- Gegl.init(0,"") # < that is rather ugly
+ Gegl.init(sys.argv)
node = Gegl.Node.new_from_xml("""
<gegl>
diff --git a/examples/introspection.py b/examples/introspection.py
index 3539b52..00c6693 100755
--- a/examples/introspection.py
+++ b/examples/introspection.py
@@ -9,8 +9,8 @@ GObject introspection."""
# To use a typelib from a non-standard location, set the env var
# GI_TYPELIB_PATH to the directory with your Gegl-$apiversion-.typelib
-import gi
from gi.repository import Gegl
+import sys
# extend GEGL binding with some utility function that makes it possible
# to lookup a node among the children of a node giving one with a specified name.
@@ -22,7 +22,7 @@ def locate_by_type(self, opname):
Gegl.Node.locate_by_type = locate_by_type
if __name__ == '__main__':
- Gegl.init(0,"")
+ Gegl.init(sys.argv)
node = Gegl.Node.new()
node = Gegl.Node.new_from_xml("""
<gegl>
diff --git a/examples/simple-graph.py b/examples/simple-graph.py
index c8133b1..68d87c1 100755
--- a/examples/simple-graph.py
+++ b/examples/simple-graph.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python
from gi.repository import Gegl
+import sys
if __name__ == '__main__':
- Gegl.init(0,"")
+ Gegl.init(sys.argv)
ptn = Gegl.Node()
diff --git a/gegl/gegl-init.h b/gegl/gegl-init.h
index bff4470..f855b3f 100644
--- a/gegl/gegl-init.h
+++ b/gegl/gegl-init.h
@@ -23,8 +23,8 @@ G_BEGIN_DECLS
/**
* gegl_init:
- * @argc: a pointer to the number of command line arguments.
- * @argv: a pointer to the array of command line arguments.
+ * @argc: (inout): a pointer to the number of command line arguments.
+ * @argv: (inout) (array length=argc) (allow-none): a pointer to the array of command line arguments.
*
* Call this function before using any other GEGL functions. It will initialize
* everything needed to operate GEGL and parses some standard command line
@@ -39,7 +39,7 @@ void gegl_init (gint *argc,
gchar ***argv);
/**
- * gegl_get_option_group:
+ * gegl_get_option_group: (skip)
*
* Returns a #GOptionGroup for the commandline arguments recognized
* by GEGL. You should add this group to your #GOptionContext
diff --git a/gegl/gegl.h b/gegl/gegl.h
index 4c6025a..8c853a9 100644
--- a/gegl/gegl.h
+++ b/gegl/gegl.h
@@ -79,8 +79,8 @@ G_BEGIN_DECLS
/**
* gegl_init:
- * @argc: a pointer to the number of command line arguments.
- * @argv: a pointer to the array of command line arguments.
+ * @argc: (inout): a pointer to the number of command line arguments.
+ * @argv: (inout) (array length=argc) (allow-none): a pointer to the array of command line arguments.
*
* Call this function before using any other GEGL functions. It will
* initialize everything needed to operate GEGL and parses some
diff --git a/tests/python/test-gegl-color.py b/tests/python/test-gegl-color.py
index 2205da4..ced7031 100755
--- a/tests/python/test-gegl-color.py
+++ b/tests/python/test-gegl-color.py
@@ -19,7 +19,6 @@
import unittest
-import gi
from gi.repository import Gegl
class TestGeglColor(unittest.TestCase):
@@ -45,6 +44,6 @@ class TestGeglColor(unittest.TestCase):
self.assertAlmostEqual(values[3], 1.0)
if __name__ == '__main__':
- Gegl.init(0, "");
+ Gegl.init(None);
unittest.main()
Gegl.exit()
diff --git a/tests/python/test-gegl-node.py b/tests/python/test-gegl-node.py
index 6163570..81d97a6 100755
--- a/tests/python/test-gegl-node.py
+++ b/tests/python/test-gegl-node.py
@@ -19,7 +19,6 @@
import unittest
-import gi
from gi.repository import Gegl
invert_crop_xml = """<?xml version='1.0' encoding='UTF-8'?>
@@ -44,7 +43,7 @@ class TestGeglNodes(unittest.TestCase):
def test_new(self):
graph = Gegl.Node.new()
- self.assertEqual(type(graph), gi.repository.Gegl.Node)
+ self.assertEqual(type(graph), Gegl.Node)
def test_node_properties(self):
graph = Gegl.Node()
@@ -135,6 +134,6 @@ class TestGeglXml(unittest.TestCase):
self.assertEqual(output, invert_crop_xml)
if __name__ == '__main__':
- Gegl.init(0, "");
+ Gegl.init(None);
unittest.main()
Gegl.exit()
diff --git a/tests/python/test-gegl.py b/tests/python/test-gegl.py
index 9ada190..d3d0b42 100755
--- a/tests/python/test-gegl.py
+++ b/tests/python/test-gegl.py
@@ -19,14 +19,13 @@
import unittest
-import gi
from gi.repository import Gegl
class TestGegl(unittest.TestCase):
"""Tests the Gegl global functions, initialization and configuration handling."""
def test_init(self):
- Gegl.init(0, "");
+ Gegl.init(None);
def test_config_defaults(self):
gegl_config = Gegl.config()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]