File: gen_settings.py

package info (click to toggle)
node-srs 0.4.8%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 384 kB
  • ctags: 85
  • sloc: cpp: 135; makefile: 55; sh: 30; python: 12
file content (17 lines) | stat: -rwxr-xr-x 445 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
import sys

settings = os.path.abspath(sys.argv[2])

# this goes into a srs_settings.js file beside the C++ srs.node
settings_template = """
module.exports.shared_gdal = %s;
"""

if __name__ == '__main__':
    arg = sys.argv[1].strip("'").strip('"')
    # windows gives ../false
    if 'false' in arg:
        open(settings,'w').write(settings_template % 'false')
    else:
        open(settings,'w').write(settings_template % 'true')