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) if(PyType_Ready(&DF_GUI_type) < 0)
return; 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_API_type);
Py_INCREF(&DF_MemInfo_type); Py_INCREF(&DF_MemInfo_type);

@ -6,14 +6,15 @@ except ImportError:
use_setuptools() use_setuptools()
from setuptools import setup, find_packages from setuptools import setup, find_packages
from distutils.core import Extension from distutils.core import Extension
from os import path
e = Extension("_pydfhack", 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"], 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"], include_dirs=["../", path.join("..", "include"), path.join("..","depends","md5"), path.join("..","depends","tinyxml")],
library_dirs=["..\\..\\output"], library_dirs=[path.join("..","..","output")],
#extra_compile_args=["-w"], extra_compile_args=["-DLINUX_BUILD", "-w"],
libraries=["libdfhack"], libraries=["dfhack"],
export_symbols=["init_pydfhack", "ReadRaw", "WriteRaw"]) export_symbols=["init_pydfhack", "ReadRaw", "WriteRaw"])
setup( setup(
name="PyDFHack", name="PyDFHack",

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