4a8f399296a87e765418e85cc34e1849dd32f716
cricket
  Fri Oct 21 12:16:15 2011 -0700
some corrections for situations when not all tracks have certain objects
diff --git python/programs/qaInit/qaInit python/programs/qaInit/qaInit
index 45200c2..f2fcd2c 100755
--- python/programs/qaInit/qaInit
+++ python/programs/qaInit/qaInit
@@ -100,31 +100,31 @@
 			
 		if switch == 1:
 			tables.add(i)
 		if switch == 2:
 			files.add(i)
 		if switch == 3:
 			gbdbs.add(i)
 		if switch == 4:
 			supplemental.add(i)
 		if switch == 5:
 			others.add(i)
 			
 	return tables, gbdbs, files, supplemental, others, str(size)
 
 def writeTableMail(tables, args, user, qaDir):
-	
+	tablestr = ""
 	if tables:
 		sep = ""
 		tablestr = sep.join(list(sorted(tables)))
 		mail = """Hi Pushers,
 
 For the *%s* database (2 part request):
 
 1) Please push trackDb and friends
 
 2) Please push these %s tables:
 
 %s
 
 from mysqlbeta -> mysqlrr
 
@@ -142,30 +142,33 @@
 1) Please push trackDb and friends
 
 from mysqlbeta -> mysqlrr
 
 Reason: releasing _____(fill in metadata or trackDb changes)____ for ENCODE %s track on %s to the RR
 
 Thank you!
 
 %s
 """ % (args.database, args.composite, args.database, user)
 
 	f = open(qaDir + "/pushTableMail", "w")
 	f.write(mail)
 	f.close
 	
+	if not tablestr:
+                return ""
+
 	f = open(qaDir + "/tableList", "w")
 	f.write(tablestr)
 	f.close
 	
 	return tablestr
 	
 def writeGbdbMail(gbdbs, args, user, qaDir):
 	sep = ""
 	gbdbstr = sep.join(list(sorted(gbdbs)))
 	mail = """
 Hi Pushers,
 
 Please push these %s gbdb files:
 
 %s
@@ -190,31 +193,31 @@
 
 Please push these %s files:
 
 %s
 
 from hgwdev to hgdownload:
 %s
 
 Please note the destination on hgdownload is *one directory above the location on dev*
 
 Reason: releasing ENCODE %s on %s to the RR http://redmine.soe.ucsc.edu/issues/%s
 
 Thanks!
 
 %s
-""" % (len(files), filestr, c._rrHttpDir, args.composite, args.database, args.redmine, user)
+""" % (len(files|others), filestr, c._rrHttpDir, args.composite, args.database, args.redmine, user)
 
 	f = open(qaDir + "/pushFilesMail", "w")
 	f.write(mail)
 	f.close()
 	subIds = dict()
 	mdb = c.alphaMetaDb
 	p = re.compile('.*(wgE.*)')
 	for i in files:
 		m = p.match(i)
 		file = m.group(1)
 		filestanza = mdb.filter(lambda s: re.match(".*%s.*" % file,s['fileName']), lambda s: s)
 		if filestanza:
 			for j in filestanza:
 				if 'subId' in j:
 					if not j['subId'] in subIds:
@@ -397,21 +400,21 @@
 	if not re.match('mkChangeNotes v2', lines[0]):
 		print "notes files is not the correct version"
 		return
 	(tables, gbdbs, files, supplemental, others, size) = parseNotes(lines)
 	
 	tablestr = writeTableMail(tables, args, user, qaDir)
 	gbdbstr = writeGbdbMail(gbdbs, args, user, qaDir)
 	(filestr, subIds) = writeFileMail(files, supplemental | others, args, user, qaDir, c)
 	(short, long) = writeHtml(args, c, qaDir)
 	
 	writePushHtmlMail(args, user, qaDir)
 	writeSql(tablestr, filestr, gbdbstr, d, short, long, args, notes, size, user, qaDir)
 	
 	changeStatus(subIds)
 	
-	runScript(args, qaDir)
+	#runScript(args, qaDir)
 
 
 
 if __name__ == "__main__":
-	main()
\ No newline at end of file
+	main()