193 | | lwpostgis_file = os.path.join(sql_path, 'lwpostgis.sql') |
194 | | srefsys_file = os.path.join(sql_path, 'spatial_ref_sys.sql') |
195 | | if not os.path.isfile(lwpostgis_file): |
196 | | raise Exception('Could not find PostGIS function definitions in %s' % lwpostgis_file) |
197 | | if not os.path.isfile(srefsys_file): |
198 | | raise Exception('Could not find PostGIS spatial reference system definitions in %s' % srefsys_file) |
| 193 | lwpostgis_file_locations = ( |
| 194 | os.path.join(sql_path, 'lwpostgis.sql'), |
| 195 | os.path.join(sql_path, 'contrib', 'lwpostgis.sql'), |
| 196 | os.path.join(sql_path, 'contrib', 'lwpostgis-64.sql'), |
| 197 | ) |
| 198 | srefsys_file_locations = ( |
| 199 | os.path.join(sql_path, 'spatial_ref_sys.sql'), |
| 200 | os.path.join(sql_path, 'contrib', 'spatial_ref_sys.sql'), |
| 201 | ) |
| 202 | for lwpostgis_file in lwpostgis_file_locations: |
| 203 | if os.path.isfile(lwpostgis_file): |
| 204 | break |
| 205 | else: |
| 206 | raise Exception('Could not find PostGIS function definitions in any of %s' % lwpostgis_file_locations) |
| 207 | for srefsys_file in srefsys_file_locations: |
| 208 | if os.path.isfile(srefsys_file): |
| 209 | break |
| 210 | else: |
| 211 | raise Exception('Could not find PostGIS spatial reference system definitions in any of %s' % srefsys_file_locations) |