Beispiel #1
0
def objweb_createObjWeb(strBldFldr, rptObj):
	strRoot = os.getcwd()
	if(os.path.exists(strBldFldr)):
		os.chdir(strBldFldr)
	else:
		raise Exception, "Cannot find path " + strBldFldr

	# Process all idh files to produce pseudo *.idh_
	os.system("mkdir src")
	os.chdir('src')
	strSrcRoot = os.getcwd()
	os.system("mkdir interfaces")
	os.chdir('interfaces')
	strOutputFldr = os.getcwd()
	os.chdir(strSrcRoot)
	file.file_MakeSureFolderExists(strOutputFldr)
	os.chdir(strRoot)
	objweb_ProcessInterfaceFiles('src', strSrcRoot, strOutputFldr)
	# Run Surveyor Program
	strSurveyorCommand = "C:\\Progra~1\\Surveyor\\System\\GtorSur.exe"
	try:
		rptObj.echoItVerbose(strSurveyorCommand + " [AutoWeb(\"" + strSrcRoot + "\")] [Quit]")
		misc.misc_RunExtProg(strSurveyorCommand, "[AutoWeb(" + strSrcRoot + ")] [Quit]", None, rptObj, None)
	except Exception, err:
		raise Exception, str(err)
Beispiel #2
0
def db_startServer(sqlSvrBinDir, rptObj):

    # TODO:JEffG - this does not support sql server2K
    # Make sure the directory name string ends with a \ (backslash)
    sqlSvrBinDir = re.sub('\\\\*$', '\\\\', sqlSvrBinDir, 1)

    sqlSCMCommand = os.path.join(sqlSvrBinDir, 'scm.exe')
    rptObj.reopenLog()
    # Make sure SQLServer is started
    rptObj.echoItVerbose(sqlSCMCommand + ' -Action 3 -Silent 1')
    retValue = os.system('"' + sqlSCMCommand + '"' + ' -Action 3')
    print sqlSCMCommand + ' -Action 3'
    if retValue == -1:
        rptObj.reportProgress('Starting SQL Server...')
        try:
            misc.misc_RunExtProg(sqlSCMCommand, ' -Action 1', None, rptObj,
                                 None)

        # Handle exceptions of type "Exception"
        # "err" is a name for the Exception object
        except Exception, err:
            raise Exception, str(err) + ': Failed to load SQlServer'

        # Handle any other exceptions by simply raising them again
        except:
Beispiel #3
0
def db_deleteDB(strOSQLCommand, strDBName, strOSQLStdParams, rptObj):
    rptObj.reopenLog()
    rptObj.echoItVerbose(strOSQLCommand + strOSQLparams + ' -dmaster -n -Q"drop database ' \
    + strDBName + '"')
    try:
        misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-dmaster -n -Q"drop database ' \
        + strDBName + '"', None, rptObj, None)
    except Exception, err:
        raise Exception, str(err) + ': Failed to delete database'
Beispiel #4
0
def db_detachDB(strOSQLCommand, strDBName, strOSQLStdParams, rptObj):
    rptObj.reopenLog()
    rptObj.echoItVerbose(strOSQLCommand + strOSQLStdParams + '-dmaster -Q"sp_detach_db ' \
    + strDBName + '"')
    try:
        misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-dmaster -n -Q"sp_detach_db ' \
        + strDBName + '"', 'errorlevel', rptObj, None)
    except Exception, err:
        raise Exception, str(err) + ': Failed to detach newly built database'
Beispiel #5
0
def db_deleteDB(strOSQLCommand, strDBName, strOSQLStdParams, rptObj):
	rptObj.reopenLog()
	rptObj.echoItVerbose(strOSQLCommand + strOSQLparams + ' -dmaster -n -Q"drop database ' \
	+ strDBName + '"')
	try:
		misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-dmaster -n -Q"drop database ' \
		+ strDBName + '"', None, rptObj, None)
	except Exception, err:
		raise Exception, str(err) + ': Failed to delete database'
Beispiel #6
0
def db_detachDB(strOSQLCommand, strDBName, strOSQLStdParams, rptObj):
	rptObj.reopenLog()
	rptObj.echoItVerbose(strOSQLCommand + strOSQLStdParams + '-dmaster -Q"sp_detach_db ' \
	+ strDBName + '"')
	try:
		misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-dmaster -n -Q"sp_detach_db ' \
		+ strDBName + '"', 'errorlevel', rptObj, None)
	except Exception, err:
		raise Exception, str(err) + ': Failed to detach newly built database'
Beispiel #7
0
def db_loadXML(strLoadXMLCmd, strDBFile, strXMLFile, rptObj):
	rptObj.reopenLog()
	rptObj.reportProgress('Loading data from ' + strXMLFile + '...')
	rptObj.echoItVerbose(strLoadXMLCmd + ' -d ' + strDBFile + ' -i ' + strXMLFile)
	try:
		misc.misc_RunExtProg(strLoadXMLCmd, '-d ' + strDBFile + ' -i ' + strXMLFile, 0, rptObj, 0)
	except Exception, err:
		raise Exception, str(err) + ': Failed to load XML file, see ' + strXMLFile \
		+ '-import.log'
Beispiel #8
0
def db_loadSchema(strOSQLCommand, strDBName, strSQLFile, strOSQLStdParams, strOSQLParam2, \
rptObj):
    rptObj.reopenLog()
    rptObj.echoItVerbose(strOSQLCommand + strOSQLStdParams + '-d' + strDBName + ' -i ' \
    + strSQLFile + strOSQLParam2)
    rptObj.reportProgress('Loading database schema from ' + strSQLFile + '...')
    try:
        misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-d' + strDBName + ' -i ' \
        + strSQLFile + strOSQLParam2, 'errorlevel', rptObj, None)
    except Exception, err:
        raise Exception, str(err) + ': Failed to load database schema'
Beispiel #9
0
def db_loadSchema(strOSQLCommand, strDBName, strSQLFile, strOSQLStdParams, strOSQLParam2, \
rptObj):
	rptObj.reopenLog()
	rptObj.echoItVerbose(strOSQLCommand + strOSQLStdParams + '-d' + strDBName + ' -i ' \
	+ strSQLFile + strOSQLParam2)
	rptObj.reportProgress('Loading database schema from ' + strSQLFile + '...')
	try:
		misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-d' + strDBName + ' -i ' \
		+ strSQLFile + strOSQLParam2, 'errorlevel', rptObj, None)
	except Exception, err:
		raise Exception, str(err) + ': Failed to load database schema'
Beispiel #10
0
def db_loadXML(strLoadXMLCmd, strDBFile, strXMLFile, rptObj):
    rptObj.reopenLog()
    rptObj.reportProgress('Loading data from ' + strXMLFile + '...')
    rptObj.echoItVerbose(strLoadXMLCmd + ' -d ' + strDBFile + ' -i ' +
                         strXMLFile)
    try:
        misc.misc_RunExtProg(strLoadXMLCmd,
                             '-d ' + strDBFile + ' -i ' + strXMLFile, 0,
                             rptObj, 0)
    except Exception, err:
        raise Exception, str(err) + ': Failed to load XML file, see ' + strXMLFile \
        + '-import.log'
Beispiel #11
0
def bld_installer(strBldFldr, strOutputFldr, rptObj, strWiseFile, strBldType, strProduct):
	# TODO: JeffG - Make the install script use the data in daly output folder so
	# installer can build from the daly copy of the source.
	#strInstBldrExe = "c:\\Program Files\\Wise InstallBuilder 8.1\\installbuilder.exe"
	# Must use short form for all path names because won't work if path and parameters are both in double quotes
	strInstBldrExe = 'c:\\Progra~1\\WiseIn~1.1\\installbuilder.exe'
	strIBScriptFile = os.path.join(strBldFldr, strWiseFile)
	# Build installer for the build type.
	rptObj.reportProgress("Building " + strProduct + " " + strBldType + " version installer...")
	strCmpVars = "/d _BUILD_TYPE_=" + strBldType + " /d _OUTPUT_DIR_=" + \
				 strOutputFldr + " /d _FW_ROOT_DIR_=" + strBldFldr + " /c /s "
	try:
		misc.misc_RunExtProg(strInstBldrExe, strCmpVars + strIBScriptFile, None, rptObj, None)
	except Exception, err:
		raise Exception, str(err)
Beispiel #12
0
def bld_buildFW(strBldFldr, rptObj, strBldType, strFlags):
	strBldFldr = re.sub('\\\\*$', '\\\\', strBldFldr, 1)
	strBldCmdStr = os.path.join(strBldFldr, "bin\\mkall.bat")
	if(os.path.exists(strBldCmdStr)):
		rptObj.reportProgress("Starting " + strBldType + " build...")
		rptObj.closeLog()           # Close so the external process can append to the log file
		try:
			misc.misc_RunExtProg(strBldCmdStr, strFlags, "FW_BUILD_ERROR", rptObj, rptObj.getLogFile())
		except Exception, err:
			rptObj.reopenLog()
			rptObj.reportFailure(strBldType + " build failed, " + str(err), 1)
			rptObj.closeLog()
			raise Exception, str(err) + ":error running " + strBldCmdStr
		rptObj.reopenLog()          # Re-open the log file for appending
		rptObj.reportProgress("Finished building " + strBldType + " build.")
Beispiel #13
0
def db_createDB(strOSQLCommand, strDBFile, strDBName, strOSQLStdParams, strOutputDir, rptObj):
	rptObj.reopenLog()

	# Make sure the directory name string ends with a \ (backslash)
	strOutputDir = re.sub('\\\\*$', '\\\\', strOutputDir, 1)
	# Create the database
	strDBOn = " ON (NAME='" + strDBFile + "',FILENAME='" + strOutputDir + strDBFile \
	+ ".mdf',SIZE=10MB,MAXSIZE=200MB,FILEGROWTH=5MB)"
	strDBLogOn = " LOG ON (NAME='" + strDBFile + "_Log', FILENAME='" + strOutputDir \
	+ strDBFile + "_Log.ldf',SIZE=5MB,MAXSIZE=25MB,FILEGROWTH=5MB)\""
	rptObj.echoItVerbose(strOSQLCommand + strOSQLStdParams \
	+ ' -dmaster -n -Q"Create database ' + strDBName + strDBOn + strDBLogOn)
	rptObj.reportProgress('Creating database ' + strDBName + ' and loading schema....')
	try:
		misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-dmaster -n -Q"Create database ' \
		+ strDBName + strDBOn + strDBLogOn, 'errorlevel', rptObj, 0)
	except Exception, err:											#=dmaster
		raise Exc.eption, str(err) + ': Failed to create the database'
Beispiel #14
0
def db_createDB(strOSQLCommand, strDBFile, strDBName, strOSQLStdParams,
                strOutputDir, rptObj):
    rptObj.reopenLog()

    # Make sure the directory name string ends with a \ (backslash)
    strOutputDir = re.sub('\\\\*$', '\\\\', strOutputDir, 1)
    # Create the database
    strDBOn = " ON (NAME='" + strDBFile + "',FILENAME='" + strOutputDir + strDBFile \
    + ".mdf',SIZE=10MB,MAXSIZE=200MB,FILEGROWTH=5MB)"
    strDBLogOn = " LOG ON (NAME='" + strDBFile + "_Log', FILENAME='" + strOutputDir \
    + strDBFile + "_Log.ldf',SIZE=5MB,MAXSIZE=25MB,FILEGROWTH=5MB)\""
    rptObj.echoItVerbose(strOSQLCommand + strOSQLStdParams \
    + ' -dmaster -n -Q"Create database ' + strDBName + strDBOn + strDBLogOn)
    rptObj.reportProgress('Creating database ' + strDBName +
                          ' and loading schema....')
    try:
        misc.misc_RunExtProg(strOSQLCommand, strOSQLStdParams + '-dmaster -n -Q"Create database ' \
        + strDBName + strDBOn + strDBLogOn, 'errorlevel', rptObj, 0)
    except Exception, err:  #=dmaster
        raise Exc.eption, str(err) + ': Failed to create the database'
Beispiel #15
0
def db_startServer(sqlSvrBinDir, rptObj):

	# TODO:JEffG - this does not support sql server2K
	# Make sure the directory name string ends with a \ (backslash)
	sqlSvrBinDir = re.sub('\\\\*$', '\\\\', sqlSvrBinDir, 1)

	sqlSCMCommand = os.path.join(sqlSvrBinDir, 'scm.exe')
	rptObj.reopenLog()
	# Make sure SQLServer is started
	rptObj.echoItVerbose(sqlSCMCommand + ' -Action 3 -Silent 1')
	retValue = os.system('"' + sqlSCMCommand + '"' + ' -Action 3')
	print sqlSCMCommand + ' -Action 3'
	if retValue == -1:
		rptObj.reportProgress('Starting SQL Server...')
		try:
			misc.misc_RunExtProg(sqlSCMCommand, ' -Action 1', None, rptObj, None)

		# Handle exceptions of type "Exception"
		# "err" is a name for the Exception object
		except Exception, err:
			raise Exception, str(err) + ': Failed to load SQlServer'

		# Handle any other exceptions by simply raising them again
		except: