# ---------------------------------------------------------------- # This module defines metadata to be used by the batchSVN.py script. # # Copy this module as /class/csse//scripts/batchSVNData.py and # edit it to define the course metadata for . The sample data # in the original file can be used by invoking the batchSVN.py script using # "testing" as the course name argument, e.g.: ./batchSVN.py testing # ---------------------------------------------------------------- import os import sys # ---------------------------------------------------------------- # Hacks the system path so the import of batchSVNTypes works for testing # individual course meta-data on the the server. serverPathToBatchSVN = "/class/csse/resources/Grading" # Change the following line to point to your local checkout of the CSSE # resources trunk if you want to test this file on your local machine: localMachinePathToBatchSVN = "/Users/cclifton/Documents/Rose/Administrative/resources/Grading" sys.path.append(serverPathToBatchSVN) sys.path.append(localMachinePathToBatchSVN) from batchSVNTypes import * # ---------------------------------------------------------------- # ---------------------------------------------------------------- # Local variables # ---------------------------------------------------------------- repoNamePrefix = 'csse221-201410-' # replace the following with a description of the course, like 'CSSE 120' courseDescription = 'CSSE 221' # ---------------------------------------------------------------- # Defines repositories sets for this course. Used by main script. # ---------------------------------------------------------------- reposSets = [] # first set in the list is the default section1File = open('/class/csse/csse221/scripts/csse221-201410-01-users.txt', 'r') section1Students = [] for line in section1File: section1Students.append(line.strip()) section2File = open('/class/csse/csse221/scripts/csse221-201410-02-users.txt', 'r') section2Students = [] for line in section2File: section2Students.append(line.strip()) reposSets.append(RepositorySet("Section 01", repoNamePrefix, section1Students)) reposSets.append(RepositorySet("Section 02", repoNamePrefix, section2Students)) allStudents = section1Students + section2Students reposSets.append(RepositorySet("All Students", repoNamePrefix, allStudents)) reposSets.append(RepositorySet("Section 1 BallWorlds", repoNamePrefix, [ "ballworlds11", "ballworlds12", "ballworlds13", "ballworlds14", "ballworlds15", "ballworlds16" ])) reposSets.append(RepositorySet("Section 2 BallWorlds", repoNamePrefix, [ "ballworlds21", "ballworlds22", "ballworlds23", "ballworlds24", "ballworlds25", "ballworlds26" ])) reposSets.append(RepositorySet("Fifteen", repoNamePrefix, [ "fifteen10", "fifteen11", "fifteen12", "fifteen13", "fifteen14", "fifteen15", "fifteen16", "fifteen17", "fifteen18", "fifteen19", "fifteen20", "fifteen21", "fifteen22", "fifteen23", "fifteen24", "fifteen25", "fifteen26", "fifteen27", "fifteen28", "fifteen29" ])) reposSets.append(RepositorySet("VectorGraphics", repoNamePrefix, [ "vg11", "vg12", "vg13", "vg14", "vg15", "vg16", "vg21", "vg22", "vg23", "vg24", "vg25", "vg26", "vg27" ])) reposSets.append(RepositorySet("Markov All Students", repoNamePrefix, allStudents)) reposSets.append(RepositorySet("Markov Section 1", repoNamePrefix, section1Students)) reposSets.append(RepositorySet("Markov Section 2", repoNamePrefix, section2Students)) reposSets.append(RepositorySet("Schedule Generator", repoNamePrefix, [ "sg11", "sg12", "sg13", "sg14", "sg15", "sg16", "sg21", "sg22", "sg23", "sg24", "sg25", "sg26", "sg27" ])) sect2C = [ "cProjects21", "cProjects22", "cProjects23", "bertscjc", "burkhaka", "enricotj", "greenewp", "grovecj", "hohnetj", "kassalje", "kneislsj", "tombn", "wieteltr", "willisaj" ] cProjectsList = section1Students + sect2C reposSets.append(RepositorySet("C Projects all", repoNamePrefix, cProjectsList )) reposSets.append(RepositorySet("C Projects Delvin", repoNamePrefix, sect2C )) reposSets.append(RepositorySet("Small Set for Testing", repoNamePrefix, [ "moyessa" ])) reposSets.append(RepositorySet("Defoe", repoNamePrefix, [ "defoe" ])) reposSets.append(RepositorySet("Assistants", repoNamePrefix, [ "baumbata", "siegleal", "moyessa", "trammjn" ])) # ---------------------------------------------------------------- # Defines project names and unit tests for this course. # Used by main script. # ---------------------------------------------------------------- projects = [] projects.append(Project("HelloWorld")) projects.append(Project("JavaEyes")) projects.append(Project("WordGames", "ShouterTestByGrader", "CensorTestByGrader", "PedantTestByGrader", "NameDropperTestByGrader", "CounterTestByGrader", "DoublerTestByGrader", "SlowThinkerTestByGrader", "SometimesShouterTestByGrader", "RepeaterTestByGrader", "EvenerTestByGrader")) projects.append(Project("BigRational", "BasicBigRationalTest", "LargeBigRationalTest")) projects.append(Project("BallWorlds")) projects.append(Project("Exam1")) projects.append(Project("Fifteen")) projects.append(Project("VectorGraphics")) projects.append(Project("Markov", "Milestone1Tests", "Milestone2Tests")) projects.append(Project("Recursion")) projects.append(Project("Exam2")) projects.append(Project("ScheduleGenerator")) projects.append(Project("Exam3-201310")) projects.append(Project("CNestedLoops")) projects.append(Project("ThatsPerfect")) projects.append(Project("PointersHomework")) projects.append(Project("SelectionSort")) projects.append(Project("StringFunctions")) projects.append(Project("LinkedListBasic")) projects.append(Project("LinkedListEnhanced")) projects.append(Project("FinalExam")) # ---------------------------------------------------------------- # Defines any additional main menu commands for this course. # Used by main script. # ---------------------------------------------------------------- menuItems = [] # ---------------------------------------------------------------- # Sample code to add a zip command to the menu: def zipForDownload(data): if os.access(data.activeProject.name,os.F_OK): os.system('zip -r %s.zip %s' % (data.activeProject.name, data.activeProject.name)) if not os.access(data.activeProject.name + '.zip',os.F_OK): print '\a\n*** Unable to create zip file ***\n' return False menuItems.append(MenuItem('Zip local project subdirectory for download', zipForDownload)) # ---------------------------------------------------------------- # ---------------------------------------------------------------- # A couple of extra menu items that are useful in a pinch, but aren't yet # sufficiently abstracted for general use. def copyInExtras(data): forEachRepo("cp ${scriptDir}/*.java ${shortName}/src/btwp/", data) return False menuItems.append(MenuItem('Copy in Exam2 test files',copyInExtras)) # # def runTestsExtraMem(data): # forEachRepo("cd ${shortName} && java -Xmx2000m -cp '${scriptDir}/junit-4.5.jar:bin' org.junit.runner.JUnitCore ${testClasses}", data) # return False # menuItems.append(MenuItem('Run JUnit tests with extra memory',runTestsExtraMem)) # ---------------------------------------------------------------- # ---------------------------------------------------------------- # Some test code, executed if this file is imported directly into # a python shell. Shouldn't need to change this when specifying # course-specific data above. # ---------------------------------------------------------------- if __name__ == '__main__': print "reposSets ==", reposSets print "Repositories from reposSets[0]:" for r in reposSets[0].repos(): print " ", r print "repository names: ", [r.name for r in reposSets] print print projects print "Test classes:" for p in projects: print " %s: %s" % (p.name, p.testClasses) print "Additional Menu Items' Text:" for mi in menuItems: print " ", mi.text