示例#1
0
import cwm
import inspect 
from collections import OrderedDict
import tool 

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

TEST = 1
DELETE = 2
CREATE = 3
RECREATE = 4
UPDATE = 5
object_mode = { 'test':TEST, 'delete':DELETE, 'create':CREATE, 'recreate':RECREATE, 'update':UPDATE }

tool.add_argument( '--force',  
    help    = 'force delete of object if it appears to not exist', 
    action  = 'store_true' )

tool.add_argument( '--mode', '-m',  
    help    = 'mode for handling objects, overriding @mode directive on object',
    choices = object_mode.keys() )

tool.add_argument( '--default-mode', '-d',  
    help    = 'mode for handling objects, with no @mode directive',
    choices = object_mode.keys(),
    dest    = 'defaultMode',
    default = 'test' )

tool.add_argument( '--report-filename', '-r',  
    help    = 'send report to this file. Set by default when using @filename',
    dest    = 'reportFilename' )
from collections import OrderedDict
import argparse
import json
import traceback
import os
import tables
import tool

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# parser = argparse.ArgumentParser()

# name, description, dataSourceId, configurationScopeName, metadataUrl, oauth2RenderScopeName, oauth2ReportScopeName, oauth2ViewScopeName, featureViewCategoryId
tool.add_argument('--features',
                  '-f',
                  help='CSV containing features',
                  dest='features',
                  default=tables.sosLayers)

# featureName, name, title, order, description, attributeTypeId
tool.add_argument('--feature-attributes',
                  '-a',
                  help='CSV containing feature attributes',
                  dest='feature_attributes',
                  default=tables.featureAttributes)

tool.add_argument('--out-dir',
                  '-d',
                  help='name of directory to receive files',
                  dest='dir',
                  default='feature-classes')
import csv
import json
from collections import OrderedDict
import argparse
import traceback
import os
import tables
import tool

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# name
tool.add_argument('--maps',
                  '-m',
                  help='CSV containing maps',
                  dest='maps',
                  default=tables.maps)

# mapName, title, id, layerType, url, transparent, singleTile, opacity, expanded, visibility
tool.add_argument('--overlays',
                  '-o',
                  help='CSV containing overlays',
                  dest='overlays',
                  default=tables.mapOverlays)

# mapName, overlayId, title, id, layers, styles, url, geometryAttribute, titleAttribute, identifiable, selectable, visibility, max_scale,
tool.add_argument('--layers',
                  '-l',
                  help='CSV containing layers',
                  dest='layers',
示例#4
0
import sys
import csv
import json
from collections import OrderedDict
import argparse
import json
import traceback
import requests
from prompt import prompt 
import tool 

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

tool.add_argument( '--style-dir', '-s',  
    help    = 'directory containing SLDs',
    dest    = 'styleDir',
    default = 'styles' )

tool.add_argument( '--test', '-t',  
    help    = 'test existance of layers',
    action  = 'store_true' )

args = tool.args()

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

env = tool.import_environment()
if not env:
    tool.INFO( "Could not load environment {0}", environment_name() )
    exit(1)
示例#5
0
import csv
import json
from collections import OrderedDict
import argparse
import json
import traceback
import os
import tables
import tool

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# name, description, dataSourceId, configurationScopeName, metadataUrl, oauth2RenderScopeName, oauth2ReportScopeName, oauth2ViewScopeName, featureViewCategoryId
tool.add_argument('--features',
                  '-f',
                  help='CSV containing features',
                  dest='features',
                  default=tables.mapLayers)

tool.add_argument('--base-dir',
                  '-b',
                  help='name of directory to work in',
                  dest='base',
                  default='.')

tool.add_argument('--constants',
                  '-c',
                  help='JSON containing constant columns',
                  dest='constants',
                  default='constants.json')
示例#6
0
import csv
import json
from collections import OrderedDict
import argparse
import traceback
import os
import tables
import tool

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# name, title
tool.add_argument('--query-templates',
                  '-q',
                  help='CSV containing query templates',
                  dest='qt',
                  default=tables.maps)

# templateName, name, description,nameFormat,summaryFormat,featureName,order
tool.add_argument('--query-template-layers',
                  '-l',
                  help='CSV containing query template layers',
                  dest='qtl',
                  default=tables.queryTemplateLayers)

# templateLayerName, name, title, order, description, featureAttributeName
tool.add_argument('--query-template-layer-attributes',
                  '-a',
                  help='CSV containing query template layer attributes',
                  dest='qtla',