36
#include <BLI_blenlib.h> /* for BLI_last_slash() */
37
#include "gen_utils.h"
40
/*****************************************************************************/
41
/* Python API function prototypes for the sys module. */
42
/*****************************************************************************/
43
static PyObject *M_sys_basename (PyObject *self, PyObject *args);
44
static PyObject *M_sys_dirname (PyObject *self, PyObject *args);
45
static PyObject *M_sys_splitext (PyObject *self, PyObject *args);
46
static PyObject *M_sys_time (PyObject *self);
48
/*****************************************************************************/
49
/* The following string definitions are used for documentation strings. */
50
/* In Python these will be written to the console when doing a */
51
/* Blender.sys.__doc__ */
52
/*****************************************************************************/
53
static char M_sys_doc[] =
54
"The Blender.sys submodule\n\
56
This is a minimal system module to supply simple functionality available\n\
57
in the default Python module os.";
59
static char M_sys_basename_doc[]="(path) - Split 'path' in dir and filename.\n\
60
Return the filename.";
62
static char M_sys_dirname_doc[]="(path) - Split 'path' in dir and filename.\n\
65
static char M_sys_splitext_doc[]="(path) - Split 'path' in root and \
66
extension:\n/this/that/file.ext -> ('/this/that/file','.ext').\n\
67
Return the pair (root, extension).";
69
static char M_sys_time_doc[]="() - Return a float representing time elapsed \
71
Each successive call is garanteed to return values greater than or\n\
72
equal to the previous call.";
74
/*****************************************************************************/
75
/* Python method structure definition for Blender.sys module: */
76
/*****************************************************************************/
77
struct PyMethodDef M_sys_methods[] = {
78
{"basename", M_sys_basename, METH_VARARGS, M_sys_basename_doc},
79
{"dirname", M_sys_dirname, METH_VARARGS, M_sys_dirname_doc},
80
{"splitext", M_sys_splitext, METH_VARARGS, M_sys_splitext_doc},
81
{"time", (PyCFunction)M_sys_time, METH_NOARGS, M_sys_time_doc},
85
#endif /* EXPP_sys_H */
36
PyObject *sys_Init( void );
38
#endif /* EXPP_sys_H */