forked from geopython/pywps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
134 lines (117 loc) · 4.71 KB
/
setup.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
"""PyWPS: Implementation of OGC's Web Processing Service in Python
PyWPS is simple cgi set of scripts, which (nearly) fills standard of OGC
(http://opengis.org) Web Processing Service. This standard describes the
way how geoinformation operations should be served via networks.
PyWPS provides environment for writing own scripts with help of GIS GRASS
modules (http://grass.osgeo.it). User of PyWPS can easily focuse on writing
own GRASS-scripts, without taking care on how the data will be imported and
served back to the client. Providing GRASS funktionality on the Internet
should be as easy as possible.
"""
# SETUP
name = 'pywps'
# END of SETUP
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: Communications :: Email',
'Topic :: Office/Business',
'Topic :: Software Development :: Bug Tracking',
]
#from distutils.core import setup
from setuptools import setup
import sys,os,traceback
doclines = __doc__.split("\n")
dist = setup(
name = name,
version = 'soap-branch',
maintainer="Jachym Cepicky",
maintainer_email = '[email protected]',
author = 'Jachym Cepicky',
author_email = '[email protected]',
url = 'http://pywps.wald.intevation.org',
license = "http://www.gnu.org/licenses/gpl.html",
download_url="http://pywps.wald.intevation.org",
description=doclines[0],
zip_safe=False,
platforms=["any"],
classifiers= classifiers,
long_description = "\n".join(doclines[1:]),
packages = [
'pywps',
'pywps.Wps',
'pywps.Wps.Execute',
'pywps.XSLT',
'pywps.etc',
'pywps.Parser',
'pywps.Process',
'pywps.Templates',
'pywps.Templates.1_0_0',
'pywps.Templates.1_0_0.inc',
],
package_dir={
'pywps':"pywps",
'pywps.Wps':'pywps/Wps',
'pywps.Wps.Execute':'pywps/Wps/Execute',
'pywps.XSLT':'pywps/XSLT',
'pywps.Parser':'pywps/Parser',
'pywps.Process':'pywps/Process',
'pywps.Templates':'pywps/Templates',
'pywps.Templates.1_0_0':'pywps/Templates/1_0_0',
'pywps.Templates.1_0_0.inc':'pywps/Templates/1_0_0/inc',
},
package_data={
'pywps':
['Templates/1_0_0/*.tmpl',
'XSLT/*.xsl',
'processes/*.py-dist','processes/README',
'default.cfg'],
'pywps.Templates.1_0_0': ['inc/*.tmpl']
},
scripts=['wps.py']
)
# check, if we are really installing
dryRun = False
install = False
for arg in sys.argv:
if arg == "--dry-run":
dryRun = True
if arg == "install":
install = True
# post installation part
if not dryRun and install and not os.environ.has_key("FAKEROOTKEY"):
# compile templates
# compiling before installing is necessary, because the apache
# webserver has not the permission to create new files in the
# python site-packages directory
#setup.py can't load pywps automatically, the egg path needs to be added to
#python path
#prevent loading from current path
sys.path=sys.path[1:]
eggPath=os.path.join(dist.command_obj['install'].install_lib,os.path.basename(dist.command_obj['bdist_egg'].egg_output))
sys.path.append(eggPath)
baseDir=os.path.join(eggPath,"pywps","Templates")
try:
from pywps.Template import TemplateProcessor
versionDirs = ['1_0_0']
template_files = ['GetCapabilities', 'DescribeProcess','Execute']
for version in versionDirs:
for template_file in template_files:
print "Compiling template "+template_file+" in "+baseDir
template_file = os.path.join(baseDir,version,template_file + '.tmpl')
print template_file
template = TemplateProcessor(fileName=template_file,compile=True)
except Exception,e:
print "dry-run only, templates are not complied"
print "----------------"
traceback.print_exc(file=sys.stdout)
print "----------------"
print "Please run pywps to compile templates"
else:
print "dry-run only, templates are not complied"