Esempio n. 1
0
#--------------------------------------------------------------------------    
#--------------------------------------------------------------------------
#MAIN

if __name__ == "__main__":

    try:

        #---- Create the Geoprocessing Object ----------------------
        gp = arcgisscripting.create(9.3)
        
        #----- Create the Custom Error Object ----------------------
        e = SvmpToolsError(gp)
        # Set some basic defaults for error handling
        e.debug = True
        e.full_tb = True
        
        #-------- unit conversion flag --------------------
        unit_convert = "sf2m"
        
        def msg(msg):
            gp.AddMessage(msg)
        
            
        # ----------- PARAMETERS ----------------------------------
        # Temporary stand-ins for parameters
        #dbPath = "c:/projects/dnr_svmp/output/eelgrass_monitoring/"
        #blPath = "c:/projects/dnr_svmp/output/eelgrass_monitoring/base_layers/"
        #outPath = "c:/projects/dnr_svmp/output/eelgrass_monitoring/ab_out/"
        #siteTable = dbPath  + "svmp_sitesdb_2009_12_21.mdb/all_years_sites"  #"svmp_sitesdb_2009_12_21.mdb/2007sites"
Esempio n. 2
0
import traceback
import arcgisscripting
from svmp_exceptions import SvmpToolsError

DEBUG = True
PDB_DEBUG = False

# Create the geoprocessing object
gp = arcgisscripting.create()

# Create the custom error class
# and associate it with the gp
error = SvmpToolsError(gp)

# Set some basic defaults for error handling
error.debug = True
error.pdb = True

def main():
  try:
    raise RuntimeError
  except Exception, E:
    error.call('An intentional RuntimeError occurred in the python script..')

if __name__ == "__main__":
  try:
    main()
  except Exception, E:
    error.call(E)