fil.close() #Load Config File config = ConfigParser.ConfigParser() config.read('settings.conf') #Create Working Directory if not os.path.exists(config.get('modules_global', 'workingdir')): os.makedirs(config.get('modules_global', 'workingdir')) #Create Log Queue and start logger log = Queue.Queue(maxsize=8192) threading.Thread(target=logger, args=(log, config), name='Log Handler').start() #Get an instance of api for talking to core api = CloudAVWizard_API.scannerapi() if config.get('core', 'ip') == 'auto': ip, port = api.findcore(config.getint('global', 'broadcastport'), 'SharedKeyGoesHere'), config.getint('global', 'scannerport') else: ip, port = config.get('core', 'ip'), config.getint('global', 'scannerport') api.setipport(ip, port) #___________________________________________________________________________________________ #Set A Unique Name For This Scanner api.setname('Clamwin') #Register with core if api.register() != 'ok': print 'Unable to register with core, exiting'
#!c:/Python27/python.exe -u #This is a (very mess) example of a basic interface for communicating with CloudAVWizard import cgi, socket, os import cgitb; cgitb.enable() # for troubleshooting import CloudAVWizard_API try: # Windows needs stdio set for binary mode. import msvcrt msvcrt.setmode (0, os.O_BINARY) # stdin = 0 msvcrt.setmode (1, os.O_BINARY) # stdout = 1 except ImportError: pass #Import API and create instance api = CloudAVWizard_API.api() api.setipport('192.168.1.117', 3841) #Set Path To WebServer And Temp Folder serverpath = 'http://127.0.0.1:8080' tmpfolder = 'fsadf798sdanjisdhfs7d6rsdf' #Make Sure Temp Folder Exists if not os.path.exists(tmpfolder): os.mkdir(tmpfolder) form = cgi.FieldStorage() #Headers print "Content-type: text/html" print
#This is a (very mess) example of a basic interface for communicating with CloudAVWizard import cgi, socket, os import cgitb cgitb.enable() # for troubleshooting import CloudAVWizard_API try: # Windows needs stdio set for binary mode. import msvcrt msvcrt.setmode(0, os.O_BINARY) # stdin = 0 msvcrt.setmode(1, os.O_BINARY) # stdout = 1 except ImportError: pass #Import API and create instance api = CloudAVWizard_API.api() api.setipport('192.168.1.117', 3841) #Set Path To WebServer And Temp Folder serverpath = 'http://127.0.0.1:8080' tmpfolder = 'fsadf798sdanjisdhfs7d6rsdf' #Make Sure Temp Folder Exists if not os.path.exists(tmpfolder): os.mkdir(tmpfolder) form = cgi.FieldStorage() #Headers print "Content-type: text/html" print