[Greater-commits] r360 - trunk/GREAT-ER-DB
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jul 6 17:15:15 CEST 2011
Author: bricks
Date: 2011-07-06 17:15:14 +0200 (Wed, 06 Jul 2011)
New Revision: 360
Modified:
trunk/GREAT-ER-DB/setup.py
Log:
Fix indentation
Modified: trunk/GREAT-ER-DB/setup.py
===================================================================
--- trunk/GREAT-ER-DB/setup.py 2011-07-06 15:14:25 UTC (rev 359)
+++ trunk/GREAT-ER-DB/setup.py 2011-07-06 15:15:14 UTC (rev 360)
@@ -24,18 +24,18 @@
user_options = [
('oracle-interface-file=', None,
"C file with oracle interface implementation"),
- ('oracle-interface-lib=', None,
+ ('oracle-interface-lib=', None,
"DLL with oracle interface implementation"),
- ('postgres-interface-file=', None,
- "C file with postgres interface implementation"),
- ('postgres-interface-lib=', None,
- "DLL with postgres interface implementation"),
+ ('postgres-interface-file=', None,
+ "C file with postgres interface implementation"),
+ ('postgres-interface-lib=', None,
+ "DLL with postgres interface implementation"),
('wrapper-with-debug-output', None,
"Whether the python API wrapper should print debug output"),
- ('postgres-incl-path=', None,
- "The include path for postgresql"),
- ('postgres-lib-path=', None,
- "The libary path for postgresql")
+ ('postgres-incl-path=', None,
+ "The include path for postgresql"),
+ ('postgres-lib-path=', None,
+ "The libary path for postgresql")
]
boolean_options = ['wrapper_with_debug_output']
@@ -43,11 +43,11 @@
def initialize_options(self):
self.oracle_interface_file = None
self.oracle_interface_lib = None
- self.postgres_interface_file = None
- self.postgres_interface_lib = None
- self.wrapper_with_debug_output = None
- self.postgres_incl_path = None
- self.postgres_lib_path = None
+ self.postgres_interface_file = None
+ self.postgres_interface_lib = None
+ self.wrapper_with_debug_output = None
+ self.postgres_incl_path = None
+ self.postgres_lib_path = None
def finalize_options(self):
self.set_undefined_options("build",
@@ -55,23 +55,23 @@
"oracle_interface_file"),
("oracle_interface_lib",
"oracle_interface_lib"),
- ("postgres_interface_file",
- "postgres_interface_file"),
- ("postgres_interface_lib",
- "postgres_interface_lib"),
+ ("postgres_interface_file",
+ "postgres_interface_file"),
+ ("postgres_interface_lib",
+ "postgres_interface_lib"),
("wrapper_with_debug_output",
"wrapper_with_debug_output"),
- ("postgres_incl_path",
- "postgres_incl_path"),
- ("postgres_lib_path",
- "postgres_lib_path"))
+ ("postgres_incl_path",
+ "postgres_incl_path"),
+ ("postgres_lib_path",
+ "postgres_lib_path"))
if self.oracle_interface_file or self.oracle_interface_lib:
self.add_oracle_interface()
- elif self.postgres_interface_file or self.postgres_interface_lib:
- self.add_postgres_interface()
- else:
+ elif self.postgres_interface_file or self.postgres_interface_lib:
+ self.add_postgres_interface()
+ else:
# no oracle or postgres interface requested, so we don't build a
# C-extension at all
del ext_modules[:]
@@ -129,27 +129,27 @@
def postgres_extension_from_file(self):
dbapi_dir = os.path.dirname(self.postgres_interface_file)
- if self.postgres_incl_path:
- postgres_incdirs = [self.postgres_incl_path]
- else:
- # path on standard installation
- postgres_incdirs = ["/usr/include/postgresql"]
+ if self.postgres_incl_path:
+ postgres_incdirs = [self.postgres_incl_path]
+ else:
+ # path on standard installation
+ postgres_incdirs = ["/usr/include/postgresql"]
- if self.postgres_lib_path:
- postgres_lib_dirs = [self.postgres_lib_path]
- else:
- # path on standard installation
- postgres_lib_dirs = ["/usr/lib/postgresql/lib"]
-
- # self.run_command("ecpg "+self.postgres_interface_file)
+ if self.postgres_lib_path:
+ postgres_lib_dirs = [self.postgres_lib_path]
+ else:
+ # path on standard installation
+ postgres_lib_dirs = ["/usr/lib/postgresql/lib"]
+
+ # self.run_command("ecpg "+self.postgres_interface_file)
- # ecpg is the library, used for Embedded SQL in C,
- # pq offers the BLOB interface in this case
- postgres_libs = ["ecpg","pq"]
+ # ecpg is the library, used for Embedded SQL in C,
+ # pq offers the BLOB interface in this case
+ postgres_libs = ["ecpg", "pq", "dagreater_pg"]
return Extension("GreaterDB._dagreater_pg",
["dagreater/_dagreater_pg.c",
- os.path.join(dbapi_dir, "dagreater_pg.c"),
- os.path.join(dbapi_dir, "gdagreater_pg.c") ],
+ os.path.join(dbapi_dir, "dagreater_pg.c"),
+ os.path.join(dbapi_dir, "gdagreater_pg.c") ],
include_dirs = [dbapi_dir]+postgres_incdirs,
library_dirs = postgres_lib_dirs,
libraries = postgres_libs)
@@ -158,8 +158,12 @@
# Assume that the header files are in the same directory as the
# DLL.
libdir = os.path.dirname(self.postgres_interface_lib)
- incdir = libdir
+ #incdir = libdir
+ incdir = "/home/bricks/opt/include/dagreater"
lib = os.path.splitext(os.path.basename(self.postgres_interface_lib))[0]
+ if lib.find("lib") == 0:
+ # remove lib prefix
+ lib = lib[3:]
return Extension("GreaterDB._dagreater_pg",
["dagreater/_dagreater_pg.c"],
include_dirs = [incdir,],
@@ -170,7 +174,7 @@
"""Generate the wrapper code
If an oracle or postgres interface wrapper is requested, build both
- the c-level wrapper and the python wrapper. Otherwise only build the
+ the c-level wrapper and the python wrapper. Otherwise only build the
python level wrapper.
"""
if self.oracle_interface_file or self.oracle_interface_lib:
@@ -179,12 +183,12 @@
"_dagreater"),
pymodule = os.path.join("GreaterDB",
"pydagreater.py"),
- insert_debug_output=self.wrapper_with_debug_output,
+ insert_debug_output=self.wrapper_with_debug_output,
cheader = os.path.join("daexplib.h"),
write_c_header = 0,
extra_headers = ("datypes.h",))
- elif self.postgres_interface_file or self.postgres_interface_lib:
- generate_wrapper(os.path.join("dagreater", "apispec.py"),
+ elif self.postgres_interface_file or self.postgres_interface_lib:
+ generate_wrapper(os.path.join("dagreater", "apispec.py"),
cmodule = os.path.join("dagreater",
"_dagreater_pg"),
pymodule = os.path.join("GreaterDB",
@@ -212,10 +216,10 @@
"DLL with postgres interface implementation"),
('wrapper-with-debug-output', None,
"Whether the python API wrapper should print debug output"),
- ('postgres-incl-path=', None,
- "The include path for postgresql"),
- ('postgres-lib-path=', None,
- "The libary path for postgresql")
+ ('postgres-incl-path=', None,
+ "The include path for postgresql"),
+ ('postgres-lib-path=', None,
+ "The libary path for postgresql")
]
boolean_options = ['wrapper_with_debug_output']
@@ -226,11 +230,11 @@
self.oracle_interface_lib = None
self.postgres_interface_file = None
self.postgres_interface_lib = None
- self.wrapper_with_debug_output = None
- self.postgres_incl_path = None
- self.postgres_lib_path = None
-
+ self.wrapper_with_debug_output = None
+ self.postgres_incl_path = None
+ self.postgres_lib_path = None
+
# add generate_wrapper to the sub-commands of the build command. Put it
# first so that it's executed first
build.sub_commands.insert(0, ("generate_wrapper", None))
More information about the Greater-commits
mailing list