示例#1
0
 def addFile(self, s): 
     """Purpose: If adding a file/jar call this first 
     with s = path_to_jar""" 
     # make a URL out of 's' 
     f = javaFile(s) 
     u = f.toURL() 
     a = self.addURL(u) 
     return a 
示例#2
0
文件: graph.py 项目: tompurl/wideload
 def saveChartToDisk(self, basedir):
     """ Writes the chart to disk as a .png file in the specified
     directory. """
     fileName = basedir + os.sep
     txName = self.transactionName
     # fix for Jim Pringle's bug where illegal chars in transaction name
     # need a swap variable because replace() works inline
     fileName += txName.replace(" ", "_").replace("/", "_").replace(":", "_")
     fileName += self.getFilenameSuffix()
     logger.warn("creating " + fileName)
     chartFile = javaFile(fileName)  # translate string to java.io.File
     self.setChartOptions()
     logger.debug("DEBUG: height" + str(self.chart_height))
     logger.debug("DEBUG: weight" + str(self.chart_width))
     ChartUtilities.saveChartAsPNG(chartFile, self.chart, self.chart_width, self.chart_height)