diff options
Diffstat (limited to 'xlators/bindings/python/src')
| -rw-r--r-- | xlators/bindings/python/src/Makefile.am | 2 | ||||
| -rw-r--r-- | xlators/bindings/python/src/gluster.py | 23 | ||||
| -rw-r--r-- | xlators/bindings/python/src/glusterstack.py | 23 | ||||
| -rw-r--r-- | xlators/bindings/python/src/glustertypes.py | 23 | ||||
| -rw-r--r-- | xlators/bindings/python/src/python.c | 30 | ||||
| -rw-r--r-- | xlators/bindings/python/src/testxlator.py | 25 |
6 files changed, 44 insertions, 82 deletions
diff --git a/xlators/bindings/python/src/Makefile.am b/xlators/bindings/python/src/Makefile.am index c0b9141c6..90370d861 100644 --- a/xlators/bindings/python/src/Makefile.am +++ b/xlators/bindings/python/src/Makefile.am @@ -9,7 +9,7 @@ pythondir = $(xlatordir)/python python_so_SOURCES = python.c -AM_CFLAGS = -fPIC -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wall \ +AM_CFLAGS = -fPIC $(GF_CPPFLAGS) -Wall \ -I$(top_srcdir)/libglusterfs/src -shared -nostartfiles \ $(PYTHON_CPPLAGS) -DGLUSTER_PYTHON_PATH=\"$(pythondir)\" diff --git a/xlators/bindings/python/src/gluster.py b/xlators/bindings/python/src/gluster.py index ee0eb1310..337c983ec 100644 --- a/xlators/bindings/python/src/gluster.py +++ b/xlators/bindings/python/src/gluster.py @@ -1,19 +1,12 @@ -# Copyright (c) 2007 Chris AtLee <chris@atlee.ca> -# This file is part of GlusterFS. -# -# GlusterFS is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 3 of the License, -# or (at your option) any later version. -# -# GlusterFS 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 -# General Public License for more details. + +# Copyright (c) 2007-2012 Red Hat, Inc. <http://www.redhat.com> +# This file is part of GlusterFS. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# <http://www.gnu.org/licenses/>. +# This file is licensed to you under your choice of the GNU Lesser +# General Public License, version 3 or any later version (LGPLv3 or +# later), or the GNU General Public License, version 2 (GPLv2), in all +# cases as published by the Free Software Foundation. + from ctypes import * from glustertypes import * from glusterstack import * diff --git a/xlators/bindings/python/src/glusterstack.py b/xlators/bindings/python/src/glusterstack.py index ba24c8165..0c071ae98 100644 --- a/xlators/bindings/python/src/glusterstack.py +++ b/xlators/bindings/python/src/glusterstack.py @@ -1,19 +1,12 @@ -# Copyright (c) 2007 Chris AtLee <chris@atlee.ca> -# This file is part of GlusterFS. -# -# GlusterFS is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 3 of the License, -# or (at your option) any later version. -# -# GlusterFS 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 -# General Public License for more details. + +# Copyright (c) 2007-2012 Red Hat, Inc. <http://www.redhat.com> +# This file is part of GlusterFS. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# <http://www.gnu.org/licenses/>. +# This file is licensed to you under your choice of the GNU Lesser +# General Public License, version 3 or any later version (LGPLv3 or +# later), or the GNU General Public License, version 2 (GPLv2), in all +# cases as published by the Free Software Foundation. + from ctypes import * from glustertypes import * diff --git a/xlators/bindings/python/src/glustertypes.py b/xlators/bindings/python/src/glustertypes.py index e9069d07c..98437d22e 100644 --- a/xlators/bindings/python/src/glustertypes.py +++ b/xlators/bindings/python/src/glustertypes.py @@ -1,19 +1,12 @@ -# Copyright (c) 2007 Chris AtLee <chris@atlee.ca> -# This file is part of GlusterFS. -# -# GlusterFS is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 3 of the License, -# or (at your option) any later version. -# -# GlusterFS 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 -# General Public License for more details. + +# Copyright (c) 2007-2012 Red Hat, Inc. <http://www.redhat.com> +# This file is part of GlusterFS. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# <http://www.gnu.org/licenses/>. +# This file is licensed to you under your choice of the GNU Lesser +# General Public License, version 3 or any later version (LGPLv3 or +# later), or the GNU General Public License, version 2 (GPLv2), in all +# cases as published by the Free Software Foundation. + from ctypes import * import collections diff --git a/xlators/bindings/python/src/python.c b/xlators/bindings/python/src/python.c index 3310a2115..9b96790de 100644 --- a/xlators/bindings/python/src/python.c +++ b/xlators/bindings/python/src/python.c @@ -1,22 +1,12 @@ /* - Copyright (c) 2007-2010 Chris AtLee <chris@atlee.ca> + Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com> This file is part of GlusterFS. - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS 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 - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. */ - #include <Python.h> #ifndef _CONFIG_H @@ -45,7 +35,7 @@ python_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, - int32_t count, + int32_t count, off_t offset) { python_private_t *priv = (python_private_t *)this->private; @@ -148,7 +138,7 @@ init (xlator_t *this) Py_InitializeEx(0); if (!this->children) { - gf_log ("python", GF_LOG_ERROR, + gf_log ("python", GF_LOG_ERROR, "FATAL: python should have exactly one child"); return -1; } @@ -166,7 +156,7 @@ init (xlator_t *this) } priv->pInterp = Py_NewInterpreter(); - + // Adjust python's path PyObject *syspath = PySys_GetObject("path"); PyObject *path = PyString_FromString(GLUSTER_PYTHON_PATH); @@ -188,7 +178,7 @@ init (xlator_t *this) priv->pVectorType = PyObject_GetAttrString(priv->pGlusterModule, "iovec"); gf_log("python", GF_LOG_DEBUG, "Loading script...%s", priv->scriptname); - + priv->pScriptModule = AnonModule_FromFile(priv->scriptname); if (!priv->pScriptModule || PyErr_Occurred()) { @@ -217,7 +207,7 @@ init (xlator_t *this) return 0; } -void +void fini (xlator_t *this) { python_private_t *priv = (python_private_t*)(this->private); diff --git a/xlators/bindings/python/src/testxlator.py b/xlators/bindings/python/src/testxlator.py index 507455c85..59a991dca 100644 --- a/xlators/bindings/python/src/testxlator.py +++ b/xlators/bindings/python/src/testxlator.py @@ -1,19 +1,12 @@ -# Copyright (c) 2007 Chris AtLee <chris@atlee.ca> -# This file is part of GlusterFS. -# -# GlusterFS is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 3 of the License, -# or (at your option) any later version. -# -# GlusterFS 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 -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# <http://www.gnu.org/licenses/>. +""" + Copyright (c) 2007-2012 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +""" """ This is a test translator written in python. |
