On Wed, Nov 13, 2013 at 11:50:31PM +0100, David Nečas (Yeti) wrote:
> The attached patch...

Maybe this time?  And then I will to sleep...

Yeti

--- modules.orig/pygwy/pygwy.override	2013-11-13 23:31:52.262073478 +0100
+++ modules/pygwy/pygwy.override	2013-11-13 23:31:18.940534875 +0100
@@ -606,11 +606,43 @@
 
    gchar *filename;
    GwyContainer *c;
+   PyObject *object;
 
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:gwy_app_file_load", kwlist, &filename))
         return NULL;
    c = gwy_app_file_load(filename, NULL, NULL);
-   return pygobject_new((GObject *)c);
+   object = pygobject_new((GObject *)c);
+   g_object_unref(c);
+   return object;
+}
+
+%%
+override gwy_file_load kwargs
+/**
+ * gwy_file_load:
+ * @filename: Filename of file to open
+ * @mode: Run mode (RUN_INTERACTIVE or RUN_NONINTERACTIVE).
+ *
+ * Load specified file using specified mode
+ *
+ * Returns: A main GwyContainer of opened file
+**/
+static PyObject *
+_wrap_gwy_file_load(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+   static char *kwlist[] = {"filename", "mode", NULL};
+
+   gchar *filename;
+   GwyRunType mode;
+   GwyContainer *c;
+   PyObject *object;
+
+   if (!PyArg_ParseTupleAndKeywords(args, kwargs,"si:gwy_file_load", kwlist, &filename, &mode))
+        return NULL;
+   c = gwy_file_load(filename, mode, NULL);
+   object = pygobject_new((GObject *)c);
+   g_object_unref(c);
+   return object;
 }
 
 %%
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users

Reply via email to