diff --git a/dfhack/python/pydfhack.cpp b/dfhack/python/pydfhack.cpp index 80b2c3571..8d1fded04 100644 --- a/dfhack/python/pydfhack.cpp +++ b/dfhack/python/pydfhack.cpp @@ -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); diff --git a/dfhack/python/setup.py b/dfhack/python/setup.py index 226681478..1f95d9238 100644 --- a/dfhack/python/setup.py +++ b/dfhack/python/setup.py @@ -6,14 +6,15 @@ 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"], - export_symbols=["init_pydfhack", "ReadRaw", "WriteRaw"]) + 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=["../", 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( name="PyDFHack", diff --git a/dfhack/python/shell.py b/dfhack/python/shell.py index 1967ba4c2..0ed37b52a 100755 --- a/dfhack/python/shell.py +++ b/dfhack/python/shell.py @@ -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"""\