Rev 1278: Move core.c functionality to python. in http://people.samba.org/bzr/jelmer/bzr-svn/0.4

Jelmer Vernooij jelmer at samba.org
Sun Jun 22 20:15:38 BST 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/0.4

------------------------------------------------------------
revno: 1278
revision-id: jelmer at samba.org-20080622191537-202nhdkyj15i9mga
parent: jelmer at samba.org-20080622185314-1teaotmb43lvteod
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-06-22 21:15:37 +0200
message:
  Move core.c functionality to python.
renamed:
  core.c => core.py core.pyx-20080313210413-17k59slolpfe5kdq-1
modified:
  setup.py                       setup.py-20060502115218-86950492da22353f
  core.py                        core.pyx-20080313210413-17k59slolpfe5kdq-1
=== renamed file 'core.c' => 'core.py'
--- a/core.c	2008-06-22 18:53:14 +0000
+++ b/core.py	2008-06-22 19:15:37 +0000
@@ -1,52 +1,23 @@
-/*
- * Copyright © 2008 Jelmer Vernooij <jelmer at samba.org>
- * -*- coding: utf-8 -*-
- *
- * This program 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 2 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include <stdbool.h>
-#include <Python.h>
-#include <apr_general.h>
-#include <string.h>
-#include <svn_time.h>
-#include <svn_config.h>
-#include <svn_io.h>
-#include <svn_utf.h>
-
-#include "util.h"
-
-void initcore(void)
-{
-	static apr_pool_t *pool;
-	PyObject *mod;
-
-	apr_initialize();
-	pool = Pool(NULL);
-	if (pool == NULL)
-		return;
-	svn_utf_initialize(pool);
-
-	mod = Py_InitModule3("core", NULL, "Core functions");
-	if (mod == NULL)
-		return;
-
-	PyModule_AddIntConstant(mod, "NODE_DIR", svn_node_dir);
-	PyModule_AddIntConstant(mod, "NODE_FILE", svn_node_file);
-	PyModule_AddIntConstant(mod, "NODE_UNKNOWN", svn_node_unknown);
-	PyModule_AddIntConstant(mod, "NODE_NONE", svn_node_none);
-
-	PyModule_AddObject(mod, "SubversionException", 
-					   PyErr_NewException("core.SubversionException", NULL, NULL));
-}
+# Copyright (C) 2006-2008 Jelmer Vernooij <jelmer at samba.org>
+
+# This program 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.
+
+# 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 General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+NODE_DIR = 2
+NODE_FILE = 1
+NODE_NONE = 0
+NODE_UNKNOWN = 3
+
+class SubversionException(Exception):
+    """A Subversion exception"""

=== modified file 'setup.py'
--- a/setup.py	2008-06-22 14:31:50 +0000
+++ b/setup.py	2008-06-22 19:15:37 +0000
@@ -57,7 +57,6 @@
                 'bzrlib.plugins.svn.mapping3', 
                 'bzrlib.plugins.svn.tests'],
       ext_modules=[
-          SvnExtension("core", ["core.c", "util.c"], libraries=["svn_subr-1"]), 
           SvnExtension("client", ["client.c", "editor.c", "util.c", "ra.c", "wc.c"], libraries=["svn_client-1"]), 
           SvnExtension("ra", ["ra.c", "util.c", "editor.c"], libraries=["svn_ra-1"]),
           SvnExtension("repos", ["repos.c", "util.c"], libraries=["svn_repos-1"]),




More information about the bazaar-commits mailing list