From 91f610c1af62517850901c19086c23324fea4248 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sun, 24 Jan 2010 23:00:32 -0500 Subject: [PATCH] Rename chashsplit.so to _hashsplit.so. Looks like the python standard is _modulename.so when making a C helper for a module named modulename.py, so let's do it that way. Also get rid of the annoying "module" suffix in the .c's filename. Not sure why I ever thought that was needed. --- Makefile | 6 +++--- chashsplitmodule.c => _hashsplit.c | 4 ++-- csetup.py | 6 +++--- hashsplit.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename chashsplitmodule.c => _hashsplit.c (93%) diff --git a/Makefile b/Makefile index 9393fb0..1068de5 100644 --- a/Makefile +++ b/Makefile @@ -20,15 +20,15 @@ endif default: all all: bup-split bup-join bup-save bup-init bup-server bup-index bup-tick \ - bup memtest randomgen$(EXT) chashsplit$(SOEXT) + bup memtest randomgen$(EXT) _hashsplit$(SOEXT) randomgen$(EXT): randomgen.o $(CC) $(CFLAGS) -o $@ $< -chashsplit$(SOEXT): chashsplitmodule.c csetup.py +_hashsplit$(SOEXT): _hashsplit.c csetup.py @rm -f $@ python csetup.py build - cp build/*/chashsplit.so . + cp build/*/_hashsplit.so . runtests: all runtests-python runtests-cmdline diff --git a/chashsplitmodule.c b/_hashsplit.c similarity index 93% rename from chashsplitmodule.c rename to _hashsplit.c index d2beb29..a213d00 100644 --- a/chashsplitmodule.c +++ b/_hashsplit.c @@ -54,7 +54,7 @@ static PyMethodDef hashsplit_methods[] = { { NULL, NULL, 0, NULL }, // sentinel }; -PyMODINIT_FUNC initchashsplit(void) +PyMODINIT_FUNC init_hashsplit(void) { - Py_InitModule("chashsplit", hashsplit_methods); + Py_InitModule("_hashsplit", hashsplit_methods); } diff --git a/csetup.py b/csetup.py index 2590557..b58932c 100644 --- a/csetup.py +++ b/csetup.py @@ -1,8 +1,8 @@ from distutils.core import setup, Extension -chashsplit_mod = Extension('chashsplit', sources=['chashsplitmodule.c']) +_hashsplit_mod = Extension('_hashsplit', sources=['_hashsplit.c']) -setup(name='chashsplit', +setup(name='_hashsplit', version='0.1', description='hashsplit helper library for bup', - ext_modules=[chashsplit_mod]) + ext_modules=[_hashsplit_mod]) diff --git a/hashsplit.py b/hashsplit.py index 7dee3d6..15efd08 100644 --- a/hashsplit.py +++ b/hashsplit.py @@ -1,5 +1,5 @@ import sys -import git, chashsplit +import git, _hashsplit from helpers import * BLOB_LWM = 8192*2 @@ -39,7 +39,7 @@ class Buf: def splitbuf(buf): global split_verbosely b = buf.peek(buf.used()) - ofs = chashsplit.splitbuf(b) + ofs = _hashsplit.splitbuf(b) if ofs: if split_verbosely >= 2: log('.') -- 2.39.5