c91bbd18cc
We can't install libraries in datadir.
45 lines
982 B
C
45 lines
982 B
C
/* -*- Mode: C; c-basic-offset: 4 -*- */
|
|
%%
|
|
headers
|
|
#include <Python.h>
|
|
|
|
#include "pygobject.h"
|
|
#include "sugar-address-entry.h"
|
|
#include "sugar-key-grabber.h"
|
|
#include "sugar-x11-util.h"
|
|
#include "xdgmime.h"
|
|
|
|
#include <pygtk/pygtk.h>
|
|
#include <glib.h>
|
|
|
|
%%
|
|
modulename _sugarext
|
|
%%
|
|
import gobject.GObject as PyGObject_Type
|
|
import gtk.Entry as PyGtkEntry_Type
|
|
import gtk.gdk.Window as PyGdkWindow_Type
|
|
%%
|
|
ignore-glob
|
|
*_get_type
|
|
_*
|
|
%%
|
|
override sugar_mime_get_mime_type_for_file kwargs
|
|
static PyObject *
|
|
_wrap_sugar_mime_get_mime_type_for_file(PyObject *self, PyObject *args, PyObject *kwargs)
|
|
{
|
|
static char *kwlist[] = { "filename", NULL };
|
|
char *filename;
|
|
const gchar *ret;
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:get_mime_type_for_file", kwlist, &filename))
|
|
return NULL;
|
|
|
|
ret = sugar_mime_get_mime_type_for_file(filename, NULL);
|
|
|
|
if (ret)
|
|
return PyString_FromString(ret);
|
|
Py_INCREF(Py_None);
|
|
return Py_None;
|
|
}
|
|
%%
|