def publishfromconfig(self, configFiles, combinedApp=None, dateTimeFormat=None): publishTools = None webmaps = None config = None resultsItems = None resultFS = None resultMaps = None resultApps = None combinedResults = None if dateTimeFormat is None: dateTimeFormat = '%Y-%m-%d %H:%M' scriptStartTime = datetime.datetime.now() try: webmaps = [] print("********************Script Started********************") print("Script started at %s" % scriptStartTime.strftime(dateTimeFormat)) # start report processing (moved out from under ArcREST logic. no AGO crednetials needed to run reports) for configFile in configFiles: config = common.init_config_json(config_file=configFile) if config is not None: if 'ReportDetails' in config: if reportToolsInstalled == False: print( "Report section is included in the config file but the solutionreporttools cannot be located" ) else: reportConfig = config['ReportDetails'] # This code checks to see if you want to export the data from SDE to a local GDB. The parameter is set in config file. # Could be performance gain to run locally. If you choose this option, both the report and the data prep in memory config # are modified so they can point to the local temp location. if 'RunReport' in reportConfig and ( str(reportConfig['RunReport']).upper() == "TRUE" or str(reportConfig['RunReport']).upper() == "YES"): reportConfig = ReportTools.reportDataPrep( reportConfig) print("-----Report Section Starting-----") startTime = datetime.datetime.now() print( "Processing reports in config %s, starting at: %s" % (configFile, startTime.strftime(dateTimeFormat))) ReportTools.create_report_layers_using_config( config=reportConfig) print( "Reports in config %s completed, time to complete: %s" % (configFile, str(datetime.datetime.now() - startTime))) print("-----Report Section Complete-----") if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print( "PublishingDetails is missing the PublishData parameter: type string, values, True or False" ) publishData = 'TRUE' if (str(publishData).upper() == "TRUE" or str(publishData).upper() == "YES"): print(" ") print("-----Publishing Section Starting-----") startTime = datetime.datetime.now() print( "Processing publishing in config %s, starting at: %s" % (configFile, startTime.strftime(dateTimeFormat))) publishTools = publishingtools.publishingtools( securityinfo=self) if publishTools.valid == False: print("Error creating publishing tools: %s" % publishTools.message) else: print("Publishing tools created: %s" % publishTools.message) resultFS = [] if 'Items' in publishingConfig: startSectTime = datetime.datetime.now() print(" ") print("Creating Items: %s" % str( startSectTime.strftime(dateTimeFormat)) ) resultsItems = publishTools.publishItems( items_info=publishingConfig['Items']) print( "Items created, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'FeatureCollections' in publishingConfig: startSectTime = datetime.datetime.now() print(" ") print("Creating Feature Collection: %s" % str( startSectTime.strftime( dateTimeFormat))) resultFS = publishTools.publishFeatureCollections( configs=publishingConfig[ 'FeatureCollections']) print( "Feature Collection published, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'FeatureServices' in publishingConfig: startSectTime = datetime.datetime.now() print(" ") print("Creating Feature Services: %s" % str( startSectTime.strftime( dateTimeFormat))) resultFS = resultFS + publishTools.publishFsFromMXD( fs_config=publishingConfig[ 'FeatureServices']) if len(resultFS) == 0: print( "Exiting, error creating feature services" ) return print( "Feature Services published, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'ExistingServices' in publishingConfig: startSectTime = datetime.datetime.now() print(" ") print( "Updating Existing Feature Services: %s" % str( startSectTime.strftime( dateTimeFormat))) resultES = publishTools.updateFeatureService( efs_config=publishingConfig[ 'ExistingServices']) print( "Updating Existing Feature Services completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'MapDetails' in publishingConfig: startSectTime = datetime.datetime.now() print(" ") print("Creating maps: %s" % str( startSectTime.strftime(dateTimeFormat)) ) resultMaps = publishTools.publishMap( maps_info=publishingConfig[ 'MapDetails'], fsInfo=resultFS, itInfo=resultsItems) for maps in resultMaps: if 'MapInfo' in maps: if 'Results' in maps['MapInfo']: if 'itemId' in maps['MapInfo'][ 'Results']: webmaps.append( maps['MapInfo'] ['Results']['itemId']) print( "Creating maps completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'AppDetails' in publishingConfig: startSectTime = datetime.datetime.now() print(" ") print("Creating apps: %s" % str( startSectTime.strftime(dateTimeFormat)) ) resultApps = publishTools.publishApp( app_info=publishingConfig[ 'AppDetails'], map_info=resultMaps, fsInfo=resultFS) print( "Creating apps completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) print( "Publishing complete in config %s completed, time to complete: %s" % (configFile, str(datetime.datetime.now() - startTime))) print("-----Publishing Section Complete-----") else: print("Config %s not found" % configFile) if combinedApp: if os.path.exists(combinedApp): print(" ") startSectTime = datetime.datetime.now() print("Creating combined result: %s" % str(startSectTime.strftime(dateTimeFormat))) config = common.init_config_json(config_file=combinedApp) combinedResults = publishTools.publishCombinedWebMap( maps_info=config['PublishingDetails']['MapDetails'], webmaps=webmaps) if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print( "PublishingDetails is missing the PublishData parameter: type string, values, True or False" ) publishData = 'TRUE' if (str(publishData).upper() == "TRUE" or str(publishData).upper() == "YES"): if 'AppDetails' in publishingConfig: resultApps = publishTools.publishApp( app_info=publishingConfig['AppDetails'], map_info=combinedResults) print( "Creating combind result completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) except (TypeError, ValueError, AttributeError) as e: print(e) except (common.ArcRestHelperError) as e: print("error in function: %s" % e[0]['function']) print("error on line: %s" % e[0]['line']) print("error in file name: %s" % e[0]['filename']) print("with error message: %s" % e[0]['synerror']) if 'arcpyError' in e[0]: print("with arcpy message: %s" % e[0]['arcpyError']) except Exception as e: if (reportToolsInstalled): if isinstance( e, (ReportTools.ReportToolsError, DataPrep.DataPrepError)): print("error in function: %s" % e[0]['function']) print("error on line: %s" % e[0]['line']) print("error in file name: %s" % e[0]['filename']) print("with error message: %s" % e[0]['synerror']) if 'arcpyError' in e[0]: print("with arcpy message: %s" % e[0]['arcpyError']) else: line, filename, synerror = trace() print("error on line: %s" % line) print("error in file name: %s" % filename) print("with error message: %s" % synerror) else: line, filename, synerror = trace() print("error on line: %s" % line) print("error in file name: %s" % filename) print("with error message: %s" % synerror) finally: print("Script complete, time to complete: %s" % str(datetime.datetime.now() - scriptStartTime)) print("###############Script Completed#################") print("") if publishTools is not None: publishTools.dispose() publishTools = None webmaps = None config = None resultFS = None resultsItems = None resultMaps = None resultApps = None combinedResults = None del publishTools del webmaps del config del resultFS del resultMaps del resultApps del combinedResults del resultsItems gc.collect()
def publishfromconfig(self, configFiles, combinedApp=None, dateTimeFormat=None): publishTools = None webmaps = None config = None resultsItems = None resultFS = None resultMaps = None resultApps = None combinedResults = None if dateTimeFormat is None: dateTimeFormat = '%Y-%m-%d %H:%M' env.overwriteOutput = True scriptStartTime = datetime.datetime.now() try: webmaps = [] print "********************Script Started********************" print "Script started at %s" % scriptStartTime.strftime( dateTimeFormat) # start report processing (moved out from under ArcREST logic. no AGO crednetials needed to run reports) for configFile in configFiles: config = common.init_config_json(config_file=configFile) if config is not None: if 'ReportDetails' in config: if reportToolsInstalled == False: print "Report section is included in the config file but the solutionreporttools cannot be located" else: reportConfig = config['ReportDetails'] # This code checks to see if you want to export the data from SDE to a local GDB. The parameter is set in config file. # Could be performance gain to run locally. If you choose this option, both the report and the data prep in memory config # are modified so they can point to the local temp location. if 'RunReport' in reportConfig and ( str(reportConfig['RunReport']).upper() == "TRUE" or str(reportConfig['RunReport']).upper() == "YES"): reportConfig = ReportTools.reportDataPrep( reportConfig) print "-----Report Section Starting-----" startTime = datetime.datetime.now() print "Processing reports in config %s, starting at: %s" % ( configFile, startTime.strftime(dateTimeFormat)) ReportTools.create_report_layers_using_config( config=reportConfig) print "Reports in config %s completed, time to complete: %s" % ( configFile, str(datetime.datetime.now() - startTime)) print "-----Report Section Complete-----" if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print "PublishingDetails is missing the PublishData parameter: type string, values, True or False" publishData = 'TRUE' if (str(publishData).upper() == "TRUE" or str(publishData).upper() == "YES"): print " " print "-----Publishing Section Starting-----" startTime = datetime.datetime.now() print "Processing publishing in config %s, starting at: %s" % ( configFile, startTime.strftime(dateTimeFormat)) publishTools = publishingtools.publishingtools( securityinfo=self) if publishTools.valid == False: print "Error creating publishing tools: %s" % publishTools.message else: print "Publishing tools created: %s" % publishTools.message resultFS = [] if 'Items' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating Items: %s" % str( startSectTime.strftime(dateTimeFormat)) resultsItems = publishTools.publishItems( items_info=publishingConfig['Items']) print "Items created, time to complete: %s" % str( datetime.datetime.now() - startSectTime) if 'FeatureCollections' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating Feature Collection: %s" % str( startSectTime.strftime(dateTimeFormat)) resultFS = publishTools.publishFeatureCollections( configs=publishingConfig[ 'FeatureCollections']) print "Feature Collection published, time to complete: %s" % str( datetime.datetime.now() - startSectTime) if 'FeatureServices' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating Feature Services: %s" % str( startSectTime.strftime(dateTimeFormat)) resultFS = resultFS + publishTools.publishFsFromMXD( fs_config=publishingConfig[ 'FeatureServices']) print "Feature Services published, time to complete: %s" % str( datetime.datetime.now() - startSectTime) if 'ExistingServices' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Updating Existing Feature Services: %s" % str( startSectTime.strftime(dateTimeFormat)) resultES = publishTools.updateFeatureService( efs_config=publishingConfig[ 'ExistingServices']) print "Updating Existing Feature Services completed, time to complete: %s" % str( datetime.datetime.now() - startSectTime) if 'MapDetails' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating maps: %s" % str( startSectTime.strftime(dateTimeFormat)) resultMaps = publishTools.publishMap( maps_info=publishingConfig[ 'MapDetails'], fsInfo=resultFS, itInfo=resultsItems) for maps in resultMaps: if 'MapInfo' in maps: if 'Results' in maps['MapInfo']: if 'itemId' in maps['MapInfo'][ 'Results']: webmaps.append( maps['MapInfo'] ['Results']['itemId']) print "Creating maps completed, time to complete: %s" % str( datetime.datetime.now() - startSectTime) if 'AppDetails' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating apps: %s" % str( startSectTime.strftime(dateTimeFormat)) resultApps = publishTools.publishApp( app_info=publishingConfig[ 'AppDetails'], map_info=resultMaps) print "Creating apps completed, time to complete: %s" % str( datetime.datetime.now() - startSectTime) print "Publishing complete in config %s completed, time to complete: %s" % ( configFile, str(datetime.datetime.now() - startTime)) print "-----Publishing Section Complete-----" else: print "Config %s not found" % configFile if combinedApp: if os.path.exists(combinedApp): print " " startSectTime = datetime.datetime.now() print "Creating combined result: %s" % str( startSectTime.strftime(dateTimeFormat)) config = common.init_config_json(config_file=combinedApp) combinedResults = publishTools.publishCombinedWebMap( maps_info=config['PublishingDetails']['MapDetails'], webmaps=webmaps) if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print "PublishingDetails is missing the PublishData parameter: type string, values, True or False" publishData = 'TRUE' if (str(publishData).upper() == "TRUE" or str(publishData).upper() == "YES"): if 'AppDetails' in publishingConfig: resultApps = publishTools.publishApp( app_info=publishingConfig['AppDetails'], map_info=combinedResults) print "Creating combind result completed, time to complete: %s" % str( datetime.datetime.now() - startSectTime) except (TypeError, ValueError, AttributeError), e: print e
def publishfromconfig(self,configFiles,combinedApp=None,dateTimeFormat=None): publishTools = None webmaps = None config = None resultsItems = None resultFS = None resultMaps = None resultApps = None combinedResults = None if dateTimeFormat is None: dateTimeFormat = '%Y-%m-%d %H:%M' scriptStartTime = datetime.datetime.now() try: webmaps = [] print ("********************Script Started********************") print ("Script started at %s" % scriptStartTime.strftime(dateTimeFormat)) # start report processing (moved out from under ArcREST logic. no AGO crednetials needed to run reports) for configFile in configFiles: config = common.init_config_json(config_file=configFile) if config is not None: if 'ReportDetails' in config: if reportToolsInstalled == False: print ("Report section is included in the config file but the solutionreporttools cannot be located") else: reportConfig = config['ReportDetails'] # This code checks to see if you want to export the data from SDE to a local GDB. The parameter is set in config file. # Could be performance gain to run locally. If you choose this option, both the report and the data prep in memory config # are modified so they can point to the local temp location. if 'RunReport' in reportConfig and (str(reportConfig['RunReport']).upper() =="TRUE" or str(reportConfig['RunReport']).upper() =="YES"): reportConfig = ReportTools.reportDataPrep(reportConfig) print ("-----Report Section Starting-----") startTime = datetime.datetime.now() print ("Processing reports in config %s, starting at: %s" % (configFile,startTime.strftime(dateTimeFormat))) ReportTools.create_report_layers_using_config(config=reportConfig) print ("Reports in config %s completed, time to complete: %s" % (configFile, str(datetime.datetime.now() - startTime))) print ("-----Report Section Complete-----") if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print ("PublishingDetails is missing the PublishData parameter: type string, values, True or False") publishData = 'TRUE' if (str(publishData).upper() =="TRUE" or str(publishData).upper() =="YES"): print (" ") print ("-----Publishing Section Starting-----") startTime = datetime.datetime.now() print ("Processing publishing in config %s, starting at: %s" % (configFile,startTime.strftime(dateTimeFormat))) publishTools = publishingtools.publishingtools(securityinfo=self) if publishTools.valid == False : print ("Error creating publishing tools: %s" % publishTools.message) else: print ("Publishing tools created: %s" % publishTools.message) resultFS = [] if 'Items' in publishingConfig: startSectTime = datetime.datetime.now() print (" ") print ("Creating Items: %s" % str(startSectTime.strftime(dateTimeFormat))) resultsItems = publishTools.publishItems(items_info=publishingConfig['Items']) print ("Items created, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'FeatureCollections' in publishingConfig: startSectTime = datetime.datetime.now() print (" ") print ("Creating Feature Collection: %s" % str(startSectTime.strftime(dateTimeFormat))) resultFS = publishTools.publishFeatureCollections(configs=publishingConfig['FeatureCollections']) print ("Feature Collection published, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'FeatureServices' in publishingConfig: startSectTime = datetime.datetime.now() print (" ") print ("Creating Feature Services: %s" % str(startSectTime.strftime(dateTimeFormat))) resultFS = resultFS + publishTools.publishFsFromMXD(fs_config=publishingConfig['FeatureServices']) if len(resultFS) == 0: print ("Exiting, error creating feature services") return print ("Feature Services published, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'ExistingServices' in publishingConfig: startSectTime = datetime.datetime.now() print (" ") print ("Updating Existing Feature Services: %s" % str(startSectTime.strftime(dateTimeFormat))) resultES = publishTools.updateFeatureService(efs_config=publishingConfig['ExistingServices']) print ("Updating Existing Feature Services completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'MapDetails' in publishingConfig: startSectTime = datetime.datetime.now() print (" ") print ("Creating maps: %s" % str(startSectTime.strftime(dateTimeFormat))) resultMaps = publishTools.publishMap(maps_info=publishingConfig['MapDetails'],fsInfo=resultFS,itInfo=resultsItems) for maps in resultMaps: if 'MapInfo' in maps: if 'Results' in maps['MapInfo']: if 'itemId' in maps['MapInfo']['Results']: webmaps.append(maps['MapInfo']['Results']['itemId']) print ("Creating maps completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) if 'AppDetails' in publishingConfig: startSectTime = datetime.datetime.now() print (" ") print ("Creating apps: %s" % str(startSectTime.strftime(dateTimeFormat))) resultApps = publishTools.publishApp(app_info=publishingConfig['AppDetails'],map_info=resultMaps,fsInfo=resultFS) print ("Creating apps completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) print ("Publishing complete in config %s completed, time to complete: %s" % (configFile, str(datetime.datetime.now() - startTime))) print ("-----Publishing Section Complete-----") else: print ("Config %s not found" % configFile) if combinedApp: if os.path.exists(combinedApp): print (" ") startSectTime = datetime.datetime.now() print ("Creating combined result: %s" % str(startSectTime.strftime(dateTimeFormat))) config = common.init_config_json(config_file=combinedApp) combinedResults = publishTools.publishCombinedWebMap(maps_info=config['PublishingDetails']['MapDetails'],webmaps=webmaps) if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print ("PublishingDetails is missing the PublishData parameter: type string, values, True or False") publishData = 'TRUE' if (str(publishData).upper() =="TRUE" or str(publishData).upper() =="YES"): if 'AppDetails' in publishingConfig: resultApps = publishTools.publishApp(app_info=publishingConfig['AppDetails'],map_info=combinedResults) print ("Creating combind result completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime)) except(TypeError,ValueError,AttributeError) as e: print (e) except (common.ArcRestHelperError) as e: print ("error in function: %s" % e[0]['function']) print ("error on line: %s" % e[0]['line']) print ("error in file name: %s" % e[0]['filename']) print ("with error message: %s" % e[0]['synerror']) if 'arcpyError' in e[0]: print ("with arcpy message: %s" % e[0]['arcpyError']) except Exception as e: if (reportToolsInstalled): if isinstance(e,(ReportTools.ReportToolsError,DataPrep.DataPrepError)): print ("error in function: %s" % e[0]['function']) print ("error on line: %s" % e[0]['line']) print ("error in file name: %s" % e[0]['filename']) print ("with error message: %s" % e[0]['synerror']) if 'arcpyError' in e[0]: print ("with arcpy message: %s" % e[0]['arcpyError']) else: line, filename, synerror = trace() print ("error on line: %s" % line) print ("error in file name: %s" % filename) print ("with error message: %s" % synerror) else: line, filename, synerror = trace() print ("error on line: %s" % line) print ("error in file name: %s" % filename) print ("with error message: %s" % synerror) finally: print ("Script complete, time to complete: %s" % str(datetime.datetime.now() - scriptStartTime)) print ("###############Script Completed#################") print ("") if publishTools is not None: publishTools.dispose() publishTools = None webmaps = None config = None resultFS = None resultsItems = None resultMaps = None resultApps = None combinedResults = None del publishTools del webmaps del config del resultFS del resultMaps del resultApps del combinedResults del resultsItems gc.collect()
def publishfromconfig(self,configFiles,combinedApp=None,dateTimeFormat=None): publishTools = None webmaps = None config = None resultFS = None resultMaps = None resultApps = None combinedResults = None if dateTimeFormat is None: dateTimeFormat = '%Y-%m-%d %H:%M' env.overwriteOutput = True scriptStartTime = datetime.datetime.now() try: webmaps = [] print "********************Script Started********************" print "Script started at %s" % scriptStartTime.strftime(dateTimeFormat) # start report processing (moved out from under ArcREST logic. no AGO crednetials needed to run reports) for configFile in configFiles: config = common.init_config_json(config_file=configFile) if config is not None: if 'ReportDetails' in config: if reportToolsInstalled == False: print "Report section is included in the config file but the solutionreporttools cannot be located" else: reportConfig = config['ReportDetails'] # This code checks to see if you want to export the data from SDE to a local GDB. The parameter is set in config file. # Could be performance gain to run locally. If you choose this option, both the report and the data prep in memory config # are modified so they can point to the local temp location. if 'RunReport' in reportConfig and (str(reportConfig['RunReport']).upper() =="TRUE" or str(reportConfig['RunReport']).upper() =="YES"): reportConfig = ReportTools.reportDataPrep(reportConfig) print "-----Report Section Starting-----" startTime = datetime.datetime.now() print "Processing reports in config %s, starting at: %s" % (configFile,startTime.strftime(dateTimeFormat)) ReportTools.create_report_layers_using_config(config=reportConfig) print "Reports in config %s completed, time to complete: %s" % (configFile, str(datetime.datetime.now() - startTime)) print "-----Report Section Complete-----" if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print "PublishingDetails is missing the PublishData parameter: type string, values, True or False" publishData = 'TRUE' if (str(publishData).upper() =="TRUE" or str(publishData).upper() =="YES"): print " " print "-----Publishing Section Starting-----" startTime = datetime.datetime.now() print "Processing publishing in config %s, starting at: %s" % (configFile,startTime.strftime(dateTimeFormat)) publishTools = publishingtools.publishingtools(securityinfo=self) if publishTools.valid == False : print "Error creating publishing tools: %s" % publishTools.message else: print "Publishing tools created: %s" % publishTools.message if 'FeatureServices' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating Feature Services: %s" % str(startSectTime.strftime(dateTimeFormat)) resultFS = publishTools.publishFsFromMXD(fs_config=publishingConfig['FeatureServices']) print "Feature Services published, time to complete: %s" % str(datetime.datetime.now() - startSectTime) if 'ExistingServices' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Updating Existing Feature Services: %s" % str(startSectTime.strftime(dateTimeFormat)) resultES = publishTools.updateFeatureService(efs_config=publishingConfig['ExistingServices']) print "Updating Existing Feature Services completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime) if 'MapDetails' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating maps: %s" % str(startSectTime.strftime(dateTimeFormat)) resultMaps = publishTools.publishMap(maps_info=publishingConfig['MapDetails'],fsInfo=resultFS) for maps in resultMaps: if 'MapInfo' in maps: if 'Results' in maps['MapInfo']: if 'id' in maps['MapInfo']['Results']: webmaps.append(maps['MapInfo']['Results']['id']) print "Creating maps completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime) if 'AppDetails' in publishingConfig: startSectTime = datetime.datetime.now() print " " print "Creating apps: %s" % str(startSectTime.strftime(dateTimeFormat)) resultApps = publishTools.publishApp(app_info=publishingConfig['AppDetails'],map_info=resultMaps) print "Creating apps completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime) print "Publishing complete in config %s completed, time to complete: %s" % (configFile, str(datetime.datetime.now() - startTime)) print "-----Publishing Section Complete-----" else: print "Config %s not found" % configFile if combinedApp: if os.path.exists(combinedApp): print " " startSectTime = datetime.datetime.now() print "Creating combind result: %s" % str(startSectTime.strftime(dateTimeFormat)) config = common.init_config_json(config_file=combinedApp) combinedResults = publishTools.publishCombinedWebMap(maps_info=config['PublishingDetails']['MapDetails'],webmaps=webmaps) if 'PublishingDetails' in config: publishingConfig = config['PublishingDetails'] if 'PublishData' in publishingConfig: publishData = publishingConfig['PublishData'] else: print "PublishingDetails is missing the PublishData parameter: type string, values, True or False" publishData = 'TRUE' if (str(publishData).upper() =="TRUE" or str(publishData).upper() =="YES"): if 'AppDetails' in publishingConfig: resultApps = publishTools.publishApp(app_info=publishingConfig['AppDetails'],map_info=combinedResults) print "Creating combind result completed, time to complete: %s" % str(datetime.datetime.now() - startSectTime) except(TypeError,ValueError,AttributeError),e: print e