2007-05-21 17:36:08 +02:00
|
|
|
/* -*- Mode: C; c-basic-offset: 4 -*- */
|
|
|
|
%%
|
|
|
|
headers
|
|
|
|
#include <Python.h>
|
|
|
|
|
|
|
|
#include "pygobject.h"
|
|
|
|
#include "sugar-address-entry.h"
|
2007-06-20 15:22:12 +02:00
|
|
|
#include "sugar-key-grabber.h"
|
2007-06-26 14:55:16 +02:00
|
|
|
#include "sugar-menu.h"
|
2007-06-01 20:38:30 +02:00
|
|
|
#include "sugar-x11-util.h"
|
2007-05-24 12:30:42 +02:00
|
|
|
#include "xdgmime.h"
|
2007-05-21 17:36:08 +02:00
|
|
|
|
|
|
|
#include <pygtk/pygtk.h>
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
%%
|
|
|
|
modulename _sugarext
|
|
|
|
%%
|
2007-06-20 15:22:12 +02:00
|
|
|
import gobject.GObject as PyGObject_Type
|
2007-05-21 17:36:08 +02:00
|
|
|
import gtk.Entry as PyGtkEntry_Type
|
2007-06-26 14:55:16 +02:00
|
|
|
import gtk.Menu as PyGtkMenu_Type
|
2007-06-01 20:38:30 +02:00
|
|
|
import gtk.gdk.Window as PyGdkWindow_Type
|
2007-05-21 17:36:08 +02:00
|
|
|
%%
|
|
|
|
ignore-glob
|
|
|
|
*_get_type
|
|
|
|
_*
|
|
|
|
%%
|
2007-05-24 12:30:42 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
%%
|