Some more fixes for setup and the binding

develop
RusAnon 2010-05-03 14:26:13 +11:00
parent 34a8424afd
commit f2fd748fc6
3 changed files with 10 additions and 10 deletions

@ -102,7 +102,7 @@ PyMODINIT_FUNC init_pydfhack(void)
if(PyType_Ready(&DF_GUI_type) < 0)
return;
module = Py_InitModule3("pydfhack", module_methods, "pydfhack extension module");
module = Py_InitModule3("_pydfhack", module_methods, "pydfhack extension module");
Py_INCREF(&DF_API_type);
Py_INCREF(&DF_MemInfo_type);

@ -6,13 +6,14 @@ except ImportError:
use_setuptools()
from setuptools import setup, find_packages
from distutils.core import Extension
from os import path
e = Extension("_pydfhack",
sources=["DF_API.cpp", "DF_Buildings.cpp", "DF_Constructions.cpp", "DF_CreatureManager.cpp", "DF_GUI.cpp", "DF_Maps.cpp", "DF_Material.cpp", "DF_Position.cpp", "DF_Translate.cpp", "DF_Vegetation.cpp", "pydfhack.cpp"],
include_dirs=["../", "../include", "../depends/md5", "../depends/tinyxml"],
library_dirs=["..\\..\\output"],
#extra_compile_args=["-w"],
libraries=["libdfhack"],
include_dirs=["../", path.join("..", "include"), path.join("..","depends","md5"), path.join("..","depends","tinyxml")],
library_dirs=[path.join("..","..","output")],
extra_compile_args=["-DLINUX_BUILD", "-w"],
libraries=["dfhack"],
export_symbols=["init_pydfhack", "ReadRaw", "WriteRaw"])
setup(

@ -1,9 +1,8 @@
#!/usr/bin/python
import sys
import pydfhack
import pydfapi
from smarthttp.lib.containers import SmartDict
DF = pydfapi.API("Memory.xml")
DF = pydfhack.API("Memory.xml")
DF.Attach()
@ -19,7 +18,7 @@ if cursor:
maps.Finish()
DF.Resume()
locs = dict(pydfhack=pydfhack, API=pydfhack._API, DF=DF, pos=pos, maps=maps, msize=msize, cursor=cursor, block=block)
locs = dict(pydfhack=pydfhack, API=pydfhack.API, DF=DF, pos=pos, maps=maps, msize=msize, cursor=cursor, block=block)
banner = """DFHack Shell\n\n"""\
"""\tpydfhack = {pydfhack}\n"""\