예제 #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)