rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
line = sub('\[(\S+?)\]','<img src="\\1">',line) | line = sub('\[(\S+?)\]','<img src="\\1" alt="\\1">',line) | def linkOrImage(line): line = sub('\[(\S+?)\]','<img src="\\1">',line) line = sub('\[(\S+)\s(.*?)\]','<a href="\\1">\\2</a>',line) line = replace(line,'<img src="X">','[X]') line = replace(line,'<img src="_">','[_]') return line |
print "<ol>" | elif (inBodyText == 2): print"</pre>" inBodyText = 0 elif (inBodyText == 3): print"</table>" inBodyText = 0 if not (div == 1 and lineLevel == 1): print "<ol>" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increasing depth ... |
if (div == 1 and level == 1): print'</div>' | if (div == 1 and level == 1): print'</ol></div>' | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increasing depth ... |
if (div == 1 and lineLevel == 1): print divName(linein) | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increasing depth ... | |
print"<!-- $Revision: 1.29 $ -->" print"<!-- $Date: 2004/11/28 17:31:34 $ -->" | print"<!-- $Revision: 1.30 $ -->" print"<!-- $Date: 2004/12/02 01:02:48 $ -->" | def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + linein + "</title>" print"<!-- $Revision: 1.29 $ -->" print"<!-- $Date: 2004/11/28 17:31:34 $ -->" print"<!-- $Author: noel $ --... |
print " $Revision: 1.4 $" print " $Date: 2005/10/20 13:11:19 $" | print " $Revision: 1.5 $" print " $Date: 2005/10/20 13:12:39 $" | def showVersion(): print print "RCS" print " $Revision: 1.4 $" print " $Date: 2005/10/20 13:11:19 $" print " $Author: noel $" print |
subdir = int(sys.argv[i+1]) | subdir = sys.argv[i+1] | def getArgs(): global debug, level, inputfile, title, subdir if (len(sys.argv) == 1): showUsage() sys.exit()() else: for i in range(len(sys.argv)): if (i != 0): if (sys.argv[i] == "-d"): debug = 1 # test for debug flag elif (sys.argv[i] == "-?"): # test for help flag showUsage() # show the help sys.exit() # ex... |
print"<!-- $Date: 2001/07/31 18:54:16 $ -->" | print"<!-- $Date: 2001/08/01 20:21:18 $ -->" | def printHeader(linein): print "<HTML><TITLE>" + linein + "</title>" print"<!-- $Revsion:$ -->" print"<!-- $Date: 2001/07/31 18:54:16 $ -->" print"<!-- $Author: noel $ -->" |
print " $Revision: 1.30 $" print " $Date: 2004/12/02 01:02:48 $" | print " $Revision: 1.31 $" print " $Date: 2004/12/03 19:06:51 $" | def showVersion(): print print "RCS" print " $Revision: 1.30 $" print " $Date: 2004/12/02 01:02:48 $" print " $Author: noel $" print " $Source: /home/noel/active/NoelOTL/RCS/otl2html.py,v $" print |
line = replace(line,'<img src="X">','[X]') line = replace(line,'<img src="_">','[_]') | line = replace(line,'<img src="X" alt="X">','[X]') line = replace(line,'<img src="_" alt="_">','[_]') | def linkOrImage(line): line = sub('\[(\S+?)\]','<img src="\\1" alt="\\1">',line) line = sub('\[(\S+)\s(.*?)\]','<a href="\\1">\\2</a>',line) line = replace(line,'<img src="X">','[X]') line = replace(line,'<img src="_">','[_]') return line |
print"<!-- $Revision: 1.30 $ -->" print"<!-- $Date: 2004/12/02 01:02:48 $ -->" | print"<!-- $Revision: 1.31 $ -->" print"<!-- $Date: 2004/12/03 19:06:51 $ -->" | def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + linein + "</title>" print"<!-- $Revision: 1.30 $ -->" print"<!-- $Date: 2004/12/02 01:02:48 $ -->" print"<!-- $Author: noel $ --... |
print " $Revision: 1.10 $" print " $Date: 2002/01/08 16:19:51 $" | print " $Revision: 1.11 $" print " $Date: 2002/01/24 01:09:28 $" | def showVersion(): print print "RCS" print " $Revision: 1.10 $" print " $Date: 2002/01/08 16:19:51 $" print " $Author: noel $" print " $Source: /home/noel/active/projects/NoelOTL/RCS/otl2html.py,v $" print |
print "<p>" + lstrip(linein) | print "<p>" + lstrip(linein) + "</p>" | def processLine(linein): global level, formatMode, slides, hideComments lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level): while (li... |
print "<address>" + lstrip(linein) + "</address>\n" | print "<address>" print lstrip(linein) print "</address>\n" | def processLine(linein): global level, formatMode, slides, hideComments lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" else: if (lineLevel > level): while (li... |
print"<!-- $Date: 2002/01/08 16:19:51 $ -->" | print"<!-- $Date: 2002/01/24 01:09:28 $ -->" | def printHeader(linein): print "<HTML><TITLE>" + linein + "</TITLE>" print"<!-- $Revsion:$ -->" print"<!-- $Date: 2002/01/08 16:19:51 $ -->" print"<!-- $Author: noel $ -->" |
print " $Revision: 1.31 $" print " $Date: 2004/12/03 19:06:51 $" | print " $Revision: 1.32 $" print " $Date: 2004/12/11 19:35:48 $" | def showVersion(): print print "RCS" print " $Revision: 1.31 $" print " $Date: 2004/12/03 19:06:51 $" print " $Author: noel $" print " $Source: /home/noel/active/NoelOTL/RCS/otl2html.py,v $" print |
coldata = split(coldata,"|") | coldata = coldata.split("|") | def handleTableColumns(linein,lineLevel): out = "" coldata = lstrip(rstrip(linein)) coldata = split(coldata,"|") for i in range(1,len(coldata)-1): out += getColumnAlignment(coldata[i]) out += lstrip(rstrip(coldata[i]))+'</td>' return out |
coldata = split(coldata,"|") | coldata = coldata.split("|") | def handleTableHeaders(linein,lineLevel): out = "" coldata = lstrip(rstrip(linein)) coldata = split(coldata,"|") for i in range(2,len(coldata)-1): out += getColumnAlignment(coldata[i]) out += lstrip(rstrip(coldata[i]))+'</td>' out = replace(out,'<td','<th') out = replace(out,'</td','</th') return out |
print"<!-- $Revision: 1.31 $ -->" print"<!-- $Date: 2004/12/03 19:06:51 $ -->" | print"<!-- $Revision: 1.32 $ -->" print"<!-- $Date: 2004/12/11 19:35:48 $ -->" | def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + linein + "</title>" print"<!-- $Revision: 1.31 $ -->" print"<!-- $Date: 2004/12/03 19:06:51 $ -->" print"<!-- $Author: noel $ --... |
print " $Revision: 1.42 $" print " $Date: 2005/06/06 14:10:55 $" | print " $Revision: 1.43 $" print " $Date: 2005/06/07 13:16:40 $" | def showVersion(): print print "RCS" print " $Revision: 1.42 $" print " $Date: 2005/06/06 14:10:55 $" print " $Author: noel $" print |
out = sub('\-\-\-(.*?)\-\-\-','<strike>\\1</strike>',out) | def beautifyLine(line): if (lstrip(rstrip(line)) == "----------------------------------------"): return "<br><hr><br>" out = line line = "" while (line != out): line = out out = linkOrImage(out) # out = replace(out,'**','<strong>',1) out = sub('\*\*(.*?)\*\*','<strong>\\1</strong>',out) # out = replace(out,'//','<i>... | |
output += " font-family: fixed;\n" | output += " font-family: fixed,monospace;\n" | def createCSS(): global styleSheet output = " /* copyright notice and filename */\n" output += "body { \n" output += " font-family: helvetica,arial,sans-serif;\n" output += " font-size: 10pt;\n" output += "}\n" output += " /* title at the top of the page */\n" output += "H1 { \n" output += " font-f... |
print"<!-- $Revision: 1.42 $ -->" print"<!-- $Date: 2005/06/06 14:10:55 $ -->" | print"<!-- $Revision: 1.43 $ -->" print"<!-- $Date: 2005/06/07 13:16:40 $ -->" | def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + getTitleText(linein) + "</title>" print"<!-- $Revision: 1.42 $ -->" print"<!-- $Date: 2005/06/06 14:10:55 $ -->" pri... |
print " -l level The number of levels to split down to. The default is 1" print " -v Print version (RCS) information." print " -H Show the file syntax help." | print " -l level The number of levels to split down to. The default is 1" print " -t Include a title line (the parerent heading) in split files" print " -v Print version (RCS) information." print " -h Show help." | def showUsage(): print print "Usage:" print "otlsplit.py [options] inputfile > outputfile" print "Options" print " -l level The number of levels to split down to. The default is 1" print " -v Print version (RCS) information." print " -H Show the file syntax help." print "output... |
print " $Revision: 1.1 $" print " $Date: 2005/10/19 19:37:32 $" | print " $Revision: 1.2 $" print " $Date: 2005/10/19 20:11:22 $" | def showVersion(): print print "RCS" print " $Revision: 1.1 $" print " $Date: 2005/10/19 19:37:32 $" print " $Author: noel $" print |
global debug, level, inputfile | global debug, level, inputfile, title | def getArgs(): global debug, level, inputfile if (len(sys.argv) == 1): showUsage() sys.exit()() else: for i in range(len(sys.argv)): if (i != 0): if (sys.argv[i] == "-d"): debug = 1 # test for debug flag elif (sys.argv[i] == "-?"): # test for help flag showUsage() # show the help sys.exit() # exit elif (sys.ar... |
sys.exit() elif (sys.argv[i] == "-H"): showSyntax() | def getArgs(): global debug, level, inputfile if (len(sys.argv) == 1): showUsage() sys.exit()() else: for i in range(len(sys.argv)): if (i != 0): if (sys.argv[i] == "-d"): debug = 1 # test for debug flag elif (sys.argv[i] == "-?"): # test for help flag showUsage() # show the help sys.exit() # exit elif (sys.ar... | |
filename = filename + lstrip(rstrip(nameParts[i])) + "-" | filename = filename + lstrip(rstrip(convertSensitiveChars(nameParts[i]))) + "-" | def makeFileName(nameParts): global debug, level filename = "" for i in range(level): filename = filename + lstrip(rstrip(nameParts[i])) + "-" filename = filename[:-1]+ ".otl" return(filename) |
global debug, level | global debug, level, title | def processFile(file): global debug, level nameparts = [] for i in range(10): nameparts.append("") outOpen = 0 line = file.readline() # read the outline title # and discard it line = file.readline() # read the first parent heading dprint(level) while (line !=""): linelevel = getLineLevel(line) if (linelevel < l... |
nameparts[linelevel] = convertSensitiveChars(line) | nameparts[linelevel] = line | def processFile(file): global debug, level nameparts = [] for i in range(10): nameparts.append("") outOpen = 0 line = file.readline() # read the outline title # and discard it line = file.readline() # read the first parent heading dprint(level) while (line !=""): linelevel = getLineLevel(line) if (linelevel < l... |
print " simple - uses HTML tags <H1> through <H9>" print " bullets - uses HTML tags <UL> and <LI>" print " numeric - uses HTML tags <OL> and <LI> for 1.1.1" print " roman - uses HTML tags <OL> and <LI> for I.I.I" print " ... | print " simple - uses HTML tags <h1> through <h9>" print " bullets - uses HTML tags <ul> and <li>" print " numeric - uses HTML tags <ol> and <li> for 1.1.1" print " roman - uses HTML tags <ol> and <li> for I.I.I" print " ... | def showUsage(): print print "Usage:" print "otl2html.py [options] inputfile > outputfile" print "Options" print " -t type Specify the format type." print " Types:" print " simple - uses HTML tags <H1> through <H9>" print " bullets - uses HTML tags <... |
print " $Revision: 1.16 $" print " $Date: 2003/11/23 01:01:48 $" | print " $Revision: 1.17 $" print " $Date: 2003/11/24 18:16:16 $" | def showVersion(): print print "RCS" print " $Revision: 1.16 $" print " $Date: 2003/11/23 01:01:48 $" print " $Author: noel $" print " $Source: /home/noel/apps/NoelOTL/RCS/otl2html.py,v $" print |
print "<P", | print "<p", | def handleBodyText(linein,lineLevel): global inBodyText print "<P", if (styleSheet != ""): print " class=\"P" + str(lineLevel) + "\"", inBodyText = 1 print ">" + colonStrip(rstrip(lstrip(linein))), |
print "<H" + str(lineLevel) + ">" + lstrip(linein) + "</H" + str(lineLevel) + ">" | print "<h" + str(lineLevel) + ">" + lstrip(linein) + "</h" + str(lineLevel) + ">" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "<UL>" | print "<ul>" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "<OL type=\"I\">" | print "<ol type=\"I\">" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "<OL type=\"1\">" | print "<ol type=\"1\">" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "<OL type=\"A\">" | print "<ol type=\"A\">" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "<OL>" | print "<ol>" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "</UL>" | print "</ul>" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "</OL>" | print "</ol>" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "<LI", | print "<li", | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle if (lstrip(linein) == ""): return lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (formatMode == "simple"): print "<H" + str(lineLevel) + ">" + lstrip(linein)... |
print "<HTML><TITLE>" + linein + "</TITLE>" print"<!-- $Revision: 1.16 $ -->" print"<!-- $Date: 2003/11/23 01:01:48 $ -->" | print "<html><head><title>" + linein + "</title>" print"<!-- $Revision: 1.17 $ -->" print"<!-- $Date: 2003/11/24 18:16:16 $ -->" | def printHeader(linein): print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<HTML><TITLE>" + linein + "</TITLE>" print"<!-- $Revision: 1.16 $ -->" print"<!-- $Date: 2003/11/23 01:01:48 $ -->" print"<!-- $Author: noel $ -->" |
def printStyle(linein): global styleSheet, inlineStyle | def printHeader(linein): print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<HTML><TITLE>" + linein + "</TITLE>" print"<!-- $Revision: 1.16 $ -->" print"<!-- $Date: 2003/11/23 01:01:48 $ -->" print"<!-- $Author: noel $ -->" | |
print "<HEAD><LINK href=\"" + styleSheet + "\" rel=\"stylesheet\" type=\"text/css\"></HEAD>" | print "<link href=\"" + styleSheet + "\" rel=\"stylesheet\" type=\"text/css\">" | def printStyle(linein): global styleSheet, inlineStyle file = open(styleSheet,"r") if (styleSheet != "" and inlineStyle == 0): print "<HEAD><LINK href=\"" + styleSheet + "\" rel=\"stylesheet\" type=\"text/css\"></HEAD>" if (styleSheet != "" and inlineStyle == 1): print "<HEAD><STYLE type=\"text/css\">" csslinein = file... |
print "<HEAD><STYLE type=\"text/css\">" | print "<style type=\"text/css\">" | def printStyle(linein): global styleSheet, inlineStyle file = open(styleSheet,"r") if (styleSheet != "" and inlineStyle == 0): print "<HEAD><LINK href=\"" + styleSheet + "\" rel=\"stylesheet\" type=\"text/css\"></HEAD>" if (styleSheet != "" and inlineStyle == 1): print "<HEAD><STYLE type=\"text/css\">" csslinein = file... |
print "</STYLE></HEAD>" print "<BODY>" print "<DIV TITLE=\"DocTitle\">" print "<H1>" + rstrip(lstrip(linein)) +"</H1>" print "</DIV>" print "<DIV TITLE=\"Main\">" | print "</style></head>" print "<body>" print "<div title=\"DocTitle\">" print "<h1>" + rstrip(lstrip(linein)) +"</h1>" print "</div>" print "<div TITLE=\"Main\">" | def printStyle(linein): global styleSheet, inlineStyle file = open(styleSheet,"r") if (styleSheet != "" and inlineStyle == 0): print "<HEAD><LINK href=\"" + styleSheet + "\" rel=\"stylesheet\" type=\"text/css\"></HEAD>" if (styleSheet != "" and inlineStyle == 1): print "<HEAD><STYLE type=\"text/css\">" csslinein = file... |
print "</DIV>" | print "</div>" | def printFooter(): global slides print "</DIV>" if (slides == 0): print "<hr><font size=1>" print copyright print "</font><br>" print inputfile + "   " + strftime("%Y/%m/%d %H:%M",localtime(time())) print "</BODY></HTML>" |
print "<hr><font size=1>" | print "<div title=\"Footer\">" print "<hr>" | def printFooter(): global slides print "</DIV>" if (slides == 0): print "<hr><font size=1>" print copyright print "</font><br>" print inputfile + "   " + strftime("%Y/%m/%d %H:%M",localtime(time())) print "</BODY></HTML>" |
print "</font><br>" | print "<br>" | def printFooter(): global slides print "</DIV>" if (slides == 0): print "<hr><font size=1>" print copyright print "</font><br>" print inputfile + "   " + strftime("%Y/%m/%d %H:%M",localtime(time())) print "</BODY></HTML>" |
print "</BODY></HTML>" | print "</div>" print "</body></html>" | def printFooter(): global slides print "</DIV>" if (slides == 0): print "<hr><font size=1>" print copyright print "</font><br>" print inputfile + "   " + strftime("%Y/%m/%d %H:%M",localtime(time())) print "</BODY></HTML>" |
printStyle(firstLine) | def main(): getArgs() flatouline = [] file = open(inputfile,"r") if (slides == 0): firstLine = lstrip(rstrip(file.readline())) printHeader(firstLine) printStyle(firstLine) linein = lstrip(rstrip(file.readline())) while linein != "": processLine(linein) linein = file.readline() closeLevels() else: linein = lstrip(rstrip... | |
printStyle(flatoutline[0]) | def main(): getArgs() flatouline = [] file = open(inputfile,"r") if (slides == 0): firstLine = lstrip(rstrip(file.readline())) printHeader(firstLine) printStyle(firstLine) linein = lstrip(rstrip(file.readline())) while linein != "": processLine(linein) linein = file.readline() closeLevels() else: linein = lstrip(rstrip... | |
print " $Revision: 1.3 $" print " $Date: 2005/10/19 20:31:50 $" | print " $Revision: 1.4 $" print " $Date: 2005/10/20 13:11:19 $" | def showVersion(): print print "RCS" print " $Revision: 1.3 $" print " $Date: 2005/10/19 20:31:50 $" print " $Author: noel $" print |
print " $Revision: 1.24 $" print " $Date: 2004/11/24 02:35:29 $" | print " $Revision: 1.25 $" print " $Date: 2004/11/24 15:04:16 $" | def showVersion(): print print "RCS" print " $Revision: 1.24 $" print " $Date: 2004/11/24 02:35:29 $" print " $Author: noel $" print " $Source: /home/noel/active/NoelOTL/RCS/otl2html.py,v $" print |
print"<!-- $Revision: 1.24 $ -->" print"<!-- $Date: 2004/11/24 02:35:29 $ -->" | print"<!-- $Revision: 1.25 $ -->" print"<!-- $Date: 2004/11/24 15:04:16 $ -->" | def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + linein + "</title>" print"<!-- $Revision: 1.24 $ -->" print"<!-- $Date: 2004/11/24 02:35:29 $ -->" print"<!-- $Author: noel $ --... |
print " $Revision: 1.47 $" print " $Date: 2006/10/24 20:19:42 $" | print " $Revision: 1.48 $" print " $Date: 2006/11/04 23:20:10 $" | def showVersion(): print print "RCS" print " $Revision: 1.47 $" print " $Date: 2006/10/24 20:19:42 $" print " $Author: noel $" print |
print divName(linein) if (silentdiv == 0): print "<ol>" | if (lineLevel != find(linein,"!") +1): print divName(linein) if (silentdiv == 0): print "<ol>" | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div, silentdiv if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increa... |
elif (find(linein,"!!!") +1 ): | elif (lineLevel == find(linein,"!!!") +1 ): | def processLine(linein): global level, formatMode, slides, hideComments, inBodyText, styleSheet, inlineStyle, div, silentdiv if (lstrip(linein) == ""): return linein = beautifyLine(linein) lineLevel = getLineLevel(linein) if ((hideComments == 0) or (lineLevel != (find(linein,"[")+1))): if (lineLevel > level): # increa... |
print"<!-- $Revision: 1.47 $ -->" print"<!-- $Date: 2006/10/24 20:19:42 $ -->" | print"<!-- $Revision: 1.48 $ -->" print"<!-- $Date: 2006/11/04 23:20:10 $ -->" | def printHeader(linein): global styleSheet, inlineStyle print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" print "<html><head><title>" + getTitleText(linein) + "</title>" print"<!-- $Revision: 1.47 $ -->" print"<!-- $Date: 2006/10/24 20:19:42 $ -->" pri... |
fd.write("<a href=\"http://www.cinsk.org/sw/pyprof/\"><img\n"); | fd.write("<a href=\"http://www.cinsk.org/sw/pyprofgen/\"><img\n"); | def pyprofgen_footer(fd): datestr = time.ctime(time.time()); fd.write("<hr size=\"1\">\n"); fd.write("<address style=\"align: right;\">\n"); fd.write("<small>Generated on %s for " % datestr); fd.write("<strong>%s</strong> by \n" % EXE_FILE); fd.write("<a href=\"http://www.cinsk.org/sw/pyprof/\"><img\n"); fd.write(... |
def tmp_name(prefix = "/tmp/pyprofgen-"): return "%s%u-%f" % (prefix, os.getpid(), time.time()); | def debug(msg): global debug_mode; if debug_mode: sys.stdout.write("debug: %s\n" % msg); sys.stdout.flush(); | |
class GrabberException(Exception): def __init__(self, value): self.value = value; def __str__(self): return repr(self.value); class Grabber: def __init__(self, cmdline, datafile): self.cmdline = ""; self.retcode = 0; self.fname = datafile; debug("Grabber: calls popen2.Popen3(%s)" % cmdline); self.opener = popen2.Popen... | def msg_out(msg): global verbose_mode; if verbose_mode: sys.stdout.write(msg); sys.stdout.flush(); def init(): global PPG_LIB_DIR, LOGO_FILE, CSS_FILE; PPG_LIB_DIR = "%s/share/pyprofgen-%s" % (PREFIX, pyprofgen_version) if not os.path.exists(PPG_LIB_DIR): debug("sanity check: %s not found" % PPG_LIB_DIR); PPG_LIB_DI... | def error(fin, msg): sys.stdout.flush(); sys.stderr.write("error: "); sys.stderr.write(msg); sys.stderr.write("\n"); sys.stderr.flush(); if fin: sys.exit(fin); |
class GrabberException(Exception): def __init__(self, value): self.value = value; def __str__(self): return repr(self.value); class Grabber: def __init__(self, cmdline, datafile): self.cmdline = ""; self.retcode = 0; self.fname = datafile; debug("Grabber: calls popen2.Popen3(%s)" % cmdline); self.opener = popen2.Popen... | def execute(cmdline, error_msg = ""): global verbose_mode; fin, fout, ferr = os.popen3(cmdline); fin.close(); errmsg = ferr.readline(); if errmsg: if verbose_mode: error(0, errmsg); if verbose_mode: error(0, "cannot execute \"%s\"" % cmdline); if error_msg: error(1, error_msg); else: sys.exit(1); ferr.close(); return f... | |
self.lineno = self.lineno + 1; if not line: break; if self.lineno >= 5: | if re.compile("^[ ]*time[ ]+second").match(line): | def eatup_header(self): # Eat first 5 lines from the output. while True: line = self.flat.file.readline(); self.lineno = self.lineno + 1; if not line: break; if self.lineno >= 5: break; |
opts, arg = getopt.getopt(sys.argv[1:], "d:qhv", \ ["help", "directory=", "quiet", "version" \ | opts, arg = getopt.getopt(sys.argv[1:], "d:qhvD", \ ["help", "directory=", "quiet", "version", \ | def main(): global verbose_mode, document_dir; global MON_FILE, EXE_FILE; try: opts, arg = getopt.getopt(sys.argv[1:], "d:qhv", \ ["help", "directory=", "quiet", "version" \ "debug"]); except getopt.GetoptError: usage(); sys.exit(1); for o, a in opts: if o in ("-v", "--version"): version(); sys.exit(0); if o in ("-h", ... |
if o == "--debug": | if o in ("-D", "--debug"): | def main(): global verbose_mode, document_dir; global MON_FILE, EXE_FILE; try: opts, arg = getopt.getopt(sys.argv[1:], "d:qhv", \ ["help", "directory=", "quiet", "version" \ "debug"]); except getopt.GetoptError: usage(); sys.exit(1); for o, a in opts: if o in ("-v", "--version"): version(); sys.exit(0); if o in ("-h", ... |
msg_out("pyprofgen version %s \n" % pyprofgen_version) | #def dummy(): # generate msg_out("pyprofgen version %s \n" % pyprofgen_version) cbuilder = cgraph_builder(EXE_FILE, MON_FILE); cbuilder.parse_cgraph(); cbuilder.build_misc_files(MISC_DIR); cbuilder.build_img_files(HTML_DIR, MISC_DIR); cbuilder.build_html_files(HTML_DIR, MISC_DIR) fbuilder = fgraph_builder(EXE_FILE, ... | |
values=converter.values where, wvals=cls._processWhere(conn, args, fieldData) | where, values=cls._processWhere(conn, args, fieldData, converter) | def updateSome(cls, adict, *args, **fieldData): """update possibly many records at once, and return the number updated""" if not cls.mutable: raise ValueError, "class isn't mutable!" # N.B. it *is* possible to use this method without a unique index if not adict: # vacuous update, just return return cls._validateFields(... |
values+=wvals | def updateSome(cls, adict, *args, **fieldData): """update possibly many records at once, and return the number updated""" if not cls.mutable: raise ValueError, "class isn't mutable!" # N.B. it *is* possible to use this method without a unique index if not adict: # vacuous update, just return return cls._validateFields(... | |
def _processWhere(conn, args, fieldData): | def _processWhere(conn, args, fieldData, converter=None): | def _processWhere(conn, args, fieldData): if args and isinstance(args[0], basestring): if fieldData: raise ValueError, "cannot pass keyword args when including sql string" sql=args[0] values=args[1:] |
converter=conn.getConverter() | def _processWhere(conn, args, fieldData): if args and isinstance(args[0], basestring): if fieldData: raise ValueError, "cannot pass keyword args when including sql string" sql=args[0] values=args[1:] | |
andValues.append(EQ(FIELD(k), v, converter=converter)) | andValues.append(EQ(FIELD(k), v)) | def _processWhere(conn, args, fieldData): if args and isinstance(args[0], basestring): if fieldData: raise ValueError, "cannot pass keyword args when including sql string" sql=args[0] values=args[1:] |
converter.reset() | if converter is None: converter=conn.getConverter() | def _processWhere(conn, args, fieldData): if args and isinstance(args[0], basestring): if fieldData: raise ValueError, "cannot pass keyword args when including sql string" sql=args[0] values=args[1:] |
wheresql, wherevals=self._processWhere(conn, whereArgs, extra) | converter=conn.getConverter() wheresql, wherevals=self._processWhere(conn, whereArgs, extra, converter=converter) | def joinTable(self, thisAttrNames, pivotTable, thisSideColumns, thatSideColumns, thatObject, thatAttrNames, *whereArgs, **extra): |
wherevals, | converter, | def joinTable(self, thisAttrNames, pivotTable, thisSideColumns, thatSideColumns, thatObject, thatAttrNames, *whereArgs, **extra): |
wherevals, | converter, | def _joinTableSQL(self, conn, thisAttrNames, pivotTable, thisSideColumns, thatSideColumns, thatObject, thatAttrNames, extraTables, wheresql, wherevals, order, limit, offset): """SQL generating function for joinTable""" if extraTables is None: extraTables=[] |
converter=conn.getConverter() | def _joinTableSQL(self, conn, thisAttrNames, pivotTable, thisSideColumns, thatSideColumns, thatObject, thatAttrNames, extraTables, wheresql, wherevals, order, limit, offset): """SQL generating function for joinTable""" if extraTables is None: extraTables=[] | |
if wherevals: vals=vals+wherevals | def _joinTableSQL(self, conn, thisAttrNames, pivotTable, thisSideColumns, thatSideColumns, thatObject, thatAttrNames, extraTables, wheresql, wherevals, order, limit, offset): """SQL generating function for joinTable""" if extraTables is None: extraTables=[] | |
self.__dict__.update(kw) | self.__dict__=self.mash() | def mergeDefaults(self, *dicts, **kw): """ passed either a dictionary (or multiple dictionaries, which will be evaluated in order) or keyword arguments, will fold the key/value pairs therein into the dictionary of defaults without deleting any values that already exist there. Equivalent to: newDict.update(defaultDict) ... |
concat='%s/%s' % (root, path) norm=_normpath(concat) if norm < root: | if not path: | def _fixPath(root, path): ## some insurance that we don't escape a given root concat='%s/%s' % (root, path) norm=_normpath(concat) if norm < root: # trying to escape root, return root return root return norm |
return norm | if not path.startswith('/'): path='/%s' % path path=normpath(path) return normpath('%s%s' % (root, path)) | def _fixPath(root, path): ## some insurance that we don't escape a given root concat='%s/%s' % (root, path) norm=_normpath(concat) if norm < root: # trying to escape root, return root return root return norm |
self.conn = getConnection(connectArgs) | self.conn = getConnection(connectArgs[0]) | def __init__(self, connectArgs): newConnStr = '' connectArgs = string.split(connectArgs,':') |
values=converter.values where, wvals=self._uniqueWhere(conn, self) values+=wvals | where, values=self._uniqueWhere(conn, self, converter) | def _update_raw(self, adict): """update self in database with the values in adict""" |
def _uniqueWhere(cls, conn, kw): | def _uniqueWhere(cls, conn, kw, converter=None): | def _uniqueWhere(cls, conn, kw): """given a connection and kw, using _matchUnique, generate a where clause to select a unique row. """ unique = cls._matchUnique(kw) if not unique: raise ValueError, 'No way to get unique row! %s %s' % \ (str(kw), unique) converter=conn.getConverter() if len(unique)==1: u=tuple(unique)[0... |
converter=conn.getConverter() | if converter is None: converter=conn.getConverter() | def _uniqueWhere(cls, conn, kw): """given a connection and kw, using _matchUnique, generate a where clause to select a unique row. """ unique = cls._matchUnique(kw) if not unique: raise ValueError, 'No way to get unique row! %s %s' % \ (str(kw), unique) converter=conn.getConverter() if len(unique)==1: u=tuple(unique)[0... |
c.execute(sql, values) | if values: c.execute(sql, values) else: c.execute(sql) | def iterfetch(resultSpec, sqlTemplate, *values, **kwargs): """ a method that executes sql and returns rows of tuples of PyDO objects and scalar values, ordered according to a result set specification. resultSpec is a list that may contain: * PyDO classes; * 2-tuples of (PyDO class, alias string), which indicate that... |
c.execute('drop table c') self.db.commit() | try: c.execute('drop table c') except: pass else: self.db.commit() | def post(self): self.db.autocommit=False c=self.db.cursor() c.execute('drop table c') self.db.commit() |
return concat | return root | def _fixPath(root, path): ## some insurance that we don't escape a given root concat='%s/%s' % (root, path) norm=_normpath(concat) if norm < root: # trying to escape root, return un-normpathed thing return concat return norm |
conn=self.getDB() converter=conn.converter | conn=self.getDBI() converter=conn.getConverter() | def getMany(self, *args, **kwargs): if isinstance(kls, basestring): # resolve it to a class realkls=string_to_obj(kls) else: realkls=kls eq=[EQ(FIELD(x), self[y]) for x, y in zipped] if args and isinstance(args[0], basestring): # combining a string requires awkward special casing... conn=self.getDB() converter=conn.con... |
L = [int(i) for i in row[0].split(' ')] | L=[int(i) for i in row[0].split(' ')] if [x for x in L if x < 0]: if self.verbose: debug("skipping constraint with system columns: %s" % row[0]) continue | def describeTable(self, table, schema=None): # verify that the table exists sql = """ SELECT t.tablename AS tname FROM pg_catalog.pg_tables t WHERE t.tablename=%s AND t.schemaname=%s UNION SELECT v.viewname AS tname FROM pg_catalog.pg_views v WHERE v.viewname=%s and v.schemaname=%s """ if schema is None: schema='public... |
where, wvals=self._processWhere(conn, args, fieldData) | where, wvals=cls._processWhere(conn, args, fieldData) | def updateSome(cls, adict, *args, **fieldData): """update possibly many records at once, and return the number updated""" if not cls.mutable: raise ValueError, "class isn't mutable!" # N.B. it *is* possible to use this method without a unique index if not adict: # vacuous update, just return return cls._validateFields(... |
unique = cls._matchUnique(fieldData) | def getUnique(cls, **fieldData): """ Retrieve one particular instance of this class. Given the attribute/value pairs in fieldData, retrieve a unique row and return a data class instance representing said row or None if no row was retrieved. """ cls._validateFields(fieldData) unique = cls._matchUnique(fieldData) conn =... | |
@classmethod def _processWhere(cls, conn, args, fieldData): | @staticmethod def _processWhere(conn, args, fieldData): | def _baseSelect(cls, qualified=False): """returns the beginning of a select statement for this object's table.""" return 'SELECT %s FROM %s' % (', '.join(cls.getColumns(qualified)), cls.table) |
def __init__(self, name, compname, comptype=None, cache=NO, **kw): | def __init__(self, name, compname, comptype=None, cache=computils.NO, **kw): | def __init__(self, name, compname, comptype=None, cache=NO, **kw): Slot.__init__(self, name) self.compname=relpath(compname) if comptype is None: self.comptype=guess_comptype(compname) self.cache=cache self.extra=kw |
thatObject.table, | thatObject.getTable(), | def _joinTableSQL(self, conn, thisAttrNames, pivotTable, thisSideColumns, thatSideColumns, thatObject, thatAttrNames, extraTables, wheresql, wherevals, order, limit, offset): """SQL generating function for joinTable""" if extraTables is None: extraTables=[] |
mapper = cls.sequence_mapper or cls.getDBI().sequence_mapper return mapper(cls.table, field) | mapper = cls.sequence_mapper or getattr(cls.getDBI(), 'sequence_mapper', None) if mapper: return mapper(cls.table, field) | def _sequence_for(cls, field): mapper = cls.sequence_mapper or cls.getDBI().sequence_mapper return mapper(cls.table, field) |
s=', '.join(["%s: %s" % (get_identifier(k), to_js(v)) \ | s=', '.join(["%s: %s" % (to_js(k), to_js(v)) \ | def _dict_to_js(d): s=', '.join(["%s: %s" % (get_identifier(k), to_js(v)) \ for k, v in d.items()]) return "{%s}" % s |
('Amerian Samoa', 'AS'), | ('American Samoa', 'AS'), | def validate(self, form=None): errorlist = [] if not self._address1.value and not self._address2.value: # at least one address line must be filled out s='Please enter at least one line of address information.' errorlist.append(FormErrorMessage(self,s )) if not self._city.value: errorlist.append(FormErrorMessage(self, '... |
import skunklib.normheader as _fixheader | def getvalue(self): return '' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.