1
/* Generated by Pyrex 0.9.3.1 on Sat Jun 10 01:23:44 2006 */
4
#include "structmember.h"
6
#define PY_LONG_LONG LONG_LONG
14
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
15
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
16
static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
17
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
18
static int __Pyx_PrintItem(PyObject *); /*proto*/
19
static int __Pyx_PrintNewline(void); /*proto*/
20
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
21
static void __Pyx_ReRaise(void); /*proto*/
22
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
23
static PyObject *__Pyx_GetExcValue(void); /*proto*/
24
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
25
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
26
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
27
static void __Pyx_WriteUnraisable(char *name); /*proto*/
28
static void __Pyx_AddTraceback(char *funcname); /*proto*/
29
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
30
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
31
static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
32
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
33
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
34
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
35
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
37
static PyObject *__pyx_m;
38
static PyObject *__pyx_b;
39
static int __pyx_lineno;
40
static char *__pyx_filename;
41
staticforward char **__pyx_f;
43
static char __pyx_mdoc[] = "Wrapper for readdir which grabs file type from d_type.";
45
/* Declarations from readdir */
48
/* Implementation of readdir */
50
static char (__pyx_k11[]) = ".";
52
static PyObject *__pyx_n_os;
53
static PyObject *__pyx_n_sys;
54
static PyObject *__pyx_n__directory;
55
static PyObject *__pyx_n__chardev;
56
static PyObject *__pyx_n__block;
57
static PyObject *__pyx_n__file;
58
static PyObject *__pyx_n__fifo;
59
static PyObject *__pyx_n__symlink;
60
static PyObject *__pyx_n__socket;
61
static PyObject *__pyx_n__unknown;
62
static PyObject *__pyx_n_dot;
63
static PyObject *__pyx_n_read_dir;
64
static PyObject *__pyx_n_directory;
65
static PyObject *__pyx_n_chardev;
66
static PyObject *__pyx_n_block;
67
static PyObject *__pyx_n_file;
68
static PyObject *__pyx_n_fifo;
69
static PyObject *__pyx_n_symlink;
70
static PyObject *__pyx_n_socket;
71
static PyObject *__pyx_n_unknown;
72
static PyObject *__pyx_n_ord;
74
static PyObject *__pyx_k11p;
76
static PyObject *__pyx_n_append;
77
static PyObject *__pyx_n_OSError;
79
static PyObject *__pyx_f_7readdir_read_dir(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
80
static char __pyx_doc_7readdir_read_dir[] = "Like os.listdir, this reads a directories contents.\n\n :param path: the directory to list.\n :return: a list of (basename, kind) tuples.\n ";
81
static PyObject *__pyx_f_7readdir_read_dir(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
82
PyObject *__pyx_v_path = 0;
83
DIR (*__pyx_v_the_dir);
84
dirent (*__pyx_v_entry);
86
PyObject *__pyx_v_result;
87
PyObject *__pyx_v_type;
91
PyObject *__pyx_3 = 0;
93
PyObject *__pyx_5 = 0;
95
PyObject *__pyx_7 = 0;
96
PyObject *__pyx_8 = 0;
97
static char *__pyx_argnames[] = {"path",0};
98
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_path)) return 0;
99
Py_INCREF(__pyx_v_path);
100
__pyx_v_result = Py_None; Py_INCREF(__pyx_v_result);
101
__pyx_v_type = Py_None; Py_INCREF(__pyx_v_type);
103
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":81 */
104
__pyx_1 = PyString_AsString(__pyx_v_path); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
105
__pyx_2 = opendir(__pyx_1); if (__pyx_2 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
106
__pyx_v_the_dir = __pyx_2;
108
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":82 */
109
__pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
110
Py_DECREF(__pyx_v_result);
111
__pyx_v_result = __pyx_3;
114
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":83 */
117
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":84 */
118
__pyx_v_entry = readdir(__pyx_v_the_dir);
120
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":85 */
123
__pyx_4 = (__pyx_v_entry != 0);
126
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":86 */
127
__pyx_v_name = __pyx_v_entry->d_name;
129
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":87 */
130
__pyx_3 = PyInt_FromLong((__pyx_v_name[0])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L3;}
131
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_dot); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L3;}
132
if (PyObject_Cmp(__pyx_3, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L3;}
133
__pyx_4 = __pyx_4 == 0;
134
Py_DECREF(__pyx_3); __pyx_3 = 0;
135
Py_DECREF(__pyx_5); __pyx_5 = 0;
137
__pyx_4 = ((__pyx_v_name[1]) == 0);
139
__pyx_3 = PyInt_FromLong((__pyx_v_name[1])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L3;}
140
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_dot); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L3;}
141
if (PyObject_Cmp(__pyx_3, __pyx_5, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L3;}
142
__pyx_4 = __pyx_4 == 0;
143
Py_DECREF(__pyx_3); __pyx_3 = 0;
144
Py_DECREF(__pyx_5); __pyx_5 = 0;
146
__pyx_4 = ((__pyx_v_name[2]) == 0);
150
__pyx_6 = (!__pyx_4);
153
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":91 */
154
__pyx_4 = (__pyx_v_entry->d_type == DT_UNKNOWN);
157
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":92 */
158
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__unknown); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L3;}
159
Py_DECREF(__pyx_v_type);
160
__pyx_v_type = __pyx_3;
164
__pyx_6 = (__pyx_v_entry->d_type == DT_REG);
167
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":94 */
168
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__file); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L3;}
169
Py_DECREF(__pyx_v_type);
170
__pyx_v_type = __pyx_5;
174
__pyx_4 = (__pyx_v_entry->d_type == DT_DIR);
177
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":96 */
178
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__directory); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L3;}
179
Py_DECREF(__pyx_v_type);
180
__pyx_v_type = __pyx_3;
184
__pyx_6 = (__pyx_v_entry->d_type == DT_FIFO);
187
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":98 */
188
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__fifo); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L3;}
189
Py_DECREF(__pyx_v_type);
190
__pyx_v_type = __pyx_5;
194
__pyx_4 = (__pyx_v_entry->d_type == DT_SOCK);
197
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":100 */
198
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__socket); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L3;}
199
Py_DECREF(__pyx_v_type);
200
__pyx_v_type = __pyx_3;
204
__pyx_6 = (__pyx_v_entry->d_type == DT_CHR);
207
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":102 */
208
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__chardev); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L3;}
209
Py_DECREF(__pyx_v_type);
210
__pyx_v_type = __pyx_5;
214
__pyx_4 = (__pyx_v_entry->d_type == DT_BLK);
217
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":104 */
218
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__block); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L3;}
219
Py_DECREF(__pyx_v_type);
220
__pyx_v_type = __pyx_3;
226
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":106 */
227
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__unknown); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L3;}
228
Py_DECREF(__pyx_v_type);
229
__pyx_v_type = __pyx_5;
234
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":107 */
235
__pyx_3 = PyObject_GetAttr(__pyx_v_result, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L3;}
236
__pyx_5 = PyString_FromString(__pyx_v_entry->d_name); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L3;}
237
__pyx_7 = PyTuple_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L3;}
238
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_5);
239
Py_INCREF(__pyx_v_type);
240
PyTuple_SET_ITEM(__pyx_7, 1, __pyx_v_type);
242
__pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L3;}
243
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
245
__pyx_7 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L3;}
246
Py_DECREF(__pyx_3); __pyx_3 = 0;
247
Py_DECREF(__pyx_5); __pyx_5 = 0;
248
Py_DECREF(__pyx_7); __pyx_7 = 0;
253
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":108 */
254
__pyx_v_entry = readdir(__pyx_v_the_dir);
258
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":109 */
259
__pyx_6 = (__pyx_v_entry == 0);
261
__pyx_6 = (errno != ENOENT);
265
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":110 */
266
__pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L3;}
267
__pyx_5 = PyInt_FromLong(errno); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L3;}
268
__pyx_7 = PyString_FromString(strerror(errno)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L3;}
269
__pyx_8 = PyTuple_New(2); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L3;}
270
PyTuple_SET_ITEM(__pyx_8, 0, __pyx_5);
271
PyTuple_SET_ITEM(__pyx_8, 1, __pyx_7);
274
__pyx_5 = PyObject_CallObject(__pyx_3, __pyx_8); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L3;}
275
Py_DECREF(__pyx_3); __pyx_3 = 0;
276
Py_DECREF(__pyx_8); __pyx_8 = 0;
277
__Pyx_Raise(__pyx_5, 0, 0);
278
Py_DECREF(__pyx_5); __pyx_5 = 0;
279
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L3;}
286
__pyx_why = 0; goto __pyx_L4;
287
__pyx_L2: __pyx_why = 3; goto __pyx_L4;
290
Py_XDECREF(__pyx_7); __pyx_7 = 0;
291
Py_XDECREF(__pyx_3); __pyx_3 = 0;
292
Py_XDECREF(__pyx_8); __pyx_8 = 0;
293
Py_XDECREF(__pyx_5); __pyx_5 = 0;
294
PyErr_Fetch(&__pyx_7, &__pyx_3, &__pyx_8);
295
__pyx_4 = __pyx_lineno;
300
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":112 */
301
__pyx_6 = closedir(__pyx_v_the_dir); if (__pyx_6 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}
303
case 3: goto __pyx_L0;
305
PyErr_Restore(__pyx_7, __pyx_3, __pyx_8);
306
__pyx_lineno = __pyx_4;
315
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":113 */
316
Py_INCREF(__pyx_v_result);
317
__pyx_r = __pyx_v_result;
320
__pyx_r = Py_None; Py_INCREF(__pyx_r);
327
__Pyx_AddTraceback("readdir.read_dir");
330
Py_DECREF(__pyx_v_result);
331
Py_DECREF(__pyx_v_type);
332
Py_DECREF(__pyx_v_path);
336
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
337
{&__pyx_n_OSError, "OSError"},
338
{&__pyx_n__block, "_block"},
339
{&__pyx_n__chardev, "_chardev"},
340
{&__pyx_n__directory, "_directory"},
341
{&__pyx_n__fifo, "_fifo"},
342
{&__pyx_n__file, "_file"},
343
{&__pyx_n__socket, "_socket"},
344
{&__pyx_n__symlink, "_symlink"},
345
{&__pyx_n__unknown, "_unknown"},
346
{&__pyx_n_append, "append"},
347
{&__pyx_n_block, "block"},
348
{&__pyx_n_chardev, "chardev"},
349
{&__pyx_n_directory, "directory"},
350
{&__pyx_n_dot, "dot"},
351
{&__pyx_n_fifo, "fifo"},
352
{&__pyx_n_file, "file"},
353
{&__pyx_n_ord, "ord"},
355
{&__pyx_n_read_dir, "read_dir"},
356
{&__pyx_n_socket, "socket"},
357
{&__pyx_n_symlink, "symlink"},
358
{&__pyx_n_sys, "sys"},
359
{&__pyx_n_unknown, "unknown"},
363
static __Pyx_StringTabEntry __pyx_string_tab[] = {
364
{&__pyx_k11p, __pyx_k11, sizeof(__pyx_k11)},
368
static struct PyMethodDef __pyx_methods[] = {
369
{"read_dir", (PyCFunction)__pyx_f_7readdir_read_dir, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7readdir_read_dir},
373
DL_EXPORT(void) initreaddir(void); /*proto*/
374
DL_EXPORT(void) initreaddir(void) {
375
PyObject *__pyx_1 = 0;
376
PyObject *__pyx_2 = 0;
377
PyObject *__pyx_3 = 0;
378
__pyx_m = Py_InitModule4("readdir", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
379
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;};
380
__pyx_b = PyImport_AddModule("__builtin__");
381
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;};
382
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;};
383
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;};
384
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;};
386
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":22 */
387
__pyx_1 = __Pyx_Import(__pyx_n_os, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
388
if (PyObject_SetAttr(__pyx_m, __pyx_n_os, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
389
Py_DECREF(__pyx_1); __pyx_1 = 0;
391
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":23 */
392
__pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
393
if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
394
Py_DECREF(__pyx_1); __pyx_1 = 0;
396
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":55 */
397
if (PyObject_SetAttr(__pyx_m, __pyx_n__directory, __pyx_n_directory) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
399
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":56 */
400
if (PyObject_SetAttr(__pyx_m, __pyx_n__chardev, __pyx_n_chardev) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; goto __pyx_L1;}
402
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":57 */
403
if (PyObject_SetAttr(__pyx_m, __pyx_n__block, __pyx_n_block) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
405
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":58 */
406
if (PyObject_SetAttr(__pyx_m, __pyx_n__file, __pyx_n_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;}
408
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":59 */
409
if (PyObject_SetAttr(__pyx_m, __pyx_n__fifo, __pyx_n_fifo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
411
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":60 */
412
if (PyObject_SetAttr(__pyx_m, __pyx_n__symlink, __pyx_n_symlink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
414
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":61 */
415
if (PyObject_SetAttr(__pyx_m, __pyx_n__socket, __pyx_n_socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
417
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":62 */
418
if (PyObject_SetAttr(__pyx_m, __pyx_n__unknown, __pyx_n_unknown) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; goto __pyx_L1;}
420
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":64 */
421
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ord); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
422
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
423
Py_INCREF(__pyx_k11p);
424
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k11p);
425
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
426
Py_DECREF(__pyx_1); __pyx_1 = 0;
427
Py_DECREF(__pyx_2); __pyx_2 = 0;
428
if (PyObject_SetAttr(__pyx_m, __pyx_n_dot, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
429
Py_DECREF(__pyx_3); __pyx_3 = 0;
431
/* "/home/robertc/source/baz/readdir/bzrlib/readdir.pyx":70 */
437
__Pyx_AddTraceback("readdir");
440
static char *__pyx_filenames[] = {
443
statichere char **__pyx_f = __pyx_filenames;
445
/* Runtime support code */
447
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
448
PyObject *__import__ = 0;
449
PyObject *empty_list = 0;
450
PyObject *module = 0;
451
PyObject *global_dict = 0;
452
PyObject *empty_dict = 0;
454
__import__ = PyObject_GetAttrString(__pyx_b, "__import__");
460
empty_list = PyList_New(0);
465
global_dict = PyModule_GetDict(__pyx_m);
468
empty_dict = PyDict_New();
471
module = PyObject_CallFunction(__import__, "OOOO",
472
name, global_dict, empty_dict, list);
474
Py_XDECREF(empty_list);
475
Py_XDECREF(__import__);
476
Py_XDECREF(empty_dict);
480
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
482
result = PyObject_GetAttr(dict, name);
484
PyErr_SetObject(PyExc_NameError, name);
488
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
492
/* First, check the traceback argument, replacing None with NULL. */
497
else if (tb != NULL && !PyTraceBack_Check(tb)) {
498
PyErr_SetString(PyExc_TypeError,
499
"raise: arg 3 must be a traceback or None");
502
/* Next, replace a missing value with None */
507
/* Next, repeatedly, replace a tuple exception with its first item */
508
while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
509
PyObject *tmp = type;
510
type = PyTuple_GET_ITEM(type, 0);
514
if (PyString_Check(type))
516
else if (PyClass_Check(type))
517
; /*PyErr_NormalizeException(&type, &value, &tb);*/
518
else if (PyInstance_Check(type)) {
519
/* Raising an instance. The value should be a dummy. */
520
if (value != Py_None) {
521
PyErr_SetString(PyExc_TypeError,
522
"instance exception may not have a separate value");
526
/* Normalize to raise <class>, <instance> */
529
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
534
/* Not something you can raise. You get an exception
535
anyway, just not what you specified :-) */
536
PyErr_Format(PyExc_TypeError,
537
"exceptions must be strings, classes, or "
538
"instances, not %s", type->ob_type->tp_name);
541
PyErr_Restore(type, value, tb);
550
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
552
*t->p = PyString_InternFromString(t->s);
560
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
562
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
571
#include "frameobject.h"
572
#include "traceback.h"
574
static void __Pyx_AddTraceback(char *funcname) {
575
PyObject *py_srcfile = 0;
576
PyObject *py_funcname = 0;
577
PyObject *py_globals = 0;
578
PyObject *empty_tuple = 0;
579
PyObject *empty_string = 0;
580
PyCodeObject *py_code = 0;
581
PyFrameObject *py_frame = 0;
583
py_srcfile = PyString_FromString(__pyx_filename);
584
if (!py_srcfile) goto bad;
585
py_funcname = PyString_FromString(funcname);
586
if (!py_funcname) goto bad;
587
py_globals = PyModule_GetDict(__pyx_m);
588
if (!py_globals) goto bad;
589
empty_tuple = PyTuple_New(0);
590
if (!empty_tuple) goto bad;
591
empty_string = PyString_FromString("");
592
if (!empty_string) goto bad;
593
py_code = PyCode_New(
596
0, /*int stacksize,*/
598
empty_string, /*PyObject *code,*/
599
empty_tuple, /*PyObject *consts,*/
600
empty_tuple, /*PyObject *names,*/
601
empty_tuple, /*PyObject *varnames,*/
602
empty_tuple, /*PyObject *freevars,*/
603
empty_tuple, /*PyObject *cellvars,*/
604
py_srcfile, /*PyObject *filename,*/
605
py_funcname, /*PyObject *name,*/
606
__pyx_lineno, /*int firstlineno,*/
607
empty_string /*PyObject *lnotab*/
609
if (!py_code) goto bad;
610
py_frame = PyFrame_New(
611
PyThreadState_Get(), /*PyThreadState *tstate,*/
612
py_code, /*PyCodeObject *code,*/
613
py_globals, /*PyObject *globals,*/
614
0 /*PyObject *locals*/
616
if (!py_frame) goto bad;
617
py_frame->f_lineno = __pyx_lineno;
618
PyTraceBack_Here(py_frame);
620
Py_XDECREF(py_srcfile);
621
Py_XDECREF(py_funcname);
622
Py_XDECREF(empty_tuple);
623
Py_XDECREF(empty_string);
625
Py_XDECREF(py_frame);