jtoolkit-cvs Mailing List for jToolkit (Page 3)
Brought to you by:
davidfraser,
friedelwolff
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(15) |
Oct
(12) |
Nov
|
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(100) |
Mar
(27) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dav...@us...> - 2004-02-10 09:00:56
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23855 Modified Files: chart.py Log Message: Added sensible sizing for our chart images Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** chart.py 10 Feb 2004 08:56:46 -0000 1.10 --- chart.py 10 Feb 2004 08:57:44 -0000 1.11 *************** *** 27,36 **** self.dpi = 50 - self.figure = new_figure_manager(1,(8,6),72) - self.options = {} self.content_type = 'image/png' widgets.PlainContents.__init__(self, []) self.getdata() def getdata(self): --- 27,36 ---- self.dpi = 50 self.options = {} self.content_type = 'image/png' widgets.PlainContents.__init__(self, []) self.getdata() + self.sizeimage() + self.figure = new_figure_manager(1,(self.im_width,self.im_height),self.dpi) def getdata(self): *************** *** 43,46 **** --- 43,51 ---- return '' + def sizeimage(self): + """Subclasses of this should implement this uniquely""" + self.im_width = 8 + self.im_height = 6 + def option(self, **args): # Save option values in the object's dictionary. *************** *** 84,90 **** chartdata = self.charttable.gettablerows(self.filter) if self.xstorageformat == 'DATETIME': ! self.xdata = [dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata] else: ! self.xdata = [str(row[self.xcolumn]) for row in chartdata] self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] --- 89,95 ---- chartdata = self.charttable.gettablerows(self.filter) if self.xstorageformat == 'DATETIME': ! self.xdata = array([dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata]) else: ! self.xdata = array([str(row[self.xcolumn]) for row in chartdata]) self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] *************** *** 106,112 **** self.figure.get_current_axis().set_ylim([math.floor(ymin),math.ceil(ymax)]) #Set the x labels ! set(self.figure.get_current_axis(), 'xticks', arange(len(self.xdata))) ! set(self.figure.get_current_axis(), 'xticklabels', self.xdata) #Plot each dataset --- 111,121 ---- self.figure.get_current_axis().set_ylim([math.floor(ymin),math.ceil(ymax)]) + #Calculate number of x labels to use - 1 per self.im_width + numLabels = self.im_width-2 + sliceNum = len(self.xdata)/numLabels + #Set the x labels ! self.figure.get_current_axis().set_xticks(arange(len(self.xdata),step=sliceNum)) ! self.figure.get_current_axis().set_xticklabels(self.xdata[:1]+self.xdata[::sliceNum]+self.xdata[-1:],rotation='vertical') #Plot each dataset *************** *** 145,151 **** self.figure.get_current_axis().set_xlim([0,len(self.xdata)+1]) self.figure.get_current_axis().set_ylim([math.floor(ymin),math.ceil(ymax)]) ! set(self.figure.get_current_axis(),'xticks',arange(len(self.xdata))+0.25) ! set(self.figure.get_current_axis(),'xticklabels',self.xdata) self.figure.get_current_axis().bar(arange(len(self.xdata)),self.ydata[0],0.5,color=self.colours) --- 154,165 ---- self.figure.get_current_axis().set_xlim([0,len(self.xdata)+1]) self.figure.get_current_axis().set_ylim([math.floor(ymin),math.ceil(ymax)]) ! self.figure.get_current_axis().set_xticks(arange(len(self.xdata))+0.25) ! self.figure.get_current_axis().set_xticklabels(self.xdata,rotation='vertical') self.figure.get_current_axis().bar(arange(len(self.xdata)),self.ydata[0],0.5,color=self.colours) + def sizeimage(self): + self.im_width = len(self.xdata)*2 + 2 + self.im_height = 8 #This should take tagname length into account + + \ No newline at end of file |
From: <dav...@us...> - 2004-02-10 08:59:59
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23519 Modified Files: chart.py Log Message: Changed to use matplotlib instead of gdchart Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** chart.py 10 Feb 2004 08:29:40 -0000 1.9 --- chart.py 10 Feb 2004 08:56:46 -0000 1.10 *************** *** 3,15 **** # per object. ! import gdchart ! import cStringIO from jToolkit.widgets import widgets from jToolkit.data import dates - # Save the default option values in a module-level dictionary. This way, each - # new instance of the Chart class can begin life with its own copy of the - # default option values. - gdchart.defaults = gdchart.option() #We need this lock for gdchart, as it's not thread-safe --- 3,11 ---- # per object. ! from matplotlib.matlab import * ! import cStringIO, tempfile, os, math from jToolkit.widgets import widgets from jToolkit.data import dates #We need this lock for gdchart, as it's not thread-safe *************** *** 17,20 **** --- 13,20 ---- gdchartLock = Lock() + #Graph type constants + LINE_CHART = 0 + BAR_CHART = 1 + # This class is just a container for option values. class Chart(widgets.PlainContents): *************** *** 23,31 **** self.filter = filter if not hasattr(self, 'chartType'): ! self.chartType = gdchart.GDC_LINE ! if not hasattr(self, 'chartSize'): ! self.chartSize = (250,250) ! # Get a copy of the default options ! self.options = gdchart.defaults.copy() self.content_type = 'image/png' widgets.PlainContents.__init__(self, []) --- 23,33 ---- self.filter = filter if not hasattr(self, 'chartType'): ! self.chartType = LINE_CHART ! if not hasattr(self, 'dpi'): ! self.dpi = 50 ! ! self.figure = new_figure_manager(1,(8,6),72) ! ! self.options = {} self.content_type = 'image/png' widgets.PlainContents.__init__(self, []) *************** *** 37,40 **** --- 39,46 ---- self.ydata = [] + def getimage(self): + """Subclasses of this should implement this uniquely""" + return '' + def option(self, **args): # Save option values in the object's dictionary. *************** *** 44,56 **** # Put options into effect. Derived class implementations of draw() # should call this method before calling gdchart.chart(). ! apply(gdchart.option, (), self.options) def gethtml(self): gdchartLock.acquire() self.draw() ! tempfile = cStringIO.StringIO() ! gdchart.chart(self.chartType, self.chartSize, tempfile, self.xdata, *self.ydata) gdchartLock.release() ! return tempfile.getvalue() class LineChart(Chart): --- 50,75 ---- # Put options into effect. Derived class implementations of draw() # should call this method before calling gdchart.chart(). ! for key in self.options.keys(): ! set(self.figure.get_current_axis(),key,self.options[key]) ! ! def getimagefromtempfile(self): ! #Save temporary file ! # tempfilename = os.path.join(tempfile.gettempdir(),'temp.png') ! tempfilename = 'temp.png' ! self.figure.figure.print_figure(tempfilename,self.dpi) ! ! #Read and report ! f = open(tempfilename,'rb') ! img = f.read() ! f.close() ! return img def gethtml(self): gdchartLock.acquire() self.draw() ! self.drawimage() ! img = self.getimagefromtempfile() gdchartLock.release() ! return img class LineChart(Chart): *************** *** 70,80 **** self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] class CurrentValueLegendChart(Chart): """This class creates a bar chart which acts as a legend and a current value reporter""" def __init__(self, charttable, xcolumns, colours, filter=None): self.xcolumns = xcolumns ! self.chartType = gdchart.GDC_BAR Chart.__init__(self, charttable, filter) ! self.option(ext_color=colours,ylabel_density=10,title="Legend") def getdata(self): --- 89,129 ---- self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] + def drawimage(self): + #For now, x axis will be evenly spaced + #TODO: x axis spacing should be according to time + + #Set the min/max of each axis + ymin = sys.maxint + ymax = -sys.maxint+1 + for dataset in self.ydata: + for value in dataset: + if value < ymin: + ymin = value + if value > ymax: + ymax = value + + self.figure.get_current_axis().set_xlim([0,len(self.xdata)+1]) + self.figure.get_current_axis().set_ylim([math.floor(ymin),math.ceil(ymax)]) + + #Set the x labels + set(self.figure.get_current_axis(), 'xticks', arange(len(self.xdata))) + set(self.figure.get_current_axis(), 'xticklabels', self.xdata) + + #Plot each dataset + for dataset in self.ydata: + self.figure.get_current_axis().plot(dataset) + + class CurrentValueLegendChart(Chart): """This class creates a bar chart which acts as a legend and a current value reporter""" def __init__(self, charttable, xcolumns, colours, filter=None): self.xcolumns = xcolumns ! self.chartType = BAR_CHART Chart.__init__(self, charttable, filter) ! ! #Turn colours into an array exactly len(self.xcolumns) long ! repeatcolours = len(self.xcolumns) / len(colours) ! endcolours = len(self.xcolumns) % len(colours) ! self.colours = colours*repeatcolours + colours[:endcolours] def getdata(self): *************** *** 84,86 **** self.ydata = [[finalrow[xcolumn] for xcolumn in self.xcolumns]] ! \ No newline at end of file --- 133,151 ---- self.ydata = [[finalrow[xcolumn] for xcolumn in self.xcolumns]] ! def drawimage(self): ! #Set the min/max of each axis ! ymin = sys.maxint ! ymax = -sys.maxint+1 ! for value in self.ydata[0]: ! if value < ymin: ! ymin = value ! if value > ymax: ! ymax = value ! ! self.figure.get_current_axis().set_xlim([0,len(self.xdata)+1]) ! self.figure.get_current_axis().set_ylim([math.floor(ymin),math.ceil(ymax)]) ! set(self.figure.get_current_axis(),'xticks',arange(len(self.xdata))+0.25) ! set(self.figure.get_current_axis(),'xticklabels',self.xdata) ! ! self.figure.get_current_axis().bar(arange(len(self.xdata)),self.ydata[0],0.5,color=self.colours) ! |
From: <dav...@us...> - 2004-02-10 08:42:35
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20623 Modified Files: widgets.py Log Message: made spaces in Links get escaped (otherwise Netscape 1.4 ignores the rest of the URL) Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** widgets.py 10 Feb 2004 08:34:45 -0000 1.18 --- widgets.py 10 Feb 2004 08:39:22 -0000 1.19 *************** *** 203,206 **** --- 203,210 ---- self.overrideattribs(newattribs) + def escape(self, s, quote=None): + """Replace special characters &, <, >, add and handle quotes if asked""" + return ContentWidget.escape(self, s, quote).replace(" ", "%20") + class Tooltip(ContentWidget): def __init__(self, tooltip, contents, newattribs={}): |
From: <dav...@us...> - 2004-02-10 08:37:56
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19803 Modified Files: widgets.py Log Message: added id parameter to Division Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** widgets.py 10 Feb 2004 08:34:01 -0000 1.17 --- widgets.py 10 Feb 2004 08:34:45 -0000 1.18 *************** *** 357,363 **** class Division(ContentWidget): """an html div tag""" ! def __init__(self, contents=[], newattribs={}): """constructs the div tag""" ! ContentWidget.__init__(self, 'div', contents, newattribs) def getrgb(color, default = '&H808080'): --- 357,366 ---- class Division(ContentWidget): """an html div tag""" ! def __init__(self, contents=[], id=None, newattribs={}): """constructs the div tag""" ! ContentWidget.__init__(self, 'div', contents) ! if id is not None: ! self.attribs = {'id':id} ! self.overrideattribs(newattribs) def getrgb(color, default = '&H808080'): |
From: <dav...@us...> - 2004-02-10 08:37:12
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19659 Modified Files: widgets.py Log Message: added a print stylesheet link, TODO about improving the stylesheet linking system Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** widgets.py 10 Feb 2004 08:23:53 -0000 1.16 --- widgets.py 10 Feb 2004 08:34:01 -0000 1.17 *************** *** 261,264 **** --- 261,265 ---- result += """<meta http-equiv="Refresh" content="%d; URL=%s">""" % (refresh, refreshurl) # stylesheet info + # TODO: provide a better way to link to stylesheets than the hardcoded stuff here... result += """ <LINK REL="stylesheet" TYPE="text/css" HREF="/css/default.css">""" *************** *** 269,272 **** --- 270,275 ---- result += """ <LINK REL="stylesheet" TYPE="text/css" HREF="%s">""" % linkscss + result += """ + <LINK REL="stylesheet" TYPE="text/css" HREF="/css/print.css" media="print">""" # base/target info if base != '' or target != '': result += """ |
From: <dav...@us...> - 2004-02-10 08:33:05
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18831 Modified Files: chart.py Log Message: Added lock to make gdchart usage thread-safe Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** chart.py 10 Feb 2004 08:27:40 -0000 1.8 --- chart.py 10 Feb 2004 08:29:40 -0000 1.9 *************** *** 13,16 **** --- 13,20 ---- gdchart.defaults = gdchart.option() + #We need this lock for gdchart, as it's not thread-safe + from threading import Lock + gdchartLock = Lock() + # This class is just a container for option values. class Chart(widgets.PlainContents): *************** *** 43,49 **** --- 47,55 ---- def gethtml(self): + gdchartLock.acquire() self.draw() tempfile = cStringIO.StringIO() gdchart.chart(self.chartType, self.chartSize, tempfile, self.xdata, *self.ydata) + gdchartLock.release() return tempfile.getvalue() |
From: <dav...@us...> - 2004-02-10 08:30:52
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18494 Modified Files: chart.py Log Message: Changed the y axis density and added a title to the legend Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** chart.py 10 Feb 2004 08:25:21 -0000 1.7 --- chart.py 10 Feb 2004 08:27:40 -0000 1.8 *************** *** 70,74 **** self.chartType = gdchart.GDC_BAR Chart.__init__(self, charttable, filter) ! self.option(ext_color=colours) def getdata(self): --- 70,74 ---- self.chartType = gdchart.GDC_BAR Chart.__init__(self, charttable, filter) ! self.option(ext_color=colours,ylabel_density=10,title="Legend") def getdata(self): *************** *** 78,81 **** self.ydata = [[finalrow[xcolumn] for xcolumn in self.xcolumns]] - \ No newline at end of file --- 78,80 ---- |
From: <dav...@us...> - 2004-02-10 08:28:31
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18082 Modified Files: chart.py Log Message: Tweaked the chart separation. Created a legend chart from a bar chart Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** chart.py 10 Feb 2004 08:24:56 -0000 1.6 --- chart.py 10 Feb 2004 08:25:21 -0000 1.7 *************** *** 15,26 **** # This class is just a container for option values. class Chart(widgets.PlainContents): ! def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay='', filter=None): self.charttable = charttable - self.chartType = gdchart.GDC_LINE - self.xcolumn = xcolumn - self.ycolumns = ycolumns - self.xstorageformat = xstorageformat - self.xdisplay = xdisplay self.filter = filter if not hasattr(self, 'chartSize'): self.chartSize = (250,250) --- 15,23 ---- # This class is just a container for option values. class Chart(widgets.PlainContents): ! def __init__(self, charttable, filter=None): self.charttable = charttable self.filter = filter + if not hasattr(self, 'chartType'): + self.chartType = gdchart.GDC_LINE if not hasattr(self, 'chartSize'): self.chartSize = (250,250) *************** *** 53,57 **** class LineChart(Chart): def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay='', filter=None): ! Chart.__init__(self, charttable, xcolumn, ycolumns, xstorageformat, xdisplay, filter) def getdata(self): --- 50,58 ---- class LineChart(Chart): def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay='', filter=None): ! self.xcolumn = xcolumn ! self.ycolumns = ycolumns ! self.xstorageformat = xstorageformat ! self.xdisplay = xdisplay ! Chart.__init__(self, charttable, filter) def getdata(self): *************** *** 63,64 **** --- 64,81 ---- self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] + class CurrentValueLegendChart(Chart): + """This class creates a bar chart which acts as a legend and a current value reporter""" + def __init__(self, charttable, xcolumns, colours, filter=None): + self.xcolumns = xcolumns + self.chartType = gdchart.GDC_BAR + Chart.__init__(self, charttable, filter) + self.option(ext_color=colours) + + def getdata(self): + self.xdata = [str(xcolumn) for xcolumn in self.xcolumns] + chartdata = self.charttable.gettablerows(self.filter) + finalrow = chartdata[len(chartdata)-1] + self.ydata = [[finalrow[xcolumn] for xcolumn in self.xcolumns]] + + + \ No newline at end of file |
From: <dav...@us...> - 2004-02-10 08:28:09
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17992 Modified Files: chart.py Log Message: Factored LineChart out from Chart so we can easily create different chart types Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** chart.py 10 Feb 2004 08:24:30 -0000 1.5 --- chart.py 10 Feb 2004 08:24:56 -0000 1.6 *************** *** 14,20 **** # This class is just a container for option values. ! class SimpleChart(widgets.PlainContents): def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay='', filter=None): self.charttable = charttable self.xcolumn = xcolumn self.ycolumns = ycolumns --- 14,21 ---- # This class is just a container for option values. ! class Chart(widgets.PlainContents): def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay='', filter=None): self.charttable = charttable + self.chartType = gdchart.GDC_LINE self.xcolumn = xcolumn self.ycolumns = ycolumns *************** *** 31,40 **** def getdata(self): ! chartdata = self.charttable.gettablerows(self.filter) ! if self.xstorageformat == 'DATETIME': ! self.xdata = [dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata] ! else: ! self.xdata = [str(row[self.xcolumn]) for row in chartdata] ! self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] def option(self, **args): --- 32,38 ---- def getdata(self): ! """Subclasses of this should implement this uniquely""" ! self.xdata = [] ! self.ydata = [] def option(self, **args): *************** *** 50,54 **** self.draw() tempfile = cStringIO.StringIO() ! gdchart.chart(gdchart.GDC_LINE, self.chartSize, tempfile, self.xdata, *self.ydata) return tempfile.getvalue() --- 48,64 ---- self.draw() tempfile = cStringIO.StringIO() ! gdchart.chart(self.chartType, self.chartSize, tempfile, self.xdata, *self.ydata) return tempfile.getvalue() + class LineChart(Chart): + def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay='', filter=None): + Chart.__init__(self, charttable, xcolumn, ycolumns, xstorageformat, xdisplay, filter) + + def getdata(self): + chartdata = self.charttable.gettablerows(self.filter) + if self.xstorageformat == 'DATETIME': + self.xdata = [dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata] + else: + self.xdata = [str(row[self.xcolumn]) for row in chartdata] + self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] + |
From: <dav...@us...> - 2004-02-10 08:27:40
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17940 Modified Files: chart.py Log Message: Removed example which wouldn't have worked Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** chart.py 10 Feb 2004 07:52:56 -0000 1.4 --- chart.py 10 Feb 2004 08:24:30 -0000 1.5 *************** *** 53,76 **** return tempfile.getvalue() - if __name__ == '__main__': - # An example derived class. - class PieChart(Chart): - def __init__(self): - Chart.__init__(self) - - def draw(self, size, file, labels, *data): - Chart.draw(self) - args = (gdchart.GDC_3DPIE, size, file, labels) + data - apply(gdchart.chart, args) - - c = PieChart() - c.option(pie_color=(0xff8080, 0x80ff80, 0x8080ff, 0xffff80, 0xff80ff, 0x80ffff)) - c.option(edge_color=0x0, line_color=0xffffff) - c.option(label_line=1) - c.option(explode=(0,0,0,0,0,15)) - c.option(title='Have Some Pie') - cities = ('Chicago', 'New York', 'L.A.', 'Atlanta', 'Paris, MD\n(USA)', 'London') - values = (1.9, 1.3, 1.2, 0.75, 0.1, 2.0) - c.draw((250, 250), 'pie.png', cities, values) - print 'See pie.png' - --- 53,54 ---- |
From: <dav...@us...> - 2004-02-10 08:27:04
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17789 Modified Files: widgets.py Log Message: reverting type->language patch see http://www.w3.org/TR/REC-html40/interact/scripts.html Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** widgets.py 10 Feb 2004 08:23:23 -0000 1.15 --- widgets.py 10 Feb 2004 08:23:53 -0000 1.16 *************** *** 332,336 **** contents = "\r<!--\r" + scripttext + "\r//-->\r" ContentWidget.__init__(self, "script", contents) ! self.attribs = {'language':language} self.overrideattribs(newattribs) --- 332,336 ---- contents = "\r<!--\r" + scripttext + "\r//-->\r" ContentWidget.__init__(self, "script", contents) ! self.attribs = {'type':language} self.overrideattribs(newattribs) |
From: <dav...@us...> - 2004-02-10 08:26:35
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17730 Modified Files: widgets.py Log Message: Changed script widget's set attribute for language from 'type' to 'language' Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** widgets.py 10 Feb 2004 08:11:59 -0000 1.14 --- widgets.py 10 Feb 2004 08:23:23 -0000 1.15 *************** *** 332,336 **** contents = "\r<!--\r" + scripttext + "\r//-->\r" ContentWidget.__init__(self, "script", contents) ! self.attribs = {'type':language} self.overrideattribs(newattribs) --- 332,336 ---- contents = "\r<!--\r" + scripttext + "\r//-->\r" ContentWidget.__init__(self, "script", contents) ! self.attribs = {'language':language} self.overrideattribs(newattribs) |
From: <dav...@us...> - 2004-02-10 08:15:14
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15855 Modified Files: widgets.py Log Message: Added capability to put extra widgets into a page header Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** widgets.py 10 Feb 2004 08:06:13 -0000 1.13 --- widgets.py 10 Feb 2004 08:11:59 -0000 1.14 *************** *** 225,230 **** class Page(ContentWidget): ! def __init__(self, title="", contents=[], newattribs={}, script=""): self.title = title self.script = PlainContents(script) ContentWidget.__init__(self, None, contents, newattribs) --- 225,231 ---- class Page(ContentWidget): ! def __init__(self, title="", contents=[], newattribs={}, script="", headerwidgets=[]): self.title = title + self.headerwidgets = headerwidgets self.script = PlainContents(script) ContentWidget.__init__(self, None, contents, newattribs) *************** *** 272,275 **** --- 273,278 ---- <BASE href="%s" target="%s">""" % (base, target) # any script required + for widget in self.headerwidgets: + result += widget.gethtml() result += self.script.gethtml() # finished the head |
From: <dav...@us...> - 2004-02-10 08:12:07
|
Update of /cvsroot/jtoolkit/jToolkit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15405 Modified Files: errors.py Log Message: added a ConsoleErrorHandler that uses stdout/stderr for traces/error messages Index: errors.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/errors.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** errors.py 9 Feb 2004 13:58:29 -0000 1.5 --- errors.py 10 Feb 2004 08:08:55 -0000 1.6 *************** *** 39,43 **** exc_info = sys.exc_info() return "\n".join(traceback.format_exception_only(exc_info[0], exc_info[1])) ! def writelog(self, filename, message): # Append a log to a field --- 39,43 ---- exc_info = sys.exc_info() return "\n".join(traceback.format_exception_only(exc_info[0], exc_info[1])) ! def writelog(self, filename, message): # Append a log to a field *************** *** 72,74 **** --- 72,100 ---- self.writelog(self.instance.auditfile,msg) + class ConsoleErrorHandler(ErrorHandler): + def __init__(self, errorfile=sys.stderr, tracefile=sys.stdout): + self.errorfile = errorfile + self.tracefile = tracefile + + def writelog(self, f, message): + f.write(time.strftime('%Y-%m-%d %H:%M:%S')+': ') + if type(message) == unicode: + f.write(message.encode('iso8859')) + else: + f.write(message) + f.write('\n') + f.flush() + + def logerror(self, message): + self.writelog(self.errorfile, message) + + def logtrace(self, message): + if self.tracefile is not None: + self.writelog(self.tracefile, message) + + def logtracewithtime(self, msg): + t = time.time() + ms = int((t - int(t))*1000.0) + if self.tracefile is not None: + self.writelog(self.tracefile, ".%03d: %s" % (ms, msg)) |
From: <dav...@us...> - 2004-02-10 08:10:14
|
Update of /cvsroot/jtoolkit/jToolkit/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15137 Modified Files: dbtable.py Log Message: made DBTable handle a columnlist in the constructor that has longer tuples than expected Index: dbtable.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/data/dbtable.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dbtable.py 9 Feb 2004 14:40:57 -0000 1.10 --- dbtable.py 10 Feb 2004 08:07:04 -0000 1.11 *************** *** 32,36 **** self.tablename = tablename self.columnlist = [column[0] for column in columnlist] ! self.columntypes = dict(columnlist) self.rowidcols = rowidcols if type(self.rowidcols) in (str, unicode): self.rowidcols = [self.rowidcols] --- 32,36 ---- self.tablename = tablename self.columnlist = [column[0] for column in columnlist] ! self.columntypes = dict([(column[0], column[1]) for column in columnlist]) self.rowidcols = rowidcols if type(self.rowidcols) in (str, unicode): self.rowidcols = [self.rowidcols] |
From: <dav...@us...> - 2004-02-10 08:09:29
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15036 Modified Files: widgets.py Log Message: Added ordered list widget Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** widgets.py 9 Feb 2004 14:42:30 -0000 1.12 --- widgets.py 10 Feb 2004 08:06:13 -0000 1.13 *************** *** 157,160 **** --- 157,164 ---- ContentWidget.__init__(self, "ul", contents, newattribs) + class OList(ContentWidget): + def __init__(self, contents, newattribs = {}): + ContentWidget.__init__(self, "ol", contents, newattribs) + class Option(ContentWidget): def __init__(self, value, description, selected=0): |
From: <dav...@us...> - 2004-02-10 07:56:09
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12733 Modified Files: chart.py Log Message: Added functionality to add a filter to the table query Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** chart.py 10 Feb 2004 07:50:11 -0000 1.3 --- chart.py 10 Feb 2004 07:52:56 -0000 1.4 *************** *** 15,19 **** # This class is just a container for option values. class SimpleChart(widgets.PlainContents): ! def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay=''): self.charttable = charttable self.xcolumn = xcolumn --- 15,19 ---- # This class is just a container for option values. class SimpleChart(widgets.PlainContents): ! def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay='', filter=None): self.charttable = charttable self.xcolumn = xcolumn *************** *** 21,24 **** --- 21,25 ---- self.xstorageformat = xstorageformat self.xdisplay = xdisplay + self.filter = filter if not hasattr(self, 'chartSize'): self.chartSize = (250,250) *************** *** 30,34 **** def getdata(self): ! chartdata = self.charttable.gettablerows() if self.xstorageformat == 'DATETIME': self.xdata = [dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata] --- 31,35 ---- def getdata(self): ! chartdata = self.charttable.gettablerows(self.filter) if self.xstorageformat == 'DATETIME': self.xdata = [dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata] |
From: <dav...@us...> - 2004-02-10 07:53:21
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12301 Modified Files: chart.py Log Message: Added capability to specify a datetime value for x axis Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** chart.py 10 Feb 2004 07:29:41 -0000 1.2 --- chart.py 10 Feb 2004 07:50:11 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- import cStringIO from jToolkit.widgets import widgets + from jToolkit.data import dates # Save the default option values in a module-level dictionary. This way, each *************** *** 14,21 **** # This class is just a container for option values. class SimpleChart(widgets.PlainContents): ! def __init__(self, charttable, xcolumn, ycolumns): self.charttable = charttable self.xcolumn = xcolumn self.ycolumns = ycolumns if not hasattr(self, 'chartSize'): self.chartSize = (250,250) --- 15,24 ---- # This class is just a container for option values. class SimpleChart(widgets.PlainContents): ! def __init__(self, charttable, xcolumn, ycolumns, xstorageformat='TEXT', xdisplay=''): self.charttable = charttable self.xcolumn = xcolumn self.ycolumns = ycolumns + self.xstorageformat = xstorageformat + self.xdisplay = xdisplay if not hasattr(self, 'chartSize'): self.chartSize = (250,250) *************** *** 28,32 **** def getdata(self): chartdata = self.charttable.gettablerows() ! self.xdata = [str(row[self.xcolumn]) for row in chartdata] self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] --- 31,38 ---- def getdata(self): chartdata = self.charttable.gettablerows() ! if self.xstorageformat == 'DATETIME': ! self.xdata = [dates.formatdate(row[self.xcolumn],self.xdisplay) for row in chartdata] ! else: ! self.xdata = [str(row[self.xcolumn]) for row in chartdata] self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] |
From: <dav...@us...> - 2004-02-10 07:33:08
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9288 Modified Files: chart.py Log Message: Added variable chart size Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** chart.py 10 Feb 2004 07:24:36 -0000 1.1 --- chart.py 10 Feb 2004 07:29:41 -0000 1.2 *************** *** 18,21 **** --- 18,23 ---- self.xcolumn = xcolumn self.ycolumns = ycolumns + if not hasattr(self, 'chartSize'): + self.chartSize = (250,250) # Get a copy of the default options self.options = gdchart.defaults.copy() *************** *** 41,45 **** self.draw() tempfile = cStringIO.StringIO() ! gdchart.chart(gdchart.GDC_LINE, (250, 250), tempfile, self.xdata, *self.ydata) return tempfile.getvalue() --- 43,47 ---- self.draw() tempfile = cStringIO.StringIO() ! gdchart.chart(gdchart.GDC_LINE, self.chartSize, tempfile, self.xdata, *self.ydata) return tempfile.getvalue() |
From: <dav...@us...> - 2004-02-10 07:27:56
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8577 Added Files: chart.py Log Message: New chart widget which creates and displays a PNG of a chart --- NEW FILE: chart.py --- # A simple wrapper class for the gdchart module. This code demonstrates one # way to keep separate dictionaries of option values, in this case, one copy # per object. import gdchart import cStringIO from jToolkit.widgets import widgets # Save the default option values in a module-level dictionary. This way, each # new instance of the Chart class can begin life with its own copy of the # default option values. gdchart.defaults = gdchart.option() # This class is just a container for option values. class SimpleChart(widgets.PlainContents): def __init__(self, charttable, xcolumn, ycolumns): self.charttable = charttable self.xcolumn = xcolumn self.ycolumns = ycolumns # Get a copy of the default options self.options = gdchart.defaults.copy() self.content_type = 'image/png' widgets.PlainContents.__init__(self, []) self.getdata() def getdata(self): chartdata = self.charttable.gettablerows() self.xdata = [str(row[self.xcolumn]) for row in chartdata] self.ydata = [[row[ycolumn] for row in chartdata] for ycolumn in self.ycolumns] def option(self, **args): # Save option values in the object's dictionary. self.options.update(args) def draw(self): # Put options into effect. Derived class implementations of draw() # should call this method before calling gdchart.chart(). apply(gdchart.option, (), self.options) def gethtml(self): self.draw() tempfile = cStringIO.StringIO() gdchart.chart(gdchart.GDC_LINE, (250, 250), tempfile, self.xdata, *self.ydata) return tempfile.getvalue() if __name__ == '__main__': # An example derived class. class PieChart(Chart): def __init__(self): Chart.__init__(self) def draw(self, size, file, labels, *data): Chart.draw(self) args = (gdchart.GDC_3DPIE, size, file, labels) + data apply(gdchart.chart, args) c = PieChart() c.option(pie_color=(0xff8080, 0x80ff80, 0x8080ff, 0xffff80, 0xff80ff, 0x80ffff)) c.option(edge_color=0x0, line_color=0xffffff) c.option(label_line=1) c.option(explode=(0,0,0,0,0,15)) c.option(title='Have Some Pie') cities = ('Chicago', 'New York', 'L.A.', 'Atlanta', 'Paris, MD\n(USA)', 'London') values = (1.9, 1.3, 1.2, 0.75, 0.1, 2.0) c.draw((250, 250), 'pie.png', cities, values) print 'See pie.png' |
From: <dav...@us...> - 2004-02-09 14:45:46
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19690 Modified Files: widgets.py Log Message: widgets.Page 'script' argument can now accept a widgets.Script widget or a string Index: widgets.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/widgets.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** widgets.py 9 Feb 2004 14:22:41 -0000 1.11 --- widgets.py 9 Feb 2004 14:42:30 -0000 1.12 *************** *** 223,227 **** def __init__(self, title="", contents=[], newattribs={}, script=""): self.title = title ! self.script = script ContentWidget.__init__(self, None, contents, newattribs) --- 223,227 ---- def __init__(self, title="", contents=[], newattribs={}, script=""): self.title = title ! self.script = PlainContents(script) ContentWidget.__init__(self, None, contents, newattribs) *************** *** 268,272 **** <BASE href="%s" target="%s">""" % (base, target) # any script required ! result += self.script # finished the head result += """ --- 268,272 ---- <BASE href="%s" target="%s">""" % (base, target) # any script required ! result += self.script.gethtml() # finished the head result += """ |
From: <dav...@us...> - 2004-02-09 14:44:38
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19424 Modified Files: grid.py Log Message: Changes made to jToolkit for functionality jBrowser needs Index: grid.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/grid.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** grid.py 9 Feb 2004 14:34:54 -0000 1.8 --- grid.py 9 Feb 2004 14:41:25 -0000 1.9 *************** *** 172,177 **** class SimpleGridCategory(GridCategory): """a GridCategory that handles coloring...""" ! def __init__(self, name, title, tooltip, colnum, colordict, isheading, display): ! GridCategory.__init__(self, name, title, display=display, storageformat='TEXT', displayformat='', col=colnum, pctwidth=10, mergecells=0, mainarea=1) self.tooltip = tooltip --- 172,181 ---- class SimpleGridCategory(GridCategory): """a GridCategory that handles coloring...""" ! def __init__(self, name, title, tooltip, colnum, colordict, isheading, display, storageformat='TEXT'): ! if storageformat == 'DATETIME': ! displayformat = '%y-%m-%d %H:%M:%S' ! else: ! displayformat = '' ! GridCategory.__init__(self, name, title, display=display, storageformat=storageformat, displayformat=displayformat, col=colnum, pctwidth=10, mergecells=0, mainarea=1) self.tooltip = tooltip *************** *** 204,207 **** --- 208,212 ---- """simply returns a widget for this category""" obj = row[self.name] + obj = self.valuetostring(obj) if obj is None: text = '' *************** *** 253,257 **** isheading = name in self.headingcolumns display = name not in self.hidecolumns ! column = SimpleGridCategory(name, title, tooltip, colnum, colordict, isheading, display) columns.append(column) columndict[name] = column --- 258,263 ---- isheading = name in self.headingcolumns display = name not in self.hidecolumns ! storageformat = self.gridtable.columntypes.get(name, 'TEXT').upper() ! column = SimpleGridCategory(name, title, tooltip, colnum, colordict, isheading, display, storageformat) columns.append(column) columndict[name] = column |
From: <dav...@us...> - 2004-02-09 14:44:11
|
Update of /cvsroot/jtoolkit/jToolkit/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19292 Modified Files: database.py dbtable.py Log Message: Changes made to jToolkit for functionality jBrowser needs Index: database.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/data/database.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** database.py 9 Feb 2004 14:36:09 -0000 1.19 --- database.py 9 Feb 2004 14:40:57 -0000 1.20 *************** *** 206,210 **** self.db = self.driver.connect(None,database=self.instance.DBNAME,host=None, user=self.instance.DBUSER,password=self.instance.DBPASSWORD,provider=self.instance.DBPROVIDER) ! elif self.DBTYPE in 'sqlserver': self.errorhandler.logtrace('dblogin: dbname = %s, dbhost = %s, dbuser = %s' % \ (self.instance.DBNAME, self.instance.DBHOST, self.instance.DBUSER)) --- 206,210 ---- self.db = self.driver.connect(None,database=self.instance.DBNAME,host=None, user=self.instance.DBUSER,password=self.instance.DBPASSWORD,provider=self.instance.DBPROVIDER) ! elif self.DBTYPE == 'sqlserver': self.errorhandler.logtrace('dblogin: dbname = %s, dbhost = %s, dbuser = %s' % \ (self.instance.DBNAME, self.instance.DBHOST, self.instance.DBUSER)) Index: dbtable.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/data/dbtable.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dbtable.py 9 Feb 2004 14:11:12 -0000 1.9 --- dbtable.py 9 Feb 2004 14:40:57 -0000 1.10 *************** *** 26,33 **** """DBTable is an abstraction of a table and its related data""" def __init__(self, db, tablename, columnlist, rowidcols, orderbycols): ! """initialises the DBTable""" self.db = db self.tablename = tablename ! self.columnlist = columnlist self.rowidcols = rowidcols if type(self.rowidcols) in (str, unicode): self.rowidcols = [self.rowidcols] --- 26,36 ---- """DBTable is an abstraction of a table and its related data""" def __init__(self, db, tablename, columnlist, rowidcols, orderbycols): ! """initialises the DBTable ! columnlist is a list of (columnname, columntype) tuples ! rowidcols and orderbycols can either be a single column name string or a list of them""" self.db = db self.tablename = tablename ! self.columnlist = [column[0] for column in columnlist] ! self.columntypes = dict(columnlist) self.rowidcols = rowidcols if type(self.rowidcols) in (str, unicode): self.rowidcols = [self.rowidcols] *************** *** 72,78 **** return "" def getrecord(self, rowid): """retrieves the record corresponding to the given rowid""" ! sql = "select * from %s where %s" % (self.tablename, self.rowidclause(rowid)) record = self.db.singlerowdict(sql, self.db.lower) for key, value in record.iteritems(): --- 75,85 ---- return "" + def getsqlcolumns(self): + """returns the list of columns joined with commas (for sql statements)""" + return ", ".join(self.columnlist) + def getrecord(self, rowid): """retrieves the record corresponding to the given rowid""" ! sql = "select %s from %s where %s" % (self.getsqlcolumns(), self.tablename, self.rowidclause(rowid)) record = self.db.singlerowdict(sql, self.db.lower) for key, value in record.iteritems(): *************** *** 89,93 **** """retrieves a default record for new categories""" # if sensible values are needed here, this method can be overridden ! return dict([(column[0], '') for column in self.columnlist]) def getfilterclause(self, filter): --- 96,100 ---- """retrieves a default record for new categories""" # if sensible values are needed here, this method can be overridden ! return dict([(column, '') for column in self.columnlist]) def getfilterclause(self, filter): *************** *** 102,106 **** def getsomerecord(self, filter = None): """retrieves a single rowid & record when you don't know which one you want...""" ! sql = "select * from %s %s %s" % (self.tablename, self.getfilterclause(filter), self.orderbyclause()) record = self.db.singlerowdict(sql, self.db.lower) rowid = self.getrowid(record) --- 109,113 ---- def getsomerecord(self, filter = None): """retrieves a single rowid & record when you don't know which one you want...""" ! sql = "select %s from %s %s %s" % (self.getsqlcolumns(), self.tablename, self.getfilterclause(filter), self.orderbyclause()) record = self.db.singlerowdict(sql, self.db.lower) rowid = self.getrowid(record) *************** *** 109,119 **** def gettablerows(self, filter = None): """retrieves all the rows in the table""" ! sql = "select * from %s %s %s" % (self.tablename, self.getfilterclause(filter), self.orderbyclause()) return self.db.allrowdicts(sql, self.db.lower) def addrow(self, argdict): """add the row to the table""" ! validcolumns = [column[0] for column in self.columnlist] ! valuesdict = cidict.filterdict(cidict.cidict(argdict), validcolumns) self.db.insert(self.tablename, valuesdict) --- 116,125 ---- def gettablerows(self, filter = None): """retrieves all the rows in the table""" ! sql = "select %s from %s %s %s" % (self.getsqlcolumns(), self.tablename, self.getfilterclause(filter), self.orderbyclause()) return self.db.allrowdicts(sql, self.db.lower) def addrow(self, argdict): """add the row to the table""" ! valuesdict = cidict.filterdict(cidict.cidict(argdict), self.columnlist) self.db.insert(self.tablename, valuesdict) *************** *** 138,142 **** """creates the table represented by self, using tablename and columnlist and returning success""" sql = "create table %s (" % self.tablename ! sql += ", ".join([column[0]+" "+self.db.dbtypename(column[1]) for column in self.columnlist]) sql += ")" try: --- 144,148 ---- """creates the table represented by self, using tablename and columnlist and returning success""" sql = "create table %s (" % self.tablename ! sql += ", ".join([column+" "+self.db.dbtypename(self.columntypes[column]) for column in self.columnlist]) sql += ")" try: |
From: <dav...@us...> - 2004-02-09 14:41:13
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18505 Modified Files: form.py Log Message: added null value for requiredbychildren (just used for huge combo boxes) Index: form.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/form.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** form.py 9 Feb 2004 14:37:16 -0000 1.6 --- form.py 9 Feb 2004 14:38:00 -0000 1.7 *************** *** 136,140 **** script += "document.%s.%s = document.%s.%s\r" % (self.formname, self.altname, self.formname, self.name) # initialize the object with methods etc... ! script += "setupcombo(document.%s.%s, alloptions, valuemaps, %d, %d)\r" \ % (self.formname, self.name, self.alwaysallowblank, self.valuemapisdict) return script --- 136,140 ---- script += "document.%s.%s = document.%s.%s\r" % (self.formname, self.altname, self.formname, self.name) # initialize the object with methods etc... ! script += "setupcombo(document.%s.%s, alloptions, valuemaps, %d, %d, 0)\r" \ % (self.formname, self.name, self.alwaysallowblank, self.valuemapisdict) return script |
From: <dav...@us...> - 2004-02-09 14:40:29
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18309 Modified Files: form.py Log Message: took out right alignment for labels Index: form.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/form.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** form.py 9 Feb 2004 14:35:22 -0000 1.5 --- form.py 9 Feb 2004 14:37:16 -0000 1.6 *************** *** 150,154 **** def makeform(self): # fill up the table with the categories' labels and widgets... ! labelattribs = {'align':'right', 'valign':'top'} widgetattribs = {'valign':'top'} for categoryname, category in self.categories.iteritems(): --- 150,154 ---- def makeform(self): # fill up the table with the categories' labels and widgets... ! labelattribs = {'valign':'top'} widgetattribs = {'valign':'top'} for categoryname, category in self.categories.iteritems(): |