1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/* -*- Mode: C; c-basic-offset: 4 -*-
* pygobject - Python bindings for GObject
* Copyright (C) 2008 Johan Dahlin
* 2009 Gian Mario Tagliaretti
*
* gfileinfo.override: module overrides for GFileInfo
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
%%
headers
#ifndef G_TYPE_FILE_ATTRIBUTE_MATCHER
#define G_TYPE_FILE_ATTRIBUTE_MATCHER (_g_file_attribute_matcher_get_type ())
static GType _g_file_attribute_matcher_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("GFileAttributeMatcher",
(GBoxedCopyFunc)g_file_attribute_matcher_ref,
(GBoxedFreeFunc)g_file_attribute_matcher_unref);
return our_type;
}
#endif
%%
override g_file_info_list_attributes kwargs
static PyObject *
_wrap_g_file_info_list_attributes(PyGObject *self,
PyObject *args,
PyObject *kwargs)
{
char *kwlist[] = { "name_space", NULL};
gchar *name_space = NULL;
gchar **names;
gchar **n;
PyObject *ret;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|z:gio.FileInfo.list_attributes",
kwlist, &name_space))
return NULL;
names = g_file_info_list_attributes(G_FILE_INFO(self->obj),
name_space);
ret = PyList_New(0);
n = names;
while (n && *n) {
PyObject *item = PyString_FromString(n[0]);
PyList_Append(ret, item);
Py_DECREF(item);
n++;
}
g_strfreev(names);
return ret;
}
%%
override g_file_info_get_modification_time noargs
static PyObject *
_wrap_g_file_info_get_modification_time(PyGObject *self, PyObject *unused)
{
GTimeVal timeval;
g_file_info_get_modification_time(G_FILE_INFO(self->obj), &timeval);
return pyglib_float_from_timeval(timeval);
}
/* GFileInfo.get_attribute_data: No ArgType for GFileAttributeType* */
/* GFileInfo.set_attribute: No ArgType for gpointer */
/* GFileInfo.set_modification_time: No ArgType for GTimeVal* */
|