Author: ArcRiley Date: 2009-01-17 14:56:16 -0500 (Sat, 17 Jan 2009) New Revision: 1486
Added: trunk/concordance/scripts/ trunk/concordance/scripts/__init__.py trunk/concordance/src/services/ trunk/concordance/src/services/__init__.c trunk/concordance/src/services/__init__.h trunk/concordance/src/sockets/ Modified: trunk/concordance/setup.py trunk/concordance/src/__init__.c Log: stage 1 of API upgrade, much more soon Added: trunk/concordance/scripts/__init__.py =================================================================== --- trunk/concordance/scripts/__init__.py (rev 0) +++ trunk/concordance/scripts/__init__.py 2009-01-17 19:56:16 UTC (rev 1486) @@ -0,0 +1,26 @@ +''' Concordance XMPP Service Framework ''' + +__credits__ = '''Copyright (C) 2009 Copyleft Games Group + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program; if not, see http://www.gnu.org/licenses +''' +__author__ = 'Copyleft Games Group' +__date__ = 'Last change on '+ \ + '$Date$'[7:-20]+ \ + 'by '+'$Author$'[9:-2] +__version__ = 'Trunk (r'+'$Rev$'[6:-2]+')' + + +from concordance._core import Core, Session # temporary +from concordance import services Property changes on: trunk/concordance/scripts/__init__.py ___________________________________________________________________ Added: svn:keywords + Author Date Rev Modified: trunk/concordance/setup.py =================================================================== --- trunk/concordance/setup.py 2009-01-17 03:19:45 UTC (rev 1485) +++ trunk/concordance/setup.py 2009-01-17 19:56:16 UTC (rev 1486) @@ -34,6 +34,10 @@ if sys.version_info[0] != 3 : raise RuntimeError('Python 3.0 is required for this package.') +include_dirs = ['/usr/include/glib-2.0', + '/usr/lib/glib-2.0/include', +] + libraries = ['glib-2.0', 'gthread-2.0', 'gsasl', 'expat'] if sys.platform == 'win32' : libraries.append('ws2_32') @@ -71,21 +75,35 @@ # ############################################################################# # - # Build settings + # Package settings # - ext_package = '', # No package prefix is used - ext_modules = [Extension( - name = 'concordance', # Name of extension module - sources = ['src/__init__.c', + packages = ['concordance'], + package_dir = {'concordance' : 'scripts'}, + # + ############################################################################# + # + # Extension settings + # + ext_package = 'concordance', + ext_modules = [ + Extension( + name = '_core', + sources = ['src/__init__.c', 'src/Core.c', 'src/Session.c', 'src/utils.c', - ], - include_dirs = ['/usr/include/glib-2.0', - '/usr/lib/glib-2.0/include', - ], - libraries = libraries, - )], + ], + include_dirs = include_dirs, + libraries = libraries, + ), + Extension( + name = 'services', + sources = ['src/services/__init__.c', + ], + include_dirs = include_dirs, + libraries = libraries, + ), + ], # ############################################################################# ) Modified: trunk/concordance/src/__init__.c =================================================================== --- trunk/concordance/src/__init__.c 2009-01-17 03:19:45 UTC (rev 1485) +++ trunk/concordance/src/__init__.c 2009-01-17 19:56:16 UTC (rev 1486) @@ -28,7 +28,7 @@ static struct PyModuleDef concord_Module = { PyModuleDef_HEAD_INIT, - "concordance", /*m_name*/ + "_core", /*m_name*/ "Test Help", /*m_doc*/ -1, /*m_size*/ concord_Methods, /*m_methods*/ @@ -39,7 +39,7 @@ }; PyMODINIT_FUNC -PyInit_concordance(void) { /*\ +PyInit__core(void) { /*\ cdef : \*/ PyObject* module; Copied: trunk/concordance/src/services/__init__.c (from rev 1485, trunk/concordance/src/__init__.c) =================================================================== --- trunk/concordance/src/services/__init__.c (rev 0) +++ trunk/concordance/src/services/__init__.c 2009-01-17 19:56:16 UTC (rev 1486) @@ -0,0 +1,76 @@ +/* +# Concordance XMPP Service Framework +# +# Copyright (C) 2009 Copyleft Games Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ +*/ + +#include "__init__.h" + + +static PyMethodDef services_Methods[] = { + { NULL, NULL } +}; + +static struct PyModuleDef services_Module = { + PyModuleDef_HEAD_INIT, + "services", /*m_name*/ + "Test Help", /*m_doc*/ + -1, /*m_size*/ + services_Methods, /*m_methods*/ + NULL, /*m_reload*/ + NULL, /*m_traverse*/ + NULL, /*m_clear*/ + NULL /*m_free*/ +}; + +PyMODINIT_FUNC +PyInit_services(void) { /*\ + cdef : \*/ + PyObject* module; + + /* Initialize all types prior to module creation + + int PyType_Ready(PyTypeObject*) + Finalize a type object. This should be called on all type objects to + finish their initialization. This function is responsible for adding + inherited slots from a type’s base class. + Return 0 on success, or return -1 and sets an exception on error. + */ + //if (PyType_Ready(&concordCore_Type) < 0) + // return NULL; + + + /* Create concordance.services module object + + PyObject* PyModule_Create(struct PyModuleDef*) + */ + module = PyModule_Create(&services_Module); + + + /* incref each extension type */ + //Py_INCREF(&concordCore_Type); + + /* Add classes to the concordance module object + + int PyModule_AddObject(PyObject*, const char*, PyObject*); + */ + //PyModule_AddObject(module, "Core", (PyObject*) &concordCore_Type); + + /* return the module object to Python */ + return module; +} Copied: trunk/concordance/src/services/__init__.h (from rev 1485, trunk/concordance/src/__init__.h) =================================================================== --- trunk/concordance/src/services/__init__.h (rev 0) +++ trunk/concordance/src/services/__init__.h 2009-01-17 19:56:16 UTC (rev 1486) @@ -0,0 +1,27 @@ +/* +# Concordance XMPP Service Framework +# +# Copyright (C) 2009 Copyleft Games Group +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program; if not, see http://www.gnu.org/licenses +# +# $Id$ +*/ + +#ifndef SERVICES_INIT_H +#define SERVICES_INIT_H + +#include "../utils.h" + +#endif _______________________________________________ PySoy-SVN mailing list PySoy-SVN@pysoy.org http://www.pysoy.org/mailman/listinfo/pysoy-svn