예제 #1
0
def __init__(pkgPath, pkgDestDir, optionsDict, commandsDict, verbosity_level, timeresources_show):
	global VERBOSE
	VERBOSE = verbosity_level
	
	global TIMERESOURCES
	TIMERESOURCES = timeresources_show
	
	global commands
	commands = commandsDict
	
	global options
	options = optionsDict
	
	global commandsSet
    
	log.setLog("infoLog")        

	if (cmp(pkgPath, "") != 0):
		checkAppropriate(pkgPath)
        runConfigBased(pkgPath)

	if (heuristicApproved == True):
		if VERBOSE:
			log.info("       commencing package build with heuristic \"" + heuristicShortName + "\"")
			if TIMERESOURCES:
				log.info("        task started on   "+ str(time.clock()))
		buildPkg(pkgPath, pkgDestDir)
		
	return commandsSet
예제 #2
0
def __init__(xmlConfigFile, verbose, timeResources):
    global VERBOSE, TIMERESOURCES
    VERBOSE = verbose
    TIMERESOURCES = timeResources
        
    log.setLog("infoLog")
    
    #xmlManifestVersion = "1.0"
    #
    #if (xmlManifestVersion == "1.0"):
    #    print "m"
    #elif  (xmlManifestVersion == "1.1"):
    #    print "m"        
    #else:
    #    log.critical("unknown XML manifest version: " + xmlManifestVersion)
    
    if VERBOSE:
        log.information(1, 3, "2:", "reading XML file")
    if TIMERESOURCES:
        log.startTaskTime(1, 4, "  ")
    
    read(xmlConfigFile)
    
    if TIMERESOURCES:
        log.endTaskTime(1, 4, "  ")
    if VERBOSE:
        log.information(1, 3, "2:", "read XML file")
        
    return parseVars()
예제 #3
0
파일: raw.py 프로젝트: andreioprisan/apkg
    def __init__(self, exportFile, commands, resources, VERBOSE, TIMERESOURCES):
        self.exportFile = exportFile
        self.commands = commands
        self.resources = resources        
        self.VERBOSE = VERBOSE
        self.TIMERESOURCES = TIMERESOURCES
                
        log.setLog("infoLog")        

        self.doExport(exportFile, commands, resources, VERBOSE, TIMERESOURCES)
예제 #4
0
파일: http.py 프로젝트: andreioprisan/apkg
 def __init__(self, server, root, location, files, tmpLocationFull, VERBOSE, TIMERESOURCES):
     self.server = server
     self.root = root
     self.location = location
     self.files = files
     self.tmpLocationFull = tmpLocationFull        
     self.VERBOSE = VERBOSE
     self.TIMERESOURCES = TIMERESOURCES
     
     log.setLog("infoLog")
     
     self.downloadFiles(server, root, files, tmpLocationFull)
예제 #5
0
파일: main.py 프로젝트: ewwaller/irrigation
def main():
    CmdLineArgs(
        "Web Server for prototype single page application",
        (
            (('-v', '--verbose'), 'verbose', 'store_true', None, None,
             "Generate information", None, lambda x: log.setLog(x, 'INFO')),
            (('-d', '--debug'), 'debug', 'store_true', None, None,
             "Generate debugging information", None,
             lambda x: log.setLog(x, 'DEBUG')),
            (('-q', '--quiet'), 'notQuiet', 'store_false', None, None,
             "Supress logs to screen", None,
             lambda x: cherrypy.config.update({
                 'log.screen': x,
             })),
            (
                ('-l', '--logfile'), 'logfile', 'store', str, '',
                "Access Log File Name", None,
                lambda x: cherrypy.config.update({
                    'log.access_file': x,
                })),
            (('-c', '--configfile'), 'configfile', 'store', str,
             str(Path.home()) + "/.config/irrigation",
             "Configuration File Name", None, lambda x: setConfigFile(x)),
            (('-e', '--errfile'), 'errfile', 'store', str, 'err.log',
             "Error Log File Name", None, lambda x: cherrypy.config.update({
                 'log.error_file':
                 x,
             })),
            (('-H', '--host'), 'host', 'store', str, 'localhost',
             "Host base URL", None,
             lambda x: cherrypy.config.update({'server.socket_host': x})),
            (('-P', '--port'), 'port', 'store', int, 8080, "Host port", None,
             lambda x: cherrypy.config.update({'server.socket_port': x})),
        ),
    )
    thePlugIn = IrrigationPlugin(cherrypy.engine, IrrigationEngine,
                                 theConfigFile)
    thePlugIn.subscribe()
    cherrypy.quickstart(
        Root(thePlugIn.engine, Channels), '/', {
            '/': {
                'tools.staticdir.root': os.path.abspath(os.getcwd()),
            },
            '/static': {
                'tools.staticdir.on': True,
                'tools.staticdir.dir': './public'
            },
        })
    thePlugIn.engine.clearGpio()
    log.logger.info("Exiting program")
예제 #6
0
    commands = {}    
    # export resources
    if exportFile != "" and exportFileType != "":
        export.parseResults(exportFileType, exportFile, heuristicsCommands, xmlControl, VERBOSE, TIMERESOURCES)    
        
    # clean up environment
    environmentCleanup()
    
# start program execution

if __name__ == '__main__':
    try:
        import sys, time, log
       
        #creating the default log
        log.setLog("infoLog")        
    except ImportError, e:
        log.critical("failed initial module import.\n" + str(e))

    # check arguments
    # no need to continue with module loading if incorrect options are passed
    checkSystemArguments()
    args = xmlConfigFile    
    
    if VERBOSE:
        log.info("(0): apkg initialization")
        log.info(" 1:   loading modules")
        if TIMERESOURCES:
            log.info("       task started on "+ str(time.clock()))
                    
    try:
예제 #7
0
def __init__():
    # initialize logging profile
    log.setLog("infoLog")
예제 #8
0
def __init__():
    log.setLog("infoLog")
예제 #9
0
 def __init__(self, XMLManifest, VERBOSE):
     self.XMLManifest = XMLManifest
     self.VERBOSE = VERBOSE
     self.parseXMLManifest(XMLManifest)
     self.prepareFileList(resources, files)
     log.setLog("infoLog")