FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MapServer/src/mapscript/python/mapscript/__init__.py at main · jbfrd/MapServer · GitHub
jbfrd
/
MapServer
Public
forked from
MapServer/MapServer
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MapServer
/
src
/
mapscript
/
python
/
mapscript
/
__init__.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (31 loc) · 1.24 KB
Breadcrumbs
MapServer
/
src
/
mapscript
/
python
/
mapscript
/
__init__.py
Copy path
File metadata and controls
43 lines (31 loc) · 1.24 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import
sys
import
platform
import
os
import
inspect
# As of Python 3.8 PATH can no longer be used to resolve the MapServer
# DLLs on Windows. Instead users will be required to set a new MAPSERVER_DLL_PATH
# environment variable.
# See https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-python-api
def
add_dll_path
(
pth
):
"""
Allow Python to access the directory containing the MapServer DLL (for Python on Windows only)
"""
if
(
3
,
8
)
<=
sys
.
version_info
:
os
.
add_dll_directory
(
pth
)
else
:
# add the directory to the Windows path for earlier Python version
os
.
environ
[
'PATH'
]
=
pth
+
';'
+
os
.
environ
[
'PATH'
]
if
platform
.
system
()
==
'Windows'
:
mapserver_dll_path
=
os
.
getenv
(
'MAPSERVER_DLL_PATH'
,
''
)
dll_paths
=
list
(
filter
(
os
.
path
.
exists
,
mapserver_dll_path
.
split
(
';'
)))
# add paths in the order listed in the string
dll_paths
.
reverse
()
for
pth
in
dll_paths
:
add_dll_path
(
pth
)
from
.
mapscript
import
*
# change all the class module names from mapscript.mapscript to mapscript
for
key
,
value
in
globals
().
copy
().
items
():
if
inspect
.
isclass
(
value
)
and
value
.
__module__
.
startswith
(
'mapscript.'
):
value
.
__module__
=
'mapscript'
# remove the submodule name
del
mapscript
Back
|
FazBrowse Home
|
New Git URL