def makeDocFactory(self): core.setup(self.repository) return loaders.stan( T.html[self.render_Head, T.body[T.h1["This is the QSOS Repository [" + self.repository + "] Main Page"], T.p["For now, you can ", T.a(href='repository')["browse"], " the repository or ", T.a(href='submit')["submit"], " an evaluation. "]], ])
def makeDocFactory(self) : core.setup(self.repository) return loaders.stan ( T.html [ self.render_Head, T.body [ T.h1 [ "This is the QSOS Repository [" + self.repository + "] Main Page" ], T.p ["For now, you can ", T.a ( href = 'repository' ) [ "browse" ], " the repository or ", T.a ( href = 'submit' ) [ "submit" ], " an evaluation. " ] ], ] )
def CommitRepository(inDir, Repo): """ Auto-commit a collection of upgraded QSOS evaluation sheets Side effect : Auto-commit on git repository @param inDir Path to directory of evaluations to be auto-commited @param Repo Path to QSOS repository """ #Statistics vars Errors = [] Submitted = 0 #Setup git repository core.setup(Repo) #Main loop : prepare data for auto-commit and proceed for filename in os.listdir(inDir): if filename.split(".")[-1] == "qsos": #Extract information from qsos file try: evaluation = readAndCleanXML(inDir + "/" + filename) email = evaluation.firstChild.firstChild.firstChild.firstChild.getElementsByTagName( "email")[0].firstChild.data name = evaluation.firstChild.firstChild.firstChild.firstChild.getElementsByTagName( "name")[0].firstChild.data message = "Auto-uplodaded file : " + filename eval = FileObject(file(inDir + "/" + filename), filename) except Exception, inst: Errors.append("Error occured when processing " + filename + ":" + str(inst)) #Invoke core submit method try: core.submit({ "Author": name, "E-mail": email, "Description": message, "Type": "Evaluation", "File": eval }) Submitted += 1 except Exception, inst: Errors.append("Error occured when submitting " + filename + ":" + str(inst))
def CommitRepository(inDir, Repo): """ Auto-commit a collection of upgraded QSOS evaluation sheets Side effect : Auto-commit on git repository @param inDir Path to directory of evaluations to be auto-commited @param Repo Path to QSOS repository """ #Statistics vars Errors = [] Submitted = 0 #Setup git repository core.setup(Repo) #Main loop : prepare data for auto-commit and proceed for filename in os.listdir(inDir) : if filename.split(".")[ - 1] == "qsos" : #Extract information from qsos file try: evaluation = readAndCleanXML(inDir + "/" + filename) email = evaluation.firstChild.firstChild.firstChild.firstChild.getElementsByTagName("email")[0].firstChild.data name = evaluation.firstChild.firstChild.firstChild.firstChild.getElementsByTagName("name")[0].firstChild.data message = "Auto-uplodaded file : " + filename eval = FileObject(file(inDir + "/" + filename), filename) except Exception, inst : Errors.append("Error occured when processing " + filename + ":" + str(inst)) #Invoke core submit method try: core.submit({"Author":name, "E-mail":email, "Description":message, "Type":"Evaluation", "File":eval}) Submitted += 1 except Exception, inst : Errors.append("Error occured when submitting " + filename + ":" + str(inst))