rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
ts = self.receive()[:-1] | ts = self.receive() | def login(self): ts = self.receive()[:-1] user = raw_input('Username: '); pw = raw_input('Password: '); pwmd5 = hashlib.md5(pw).hexdigest() m = hashlib.md5() m.update(pwmd5) m.update(ts) complete = m.hexdigest() self.sendCommand(user) self.sendNullbyte() self.sendCommand(complete) self.sendNullbyte() data = self.receiv... |
self.sendNullbyte() | def login(self): ts = self.receive()[:-1] user = raw_input('Username: '); pw = raw_input('Password: '); pwmd5 = hashlib.md5(pw).hexdigest() m = hashlib.md5() m.update(pwmd5) m.update(ts) complete = m.hexdigest() self.sendCommand(user) self.sendNullbyte() self.sendCommand(complete) self.sendNullbyte() data = self.receiv... | |
self.sendNullbyte() data = self.receive() | data = self.s.recv(1) | def login(self): ts = self.receive()[:-1] user = raw_input('Username: '); pw = raw_input('Password: '); pwmd5 = hashlib.md5(pw).hexdigest() m = hashlib.md5() m.update(pwmd5) m.update(ts) complete = m.hexdigest() self.sendCommand(user) self.sendNullbyte() self.sendCommand(complete) self.sendNullbyte() data = self.receiv... |
def sendNullbyte(self): self.s.send("\0") | self.s.send("\0") | def sendCommand(self,com): self.s.send(str.encode(com)) |
return self.s.recv(1024) | com = "" while True: data = self.s.recv(1) if(data == "\0"): return com break else: com += data | def receive(self): return self.s.recv(1024) |
while self.readCommand() != 'exit': | self.sendCommand("SET INFO ON") self.s.recv(1024) while self.readCommand() != "exit": | def console(self): if self.connect() == True: while self.readCommand() != 'exit': self.sendCommand(self.com) self.sendNullbyte() print self.receive() self.sendCommand("exit") print 'See you.' else: print 'Access denied.' self.close() |
self.sendNullbyte() print self.receive() self.sendCommand("exit") print 'See you.' | data = self.receive() if data != "": print data else: print self.receive() try: self.sendCommand("exit") except: self.close() print "See you." | def console(self): if self.connect() == True: while self.readCommand() != 'exit': self.sendCommand(self.com) self.sendNullbyte() print self.receive() self.sendCommand("exit") print 'See you.' else: print 'Access denied.' self.close() |
print 'Access denied.' | print "Access denied." | def console(self): if self.connect() == True: while self.readCommand() != 'exit': self.sendCommand(self.com) self.sendNullbyte() print self.receive() self.sendCommand("exit") print 'See you.' else: print 'Access denied.' self.close() |
bxc.console() | try: bxc.console() atexit.register(self.sendCommand("exit")) except: print "Can't communicate with the server." sys.exit() | def opts(): try: opts, args = getopt.getopt(sys.argv[1:], "-p:-h", ["port", "host"]) except getopt.GetoptError, err: print str(err) sys.exit() global host global port host = "localhost" port = 1984 for o, a in opts: if o == "-p": port = int(a) if o == "-h": host = a |
ts = self.receive() | ts = self.getIt() | def login(self): ts = self.receive() user = raw_input('Username: '); pw = raw_input('Password: '); pwmd5 = hashlib.md5(pw).hexdigest() m = hashlib.md5() m.update(pwmd5) m.update(ts) complete = m.hexdigest() self.sendCommand(user) self.sendCommand(complete) data = self.s.recv(1) return "\0" == data |
self.s.send("\0") def receive(self): | self.s.send("\0") def getIt(self): | def sendCommand(self,com): self.s.send(str.encode(com)) self.s.send("\0") |
break | def receive(self): com = "" while True: data = self.s.recv(1) if(data == "\0"): return com break else: com += data | |
if data != "": print data else: print self.receive() | print data | def console(self): if self.connect() == True: self.sendCommand("SET INFO ON") self.s.recv(1024) while self.readCommand() != "exit": self.sendCommand(self.com) data = self.receive() if data != "": print data else: print self.receive() try: self.sendCommand("exit") except: self.close() print "See you." else: print "Acces... |
assert self.parser.innerHTML | def endTagTableRowGroup(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.endTagTr(impliedTagToken("tr")) return token else: # innerHTML case assert self.parser.innerHTML self.parser.parseError() | |
from constants import tokenTypes, ReparseException, namespaces | from constants import tokenTypes, ReparseException, namespaces, spaceCharacters | def startswithany(str, prefixes): for prefix in prefixes: if str.startswith(prefix): return True return False |
self.parser.framesetOK = False | if (self.parser.framesetOK and any([char not in set(u"\ufffd") | spaceCharacters for char in token["data"]])): self.parser.framesetOK = False | def processCharacters(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertText(token["data"]) self.parser.framesetOK = False |
debug_log = True | def startswithany(str, prefixes): for prefix in prefixes: if str.startswith(prefix): return True return False | |
namespaceHTMLElements = True): | namespaceHTMLElements = True, debug=False): | def __init__(self, tree = simpletree.TreeBuilder, tokenizer = tokenizer.HTMLTokenizer, strict = False, namespaceHTMLElements = True): """ strict - raise an exception when a parse error is encountered |
self.phases = { "initial": InitialPhase(self, self.tree), "beforeHtml": BeforeHtmlPhase(self, self.tree), "beforeHead": BeforeHeadPhase(self, self.tree), "inHead": InHeadPhase(self, self.tree), "afterHead": AfterHeadPhase(self, self.tree), "inBody": InBodyPhase(self, self.tree), "text": TextPhase(self, self.tree), "in... | self.phases = dict([(name, cls(self, self.tree)) for name, cls in getPhases(debug).iteritems()]) | def __init__(self, tree = simpletree.TreeBuilder, tokenizer = tokenizer.HTMLTokenizer, strict = False, namespaceHTMLElements = True): """ strict - raise an exception when a parse error is encountered |
def log(function): """Logger that records which phase processes each token""" type_names = dict((value, key) for key, value in constants.tokenTypes.iteritems()) def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[token['type']]} except... | def getPhases(debug): def log(function): """Logger that records which phase processes each token""" type_names = dict((value, key) for key, value in constants.tokenTypes.iteritems()) def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[... | def log(function): """Logger that records which phase processes each token""" type_names = dict((value, key) for key, value in constants.tokenTypes.iteritems()) def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[token['type']]} except... |
return function(self, *args, **kwargs) return wrapped def getMetaclass(use_metaclass, metaclass_func): if use_metaclass: return method_decorator_metaclass(metaclass_func) else: return type class Phase(object): """Base class for helper object that implements each phase of processing """ __metaclass__ = getM... | return type class Phase(object): """Base class for helper object that implements each phase of processing """ __metaclass__ = getMetaclass(debug, log) def __init__(self, parser, tree): self.parser = parser self.tree = tree def processEOF(self): raise NotImplementedError def processComment(self, token): ... | def wrapped(self, *args, **kwargs): if function.__name__ != "__init__" and len(args) > 0: token = args[0] try: info = {"type":type_names[token['type']]} except: print token raise if token['type'] in constants.tagTokenTypes: info["name"] = token['name'] |
elif (startswithany(publicId, ("-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//")) or startswithany(publicId, ("-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//")) and systemId != None): self.parser.compatMode = "limited quirks" self.parser.phase = self.parser.phases["b... | self.parser.phase = self.parser.phases["beforeHtml"] def processCharacters(self, token): self.parser.parseError("expected-doctype-but-got-chars") self.anythingElse() self.parser.phase.processCharacters(token) def processStartTag(self, token): self.parser.parseError("expected-doctype-but-got-start-tag", | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] |
else: | self.anythingElse() self.parser.phase.processStartTag(token) def processEndTag(self, token): self.parser.parseError("expected-doctype-but-got-end-tag", {"name": token["name"]}) self.anythingElse() self.parser.phase.processEndTag(token) def processEOF(self): self.parser.parseError("expected-doctype-but-got-eof") self.... | def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", {"name": token["name"]}) else: self.insertHtmlElement() self.parser.phase.processEndTag(token) |
class BeforeHeadPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), ("head", self.startTagHead) ]) self.startTagHandler.default = self.startTagOther self.endTagHandler = utils.MethodDispatcher([ (("head", "body... | def endTagOther(self, token): self.parser.parseError("end-tag-after-implied-root", {"name": token["name"]}) class InHeadPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), ("title", self.startTagTitle), (("nos... | def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", {"name": token["name"]}) else: self.insertHtmlElement() self.parser.phase.processEndTag(token) |
self.tree.insertText(data) def processCharacters(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertText(token["data"]) self.parser.framesetOK = False def processSpaceCharacters(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertText(token["data"]) def startTagPr... | self.tree.insertText(token["data"]) self.parser.framesetOK = False def processSpaceCharacters(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertText(token["data"]) def startTagProcessInHead(self, token): self.parser.phases["inHead"].processStartTag(token) def startTagBody(self, token): se... | def processSpaceCharactersDropNewline(self, token): # Sometimes (start of <pre>, <listing>, and <textarea> blocks) we # want to drop leading newlines data = token["data"] self.processSpaceCharacters = self.processSpaceCharactersNonPre if (data.startswith("\n") and self.tree.openElements[-1].name in ("pre", "listing", "... |
self.tree.formPointer = self.tree.openElements[-1] def startTagListItem(self, token): self.parser.framesetOK = False stopNamesMap = {"li":["li"], "dt":["dt", "dd"], "dd":["dt", "dd"]} stopNames = stopNamesMap[token["name"]] for node in reversed(self.tree.openElements): if node.name in stopNames: | def startTagPreListing(self, token): if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p")) self.tree.insertElement(token) self.parser.framesetOK = False self.processSpaceCharacters = self.processSpaceCharactersDropNewline def startTagForm(self, token): if self.tree.formPointer: self.parser.parseError(u"... | def startTagForm(self, token): if self.tree.formPointer: self.parser.parseError(u"unexpected-start-tag", {"name": "form"}) else: if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p")) self.tree.insertElement(token) self.tree.formPointer = self.tree.openElements[-1] |
impliedTagToken(node.name, "EndTag")) break if (node.nameTuple in (scopingElements | specialElements) and node.name not in ("address", "div", "p")): break if self.tree.elementInScope("p"): self.parser.phase.processEndTag( impliedTagToken("p", "EndTag")) self.tree.insertElement(token) def startTagPlaintext(self, toke... | impliedTagToken("p", "EndTag")) self.tree.insertElement(token) def startTagPlaintext(self, token): if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p")) self.tree.insertElement(token) self.parser.tokenizer.state = self.parser.tokenizer.plaintextState def startTagHeading(self, token): if self.tree.elem... | def startTagListItem(self, token): self.parser.framesetOK = False |
self.addFormattingElement(token) def startTagButton(self, token): if self.tree.elementInScope("button"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "button", "endName": "button"}) self.processEndTag(impliedTagToken("button")) self.parser.phase.processStartTag(token) else: | self.addFormattingElement(token) def startTagFormatting(self, token): | def startTagNobr(self, token): self.tree.reconstructActiveFormattingElements() if self.tree.elementInScope("nobr"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "nobr", "endName": "nobr"}) self.processEndTag(impliedTagToken("nobr")) # XXX Need tests that trigger the following self.tree.r... |
self.tree.insertElement(token) | self.addFormattingElement(token) def startTagNobr(self, token): self.tree.reconstructActiveFormattingElements() if self.tree.elementInScope("nobr"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "nobr", "endName": "nobr"}) self.processEndTag(impliedTagToken("nobr")) self.tree.reconstruc... | def startTagButton(self, token): if self.tree.elementInScope("button"): self.parser.parseError("unexpected-start-tag-implies-end-tag", {"startName": "button", "endName": "button"}) self.processEndTag(impliedTagToken("button")) self.parser.phase.processStartTag(token) else: self.tree.reconstructActiveFormattingElements(... |
def startTagAppletMarqueeObject(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertElement(token) self.tree.activeFormattingElements.append(Marker) self.parser.framesetOK = False def startTagXmp(self, token): if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p")) self.tree.reco... | def startTagXmp(self, token): | def startTagAppletMarqueeObject(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertElement(token) self.tree.activeFormattingElements.append(Marker) self.parser.framesetOK = False |
self.processEndTag(impliedTagToken("p")) self.tree.insertElement(token) self.parser.framesetOK = False self.parser.phase = self.parser.phases["inTable"] def startTagVoidFormatting(self, token): self.tree.reconstructActiveFormattingElements() self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosin... | self.endTagP(impliedTagToken("p")) self.tree.reconstructActiveFormattingElements() self.parser.framesetOK = False self.parser.parseRCDataRawtext(token, "RAWTEXT") def startTagTable(self, token): if self.parser.compatMode != "quirks": if self.tree.elementInScope("p"): self.processEndTag(impliedTagToken("p")) self.tree.... | def startTagTable(self, token): if self.parser.compatMode != "quirks": if self.tree.elementInScope("p"): self.processEndTag(impliedTagToken("p")) self.tree.insertElement(token) self.parser.framesetOK = False self.parser.phase = self.parser.phases["inTable"] |
def startTagSvg(self, token): self.tree.reconstructActiveFormattingElements() self.parser.adjustSVGAttributes(token) self.parser.adjustForeignAttributes(token) token["namespace"] = namespaces["svg"] self.tree.insertElement(token) if self.parser.phase != self.parser.phases["inForeignContent"]: self.parser.secondaryPha... | self.parser.framesetOK = False def startTagParamSource(self, token): self.tree.insertElement(token) | def startTagMath(self, token): self.tree.reconstructActiveFormattingElements() self.parser.adjustMathMLAttributes(token) self.parser.adjustForeignAttributes(token) token["namespace"] = namespaces["mathml"] self.tree.insertElement(token) #Need to get the parse error right for the case where the token #has a namespace no... |
def startTagMisplaced(self, token): """ Elements that should be children of other elements that have a different insertion mode; here they are ignored "caption", "col", "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody", "td", "tfoot", "th", "thead", "tr", "noscript" """ self.parser.parseError("unex... | def startTagHr(self, token): if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p")) self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosingAcknowledged"] = True self.parser.framesetOK = False def startTagImage(self, token): self.parser.parseError("unexpected-start-tag-treated-as",... | def startTagMisplaced(self, token): """ Elements that should be children of other elements that have a different insertion mode; here they are ignored "caption", "col", "colgroup", "frame", "frameset", "head", "option", "optgroup", "tbody", "td", "tfoot", "th", "thead", "tr", "noscript" """ self.parser.parseError("unex... |
node = self.tree.openElements.pop() while node.name != "p": | self.endTagP(impliedTagToken("p", "EndTag")) else: self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parser.parseError("unexpected-end-tag", {"name": "p"}) | def endTagP(self, token): if not self.tree.elementInScope("p"): self.startTagCloseP(impliedTagToken("p", "StartTag")) self.parser.parseError("unexpected-end-tag", {"name": "p"}) self.endTagP(impliedTagToken("p", "EndTag")) else: self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parse... |
def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option", "p", "rp", "rt", "tbody", "td", "tfoot", "th", "thead", "tr... | while node.name != "p": node = self.tree.openElements.pop() def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option"... | def endTagP(self, token): if not self.tree.elementInScope("p"): self.startTagCloseP(impliedTagToken("p", "StartTag")) self.parser.parseError("unexpected-end-tag", {"name": "p"}) self.endTagP(impliedTagToken("p", "EndTag")) else: self.tree.generateImpliedEndTags("p") if self.tree.openElements[-1].name != "p": self.parse... |
"expected-one-end-tag-but-got-another", {"expectedName": "body", "gotName": node.name}) | "end-tag-too-early", {"name": token["name"]}) node = self.tree.openElements.pop() while node.name != token["name"]: node = self.tree.openElements.pop() def endTagHeading(self, token): for item in headingElements: if self.tree.elementInScope(item): self.tree.generateImpliedEndTags() | def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option", "p", "rp", "rt", "tbody", "td", "tfoot", "th", "thead", "tr... |
self.parser.phase = self.parser.phases["afterBody"] def endTagHtml(self, token): if self.tree.elementInScope("body"): self.endTagBody(impliedTagToken("body")) self.parser.phase.processEndTag(token) def endTagBlock(self, token): if token["name"] == "pre": self.processSpaceCharacters = self.processSpaceCharactersNonP... | def endTagBody(self, token): if not self.tree.elementInScope("body"): self.parser.parseError() return elif self.tree.openElements[-1].name != "body": for node in self.tree.openElements[2:]: if node.name not in frozenset(("dd", "dt", "li", "optgroup", "option", "p", "rp", "rt", "tbody", "td", "tfoot", "th", "thead", "tr... | |
self.parser.parseError( "end-tag-too-early", {"name": token["name"]}) node = self.tree.openElements.pop() while node.name != token["name"]: node = self.tree.openElements.pop() def endTagHeading(self, token): for item in headingElements: if self.tree.elementInScope(item): self.tree.generateImpliedEndTags() break if sel... | self.parser.parseError("end-tag-too-early", {"name": token["name"]}) for item in headingElements: if self.tree.elementInScope(item): | def endTagListItem(self, token): if token["name"] == "li": variant = "list" else: variant = None if not self.tree.elementInScope(token["name"], variant=variant): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) else: self.tree.generateImpliedEndTags(exclude = token["name"]) if self.tree.openElement... |
break def endTagFormatting(self, token): """The much-feared adoption agency algorithm""" name = token["name"] while True: formattingElement = self.tree.elementInActiveFormattingElements( token["name"]) if (not formattingElement or (formattingElement in self.tree.openElements and not self.tree.elementInScope(formatt... | while item.name not in headingElements: item = self.tree.openElements.pop() | def endTagHeading(self, token): for item in headingElements: if self.tree.elementInScope(item): self.tree.generateImpliedEndTags() break if self.tree.openElements[-1].name != token["name"]: self.parser.parseError("end-tag-too-early", {"name": token["name"]}) |
if furthestBlock is None: element = self.tree.openElements.pop() while element != formattingElement: | def endTagFormatting(self, token): """The much-feared adoption agency algorithm""" name = token["name"] while True: formattingElement = self.tree.elementInActiveFormattingElements( token["name"]) if (not formattingElement or (formattingElement in self.tree.openElements and not self.tree.elementInScope(formattingElem... | def endTagFormatting(self, token): """The much-feared adoption agency algorithm""" # http://www.whatwg.org/specs/web-apps/current-work/#adoptionAgency # XXX Better parseError messages appreciated. name = token["name"] while True: # Step 1 paragraph 1 formattingElement = self.tree.elementInActiveFormattingElements( toke... |
self.tree.activeFormattingElements.remove(element) return commonAncestor = self.tree.openElements[afeIndex-1] bookmark = self.tree.activeFormattingElements.index(formattingElement) lastNode = node = furthestBlock while True: node = self.tree.openElements[ self.tree.openElements.index(node)-1] while node n... | while element != formattingElement: element = self.tree.openElements.pop() self.tree.activeFormattingElements.remove(element) return commonAncestor = self.tree.openElements[afeIndex-1] bookmark = self.tree.activeFormattingElements.index(formattingElement) lastNode = node = furthestBlock while True: | def endTagFormatting(self, token): """The much-feared adoption agency algorithm""" # http://www.whatwg.org/specs/web-apps/current-work/#adoptionAgency # XXX Better parseError messages appreciated. name = token["name"] while True: # Step 1 paragraph 1 formattingElement = self.tree.elementInActiveFormattingElements( toke... |
self.tree.openElements.remove(tmpNode) if node == formattingElement: break if lastNode == furthestBlock: bookmark = (self.tree.activeFormattingElements.index(node) + 1) clone = node.cloneNode() self.tree.activeFormattingElements[ self.tree.activeFormattingElements.index(node)] = clone self.tree.openElements[ self... | while node not in self.tree.activeFormattingElements: tmpNode = node node = self.tree.openElements[ self.tree.openElements.index(node)-1] self.tree.openElements.remove(tmpNode) if node == formattingElement: break if lastNode == furthestBlock: bookmark = (self.tree.activeFormattingElements.index(node) + 1) clone = ... | def endTagFormatting(self, token): """The much-feared adoption agency algorithm""" # http://www.whatwg.org/specs/web-apps/current-work/#adoptionAgency # XXX Better parseError messages appreciated. name = token["name"] while True: # Step 1 paragraph 1 formattingElement = self.tree.elementInActiveFormattingElements( toke... |
node.appendChild(lastNode) lastNode = node if lastNode.parent: lastNode.parent.removeChild(lastNode) if commonAncestor.name in frozenset(("table", "tbody", "tfoot", "thead", "tr")): parent, insertBefore = self.tree.getTableMisnestedNodePosition() parent.insertBefore(lastNode, insertBefore) else: commonAncestor.... | if commonAncestor.name in frozenset(("table", "tbody", "tfoot", "thead", "tr")): parent, insertBefore = self.tree.getTableMisnestedNodePosition() parent.insertBefore(lastNode, insertBefore) else: commonAncestor.appendChild(lastNode) clone = formattingElement.cloneNode() furthestBlock.reparentChildren(clone) furth... | def endTagFormatting(self, token): """The much-feared adoption agency algorithm""" # http://www.whatwg.org/specs/web-apps/current-work/#adoptionAgency # XXX Better parseError messages appreciated. name = token["name"] while True: # Step 1 paragraph 1 formattingElement = self.tree.elementInActiveFormattingElements( toke... |
self.tree.clearActiveFormattingElements() def endTagBr(self, token): self.parser.parseError("unexpected-end-tag-treated-as", {"originalName": "br", "newName": "br element"}) self.tree.reconstructActiveFormattingElements() self.tree.insertElement(impliedTagToken("br", "StartTag")) self.tree.openElements.pop() def endT... | while element.name != token["name"]: element = self.tree.openElements.pop() self.tree.clearActiveFormattingElements() def endTagBr(self, token): self.parser.parseError("unexpected-end-tag-treated-as", {"originalName": "br", "newName": "br element"}) self.tree.reconstructActiveFormattingElements() self.tree.insertEleme... | def endTagAppletMarqueeObject(self, token): if self.tree.elementInScope(token["name"]): self.tree.generateImpliedEndTags() if self.tree.openElements[-1].name != token["name"]: self.parser.parseError("end-tag-too-early", {"name": token["name"]}) |
class TextPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([]) self.startTagHandler.default = self.startTagOther self.endTagHandler = utils.MethodDispatcher([ ("script", self.endTagScript)]) self.endTagHandler.default = self.endTagOther de... | else: if (node.nameTuple in specialElements | scopingElements): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) break class TextPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([]) self.startTagHandler.default = self.... | def endTagOther(self, token): for node in self.tree.openElements[::-1]: if node.name == token["name"]: self.tree.generateImpliedEndTags(exclude=token["name"]) if self.tree.openElements[-1].name != token["name"]: self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) while self.tree.openElements.pop() != ... |
def processEOF(self): if self.tree.openElements[-1].name != "html": self.parser.parseError("eof-in-table") else: assert self.parser.innerHTML def processSpaceCharacters(self, token): originalPhase = self.parser.phase self.parser.phase = self.parser.phases["inTableText"] self.parser.phase.originalPhase = originalPhase... | self.parser.phase = self.parser.originalPhase self.parser.phase.processEOF() def startTagOther(self, token): assert False, "Tried to process start tag %s in RCDATA/RAWTEXT mode"%name def endTagScript(self, token): node = self.tree.openElements.pop() assert node.name == "script" self.parser.phase = self.parser.origina... | def clearStackToTableContext(self): # "clear the stack back to a table context" while self.tree.openElements[-1].name not in ("table", "html"): #self.parser.parseError("unexpected-implied-end-tag-in-table", # {"name": self.tree.openElements[-1].name}) self.tree.openElements.pop() # When the current node is <html> it'... |
def startTagStyleScript(self, token): self.parser.phases["inHead"].processStartTag(token) def startTagInput(self, token): if ("type" in token["data"] and token["data"]["type"].translate(asciiUpper2Lower) == "hidden"): self.parser.parseError("unexpected-hidden-input-in-table") self.tree.insertElement(token) | def startTagRowGroup(self, token): self.clearStackToTableContext() self.tree.insertElement(token) self.parser.phase = self.parser.phases["inTableBody"] def startTagImplyTbody(self, token): self.startTagRowGroup(impliedTagToken("tbody", "StartTag")) self.parser.phase.processStartTag(token) def startTagTable(self, toke... | def startTagStyleScript(self, token): self.parser.phases["inHead"].processStartTag(token) |
else: self.startTagOther(token) def startTagForm(self, token): self.parser.parseError("unexpected-form-in-table") self.tree.insertElement(token) self.tree.openElements.pop() def startTagOther(self, token): self.parser.parseError("unexpected-start-tag-implies-table-voodoo", {"name": token["name"]}) self.tree.insertFr... | def startTagOther(self, token): self.parser.parseError("unexpected-start-tag-implies-table-voodoo", {"name": token["name"]}) self.tree.insertFromTable = True self.parser.phases["inBody"].processStartTag(token) self.tree.insertFromTable = False def endTagTable(self, token): if self.tree.elementInScope("table", variant... | def startTagInput(self, token): if ("type" in token["data"] and token["data"]["type"].translate(asciiUpper2Lower) == "hidden"): self.parser.parseError("unexpected-hidden-input-in-table") self.tree.insertElement(token) # XXX associate with form self.tree.openElements.pop() else: self.startTagOther(token) |
self.tree.openElements.pop() self.parser.resetInsertionMode() else: assert self.parser.innerHTML | self.parser.resetInsertionMode() else: assert self.parser.innerHTML self.parser.parseError() def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def endTagOther(self, token): self.parser.parseError("unexpected-end-tag-implies-table-voodoo", {"name": token["name"]}) s... | def endTagTable(self, token): if self.tree.elementInScope("table", variant="table"): self.tree.generateImpliedEndTags() if self.tree.openElements[-1].name != "table": self.parser.parseError("end-tag-too-early-named", {"gotName": "table", "expectedName": self.tree.openElements[-1].name}) while self.tree.openElements[-1]... |
def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def endTagOther(self, token): self.parser.parseError("unexpected-end-tag-implies-table-voodoo", {"name": token["name"]}) self.tree.insertFromTable = True self.parser.phases["inBody"].processEndTag(token) self.tree.ins... | ignoreEndTag = self.ignoreEndTagCaption() self.parser.phase.processEndTag(impliedTagToken("caption")) if not ignoreEndTag: self.parser.phase.processStartTag(token) def startTagOther(self, token): self.parser.phases["inBody"].processStartTag(token) def endTagCaption(self, token): if not self.ignoreEndTagCaption(): se... | def endTagTable(self, token): if self.tree.elementInScope("table", variant="table"): self.tree.generateImpliedEndTags() if self.tree.openElements[-1].name != "table": self.parser.parseError("end-tag-too-early-named", {"gotName": "table", "expectedName": self.tree.openElements[-1].name}) while self.tree.openElements[-1]... |
self.tree.openElements.pop() self.tree.clearActiveFormattingElements() self.parser.phase = self.parser.phases["inTable"] else: assert self.parser.innerHTML | self.tree.clearActiveFormattingElements() self.parser.phase = self.parser.phases["inTable"] else: assert self.parser.innerHTML self.parser.parseError() def endTagTable(self, token): | def endTagCaption(self, token): if not self.ignoreEndTagCaption(): # AT this code is quite similar to endTagTable in "InTable" self.tree.generateImpliedEndTags() if self.tree.openElements[-1].name != "caption": self.parser.parseError("expected-one-end-tag-but-got-another", {"gotName": "caption", "expectedName": self.tr... |
def endTagTable(self, token): self.parser.parseError() ignoreEndTag = self.ignoreEndTagCaption() self.parser.phase.processEndTag(impliedTagToken("caption")) if not ignoreEndTag: self.parser.phase.processEndTag(token) def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) ... | ignoreEndTag = self.ignoreEndTagCaption() self.parser.phase.processEndTag(impliedTagToken("caption")) if not ignoreEndTag: self.parser.phase.processEndTag(token) def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag", {"name": token["name"]}) def endTagOther(self, token): self.parser.phases["inBod... | def endTagCaption(self, token): if not self.ignoreEndTagCaption(): # AT this code is quite similar to endTagTable in "InTable" self.tree.generateImpliedEndTags() if self.tree.openElements[-1].name != "caption": self.parser.parseError("expected-one-end-tag-but-got-another", {"gotName": "caption", "expectedName": self.tr... |
self.parser.phase.processEOF() def processCharacters(self, token): ignoreEndTag = self.ignoreEndTagColgroup() self.endTagColgroup(impliedTagToken("colgroup")) if not ignoreEndTag: self.parser.phase.processCharacters(token) def startTagCol(self, token): self.tree.insertElement(token) self.tree.openElements.pop() def ... | self.parser.phase.processCharacters(token) def startTagCol(self, token): self.tree.insertElement(token) self.tree.openElements.pop() def startTagOther(self, token): ignoreEndTag = self.ignoreEndTagColgroup() self.endTagColgroup(impliedTagToken("colgroup")) if not ignoreEndTag: self.parser.phase.processStartTag(token)... | def processEOF(self): if self.tree.openElements[-1].name == "html": assert self.parser.innerHTML return else: ignoreEndTag = self.ignoreEndTagColgroup() self.endTagColgroup(impliedTagToken("colgroup")) if not ignoreEndTag: self.parser.phase.processEOF() |
def endTagColgroup(self, token): if self.ignoreEndTagColgroup(): assert self.parser.innerHTML self.parser.parseError() else: self.tree.openElements.pop() self.parser.phase = self.parser.phases["inTable"] def endTagCol(self, token): self.parser.parseError("no-end-tag", {"name": "col"}) def endTagOther(self, token): i... | def startTagTableOther(self, token): if (self.tree.elementInScope("tbody", variant="table") or self.tree.elementInScope("thead", variant="table") or self.tree.elementInScope("tfoot", variant="table")): self.clearStackToTableBodyContext() self.endTagTableRowGroup( impliedTagToken(self.tree.openElements[-1].name)) self.... | def endTagColgroup(self, token): if self.ignoreEndTagColgroup(): # innerHTML case assert self.parser.innerHTML self.parser.parseError() else: self.tree.openElements.pop() self.parser.phase = self.parser.phases["inTable"] |
def endTagTable(self, token): if (self.tree.elementInScope("tbody", variant="table") or self.tree.elementInScope("thead", variant="table") or self.tree.elementInScope("tfoot", variant="table")): self.clearStackToTableBodyContext() self.endTagTableRowGroup( impliedTagToken(self.tree.openElements[-1].name)) | def endTagOther(self, token): self.parser.phases["inTable"].processEndTag(token) class InRowPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), (("td", "th"), self.startTagTableCell), (("caption", "col", "colg... | def endTagTable(self, token): if (self.tree.elementInScope("tbody", variant="table") or self.tree.elementInScope("thead", variant="table") or self.tree.elementInScope("tfoot", variant="table")): self.clearStackToTableBodyContext() self.endTagTableRowGroup( impliedTagToken(self.tree.openElements[-1].name)) self.parser.p... |
else: assert self.parser.innerHTML self.parser.parseError() def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag-in-table-body", {"name": token["name"]}) def endTagOther(self, token): self.parser.phases["inTable"].processEndTag(token) class InRowPhase(Phase): def __init__(self, parser, tree):... | class InFramesetPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), ("frameset", self.startTagFrameset), ("frame", self.startTagFrame), ("noframes", self.startTagNoframes) ]) self.startTagHandler.default = self... | def endTagTable(self, token): if (self.tree.elementInScope("tbody", variant="table") or self.tree.elementInScope("thead", variant="table") or self.tree.elementInScope("tfoot", variant="table")): self.clearStackToTableBodyContext() self.endTagTableRowGroup( impliedTagToken(self.tree.openElements[-1].name)) self.parser.p... |
def ignoreEndTagTr(self): return not self.tree.elementInScope("tr", variant="table") def processEOF(self): self.parser.phases["inTable"].processEOF() def processSpaceCharacters(self, token): self.parser.phases["inTable"].processSpaceCharacters(token) def processCharacters(self, token): self.parser.phases["inTable"]... | def startTagNoframes(self, token): self.parser.phases["inBody"].processStartTag(token) def startTagOther(self, token): self.parser.parseError("unexpected-start-tag-in-frameset", {"name": token["name"]}) def endTagFrameset(self, token): if self.tree.openElements[-1].name == "html": self.parser.parseError("unexpected-... | def ignoreEndTagTr(self): return not self.tree.elementInScope("tr", variant="table") |
def startTagOther(self, token): self.parser.phases["inTable"].processStartTag(token) def endTagTr(self, token): if not self.ignoreEndTagTr(): self.clearStackToTableRowContext() self.tree.openElements.pop() self.parser.phase = self.parser.phases["inTableBody"] else: assert self.parser.innerHTML self.parser.parseError(... | def processEndTag(self, token): self.parser.parseError("expected-eof-but-got-end-tag", {"name": token["name"]}) self.parser.phase = self.parser.phases["inBody"] | def startTagOther(self, token): self.parser.phases["inTable"].processStartTag(token) |
def endTagTableRowGroup(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.endTagTr(impliedTagToken("tr")) self.parser.phase.processEndTag(token) else: assert self.parser.innerHTML self.parser.parseError() def endTagIgnore(self, token): self.parser.parseError("unexpected-end-tag-in-table-... | class AfterAfterFramesetPhase(Phase): def __init__(self, parser, tree): Phase.__init__(self, parser, tree) self.startTagHandler = utils.MethodDispatcher([ ("html", self.startTagHtml), ("noframes", self.startTagNoFrames) ]) self.startTagHandler.default = self.startTagOther def processEOF(self): pass def processCommen... | def endTagTableRowGroup(self, token): if self.tree.elementInScope(token["name"], variant="table"): self.endTagTr(impliedTagToken("tr")) self.parser.phase.processEndTag(token) else: # innerHTML case assert self.parser.innerHTML self.parser.parseError() |
"frameset":"inFrameset" | "frameset":"inFrameset", "html":"beforeHead" | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... |
if nodeName not in ['td', 'th']: assert self.innerHTML nodeName = self.innerHTML | nodeName = self.innerHTML | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... |
if nodeName in ("select", "colgroup", "head", "frameset"): | if nodeName in ("select", "colgroup", "head", "frameset", "html"): | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... |
self.phase = self.phases[newModes[nodeName]] | new_phase = self.phases[newModes[nodeName]] | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... |
self.phase = self.phases["inForeignContent"] self.secondaryPhase = self.phases["inBody"] | foreign = True elif last: new_phase = self.phases["inBody"] | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... |
elif nodeName == "html": if self.tree.headPointer is None: self.phase = self.phases["beforeHead"] else: self.phase = self.phases["afterHead"] break elif last: self.phase = self.phases["inBody"] break | if foreign: self.phase = self.phases["inForeignContent"] self.secondaryPhase = new_phase else: self.phase = new_phase | def resetInsertionMode(self): # The name of this method is mostly historical. (It's also used in the # specification.) last = False newModes = { "select":"inSelect", "td":"inCell", "th":"inCell", "tr":"inRow", "tbody":"inTableBody", "thead":"inTableBody", "tfoot":"inTableBody", "caption":"inCaption", "colgroup":"inColu... |
(("input", "keygen", "textarea"), self.startTagInput) | (("input", "keygen", "textarea"), self.startTagInput), ("script", self.startTagScript) | def __init__(self, parser, tree): Phase.__init__(self, parser, tree) |
elif data in (u"=", u"<"): | elif data in (u"=", u"<", u"`"): | def beforeAttributeValueState(self): data = self.stream.char() if data in spaceCharacters: self.stream.charsUntil(spaceCharacters, True) elif data == u"\"": self.state = self.attributeValueDoubleQuotedState elif data == u"&": self.state = self.attributeValueUnQuotedState self.stream.unget(data); elif data == u"'": self... |
self.currentToken["data"][-1][1] += data + self.stream.charsUntil( \ frozenset(("&", ">", "<", "=", "'", '"')) | spaceCharacters) | self.currentToken["data"][-1][1] += data + self.stream.charsUntil( frozenset((u"&", u">", u'"', u"'", u"=", u"<", u"`")) | spaceCharacters) | def attributeValueUnQuotedState(self): data = self.stream.char() if data in spaceCharacters: self.state = self.beforeAttributeNameState elif data == u"&": self.processEntityInAttribute(">") elif data == u">": self.emitCurrentToken() elif data in (u'"', u"'", u"=", u"<", u"`"): self.tokenQueue.append({"type": tokenTypes... |
if data: data = data + self._bufferedCharacter else: data = self._bufferedCharacter | data = self._bufferedCharacter + data | def readChunk(self, chunkSize=None): if chunkSize is None: chunkSize = self._defaultChunkSize |
if not self.tree.elementInScope("select", variant="select"): assert self.parser.innerHTML | if self.tree.elementInScope("select", variant="select"): | def startTagInput(self, token): self.parser.parseError("unexpected-input-in-select") if not self.tree.elementInScope("select", variant="select"): assert self.parser.innerHTML self.endTagSelect(impliedTagToken("select")) return token |
data = inputstream.EncodingBytes( attributes["content"].encode(self.parser.tokenizer.stream.charEncoding[0])) | data = inputstream.EncodingBytes(attributes["content"].encode("utf-8")) | def startTagMeta(self, token): self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosingAcknowledged"] = True |
self.endTagBody(impliedTagToken("body")) if not self.parser.innerHTML: | if self.tree.elementInScope("body"): self.endTagBody(impliedTagToken("body")) | def endTagHtml(self, token): self.endTagBody(impliedTagToken("body")) if not self.parser.innerHTML: self.parser.phase.processEndTag(token) |
or publicId.startswith( | or startswithany(publicId, | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] |
elif (publicId.startswith( | elif (startswithany(publicId, | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] |
self.setConfig(self._retrieveConfig()) self.__cfgModified = False | try: self.setConfig(self._retrieveConfig()) self.__cfgModified = False except: logger().error(traceback.format_exc()) | def retrieveConfig(self): """ retrieves original configuration from vermont instance and replaces current configurations, both original and dynamic """ logger().debug("VermontInstance.retrieveConfig()") self.setConfig(self._retrieveConfig()) self.__cfgModified = False |
userData['ResultsOutputDir'][userData['ResultsOutputDir'].find(userData['Kind'])+len(userData['Kind'])+1:]) + '/', | userData['ResultsOutputDir'][userData['ResultsOutputDir'].find(userData['Kind'])+len(userData['Kind'])+1:], imgName + '/'), | def process(userData, kind_id, argv): """ Execute system call then updates the database consequently. exit_code != 0 means problem. """ user_id = userData['UserID'] kind = userData['Kind'] # Log file to store storeLog = '_condor_stderr' success = 0 db = DB(host = DATABASE_HOST, user = DATABASE_USER, passwd = DATABASE... |
if oldPath and type(oldPath) != types.StringType: | if oldPath and (type(oldPath) != types.StringType and type(oldPath) != types.UnicodeType): | def getUserResultsOutputDir(self, request, oldPath = None, oldUserName = None): """ Builds a default output path for the user if oldPath is None. If oldPath (a path to a previously processed item) is a string, then attempts to replace the old login name with the name of the current request owner. @param oldPath Old out... |
print_processings(find_tasks(tags, g_task_id, g_kind, g_user, g_success, g_failure)) | tasks = find_tasks(tags, g_task_id, g_kind, g_user, g_success, g_failure) print_processings(tasks) | def list_processings(tags=[]): """ List processing results according to parameters """ from terapix.lib.processing import find_tasks print_processings(find_tasks(tags, g_task_id, g_kind, g_user, g_success, g_failure)) if g_delete and len(tasks) > 0: rels = Rel_it.objects.filter(task__in=tasks) print "Rel_it:", len(rel... |
'UseAutoQFITSWeights' : int(data.useAutoQFITSWeights), 'UseAutoScampHeads' : int(data.useAutoScampHeads), | 'UseAutoQFITSWeights' : data.useAutoQFITSWeights, 'UseAutoScampHeads' : data.useAutoScampHeads, | def getTaskInfo(self, request): """ Returns information about a finished processing task. Used on the results page. """ |
h_insrument = getFITSField(hdulist, 'YINSTRUMENT') | h_instrument = getFITSField(hdulist, 'YINSTRUMENT') | def run_ingestion(): """ Ingestion procedure of FITS images in the database """ global log, email, script_args, ingestionId, g, ittdata email = script_args['email'] user_id = script_args['user_id'] path = script_args['path'] ingestion_id = script_args['ingestion_id'] # parsing otherArgs duration_stime = time.time()... |
if type(output_dir) != types.StringType: | if type(output_dir) != types.StringType and type(output_dir) != types.UnicodeType: | def get_static_url(output_dir): """ Returns the appropriate YOUPI_STATIC_URLS entry according to output_dir (member of settings.PROCESSING_OUTPUT) @param output_dir output directory @return matched http URI for serving results """ import types try: from django.conf import settings PROCESSING_OUTPUT = settings.PROCESSIN... |
query += ' fitsin.psffwhmmin >= %s AND fitsin.task_id = task.id AND relit.task_id = task.id AND relit.image_id = i.id' % post['seeing_min'] | query += ' fitsin.psffwhm >= %s AND fitsin.task_id = task.id AND relit.task_id = task.id AND relit.image_id = i.id' % post['seeing_min'] | def get_global_report(request, reportId): """ Generates a global report. @param reportId report Id """ post = request.POST if reportId == 'imssavedselections': from terapix.reporting.csv import CSVReport sels = ImageSelections.objects.all().order_by('date') content = [] k = 1 for s in sels: content.append((k, s.name)) ... |
query += ' fitsin.psffwhmmax <= %s AND fitsin.task_id = task.id AND relit.task_id = task.id AND relit.image_id = i.id' % post['seeing_max'] | query += ' fitsin.psffwhm <= %s AND fitsin.task_id = task.id AND relit.task_id = task.id AND relit.image_id = i.id' % post['seeing_max'] | def get_global_report(request, reportId): """ Generates a global report. @param reportId report Id """ post = request.POST if reportId == 'imssavedselections': from terapix.reporting.csv import CSVReport sels = ImageSelections.objects.all().order_by('date') content = [] k = 1 for s in sels: content.append((k, s.name)) ... |
query = tquery + query + ';' | query = tquery + query + ' AND task.success=1;' | def get_global_report(request, reportId): """ Generates a global report. @param reportId report Id """ post = request.POST if reportId == 'imssavedselections': from terapix.reporting.csv import CSVReport sels = ImageSelections.objects.all().order_by('date') content = [] k = 1 for s in sels: content.append((k, s.name)) ... |
query += " i.id IN (%s);" % ','.join(res) | if query.find('youpi_processing_task') > 0: query += " i.id IN (%s) AND task.success=1;" % ','.join(res) else: query += " i.id IN (%s);" % ','.join(res) | def get_global_report(request, reportId): """ Generates a global report. @param reportId report Id """ post = request.POST if reportId == 'imssavedselections': from terapix.reporting.csv import CSVReport sels = ImageSelections.objects.all().order_by('date') content = [] k = 1 for s in sels: content.append((k, s.name)) ... |
debug("nameFromDB: %s" % nameFromDB) | debug("old argv: %s" % argv) debug("image Name from Database : %s" % nameFromDB) | def process(userData, kind_id, argv): """ Execute system call then updates the database consequently. exit_code != 0 means problem. """ user_id = userData['UserID'] kind = userData['Kind'] # Log file to store storeLog = '_condor_stderr' success = 0 db = DB(host = DATABASE_HOST, user = DATABASE_USER, passwd = DATABASE... |
debug("imgChecksum: %s" % imgChecksum) | def process(userData, kind_id, argv): """ Execute system call then updates the database consequently. exit_code != 0 means problem. """ user_id = userData['UserID'] kind = userData['Kind'] # Log file to store storeLog = '_condor_stderr' success = 0 db = DB(host = DATABASE_HOST, user = DATABASE_USER, passwd = DATABASE... | |
debug("imgNames: %s" % imgNames) | debug("images with same checksum: %s" % imgNames) | def process(userData, kind_id, argv): """ Execute system call then updates the database consequently. exit_code != 0 means problem. """ user_id = userData['UserID'] kind = userData['Kind'] # Log file to store storeLog = '_condor_stderr' success = 0 db = DB(host = DATABASE_HOST, user = DATABASE_USER, passwd = DATABASE... |
debug("litename: %s" % litename) | debug("Real image name : %s" % litename) | def process(userData, kind_id, argv): """ Execute system call then updates the database consequently. exit_code != 0 means problem. """ user_id = userData['UserID'] kind = userData['Kind'] # Log file to store storeLog = '_condor_stderr' success = 0 db = DB(host = DATABASE_HOST, user = DATABASE_USER, passwd = DATABASE... |
debug("NEWargv: %s" % argv) | def process(userData, kind_id, argv): """ Execute system call then updates the database consequently. exit_code != 0 means problem. """ user_id = userData['UserID'] kind = userData['Kind'] # Log file to store storeLog = '_condor_stderr' success = 0 db = DB(host = DATABASE_HOST, user = DATABASE_USER, passwd = DATABASE... | |
return HttpResponse(str({ 'perms' : Permissions(p.dflt_mode).toJSON(), | perms = Permissions(p.dflt_mode) return HttpResponse(json.encode({ 'perms' : perms.toJSON(), | def get_user_default_permissions(request): """ Returns user default permissions {'default_mode': <mode>, 'default_group': <group>'} """ p = request.user.get_profile() return HttpResponse(str({ 'perms' : Permissions(p.dflt_mode).toJSON(), 'default_group' : str(p.dflt_group), }), mimetype = 'text/plain') |
'q' : q, | def task_filter(request): try: # May be a list of owners owner = request.POST.getlist('Owner') status = request.POST['Status'] kindid = request.POST['Kind'] # Max results per page maxPerPage = int(request.POST['Limit']) # page # to return targetPage = int(request.POST['Page']) tags = request.POST.getlist('Tag') except ... | |
missing = [] | def genImageDotHead(image_id): """ Generate a FITS image's .head file. The image file is first accessed to get the number of HDUs (extansions). Then keywords mapping is retrieved from the instrument's ITT in order to get a proper HDU data. @return tuple of hdudata and total number of hdus in this image (primary + extan... | |
self.assertEquals(g, types.FloatType) | self.assertEquals(type(g), types.FloatType) | def test_sex_to_deg(self): for k in (lambda x: x, 3, object()): self.assertRaises(TypeError, cv.Delta.sex_to_deg, k) |
(os.path.join('/media', settings.MEDIA_TMP, fname), format), | (os.path.join('/media', settings.MEDIA_TMP, fname + "?%s" % time.time()), format), | def get_global_report(request, reportId, format): """ Generates a global report. @param reportId report Id @param format report's output format """ post = request.POST # Supported report output formats formats = ReportFormat.formats() if format not in [f['name'] for f in formats]: raise ValueError, "unsupported report ... |
'js/3rdParty/Q/q.js', | def findPath(file): for path in os.environ['PATH'].split(':'): abspath = os.path.join(path, file) if os.path.exists(abspath): if os.path.isfile(abspath): return path raise FileNotFoundError, "File %s not found in paths: %s" % (file, os.environ['PATH']) | |
debug("\tImage Skipped", WARNING) | debug("\tImage %s Skipped" % fitsfile, WARNING) | def run_ingestion(): """ Ingestion procedure of FITS images in the database """ global log, email, script_args, ingestionId, g, ittdata email = script_args['email'] user_id = script_args['user_id'] path = script_args['path'] ingestion_id = script_args['ingestion_id'] # parsing otherArgs duration_stime = time.time()... |
debug("\tImage with same name and checksum: multiple option state to ON, Ingestion...") | debug("\tImage %s with same name and checksum: multiple option state to ON, Ingestion..." % fitsfile) | def run_ingestion(): """ Ingestion procedure of FITS images in the database """ global log, email, script_args, ingestionId, g, ittdata email = script_args['email'] user_id = script_args['user_id'] path = script_args['path'] ingestion_id = script_args['ingestion_id'] # parsing otherArgs duration_stime = time.time()... |
debug("\tImage with same name and checksum: multiple option state to OFF, Skipping...") | debug("\tImage %s with same name and checksum: multiple option state to OFF, Skipping..." % fitsfile) | def run_ingestion(): """ Ingestion procedure of FITS images in the database """ global log, email, script_args, ingestionId, g, ittdata email = script_args['email'] user_id = script_args['user_id'] path = script_args['path'] ingestion_id = script_args['ingestion_id'] # parsing otherArgs duration_stime = time.time()... |
debug("Image already exists in database (same odometer number for different checksum, skipping...", WARNING) | debug("Image %s already exists in database (same odometer number for different checksum). Skipping..." % fitsfile, WARNING) continue | def run_ingestion(): """ Ingestion procedure of FITS images in the database """ global log, email, script_args, ingestionId, g, ittdata email = script_args['email'] user_id = script_args['user_id'] path = script_args['path'] ingestion_id = script_args['ingestion_id'] # parsing otherArgs duration_stime = time.time()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.