Blame | Last modification | View Log | RSS feed
import osimport sysimport subprocessfrom mail import *"""Documentation for script test.pyThis is the script which one has to run if he wish to run the softwareFirst it will run the consetup.py, which in turn run the spiders for individual suppliers.Then, the generated csv files would be mailed to administrators.@param path to the folder in which spider-projects reside (/home/gaurav/code)"""#pathsep = Separator between paths(for ubuntu ':')#sep = Separator between directories in a path(for ubuntu '/')path = sys.argv[1]ps = os.pathsepds = os.sep#setting PYTHONPATHpath = ps + pathpath0 = path[1:len(path)]+ds+"ScrapyDatastore"+ds+"src"path1 = path+ds+"ExtraFunctions"+ds+"src"path2 = path+ds+"filterforname"+ds+"src"path3 = path0+path1+path2os.environ['PYTHONPATH'] = path3#run connection setuppath4 = pathpath4 = path4.replace(ps,"")path4 = path4+ds+"consetup.py"subprocess.call(["python", path4, path])#run mail servicea1 = ds+"tmp"+ds+"filteredinfibeam.csv"a2 = ds+"tmp"+ds+"filteredindiaplaza.csv"a3 = ds+"tmp"+ds+"filteredbabuchak.csv"a4 = ds+"tmp"+ds+"filterednaaptol.csv"a5 = ds+"tmp"+ds+"filteredunivercell.csv"a6 = ds+"tmp"+ds+"themobstore_new.csv"print "#123 sending emails"attach = [a1,a2,a3,a5,a6]mail("ashish.singh@shop2020.in","Files for different vendors","This mail is automatically generated via python script",attach)'''mail("pankaj.jain@shop2020.in","Files for different vendors","This mail is automatically generated via python script",attach)'''