Changeset 548
- Timestamp:
- 03/23/06 23:09:34 (3 years ago)
- Files:
-
- graphvizplugin/branches/v0.6/graphviz/graphviz.py (modified) (21 diffs)
- graphvizplugin/branches/v0.6/graphviz/__init__.py (modified) (1 diff)
- graphvizplugin/branches/v0.6/ReleaseNotes.txt (modified) (2 diffs)
- graphvizplugin/branches/v0.6/setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
graphvizplugin/branches/v0.6/graphviz/graphviz.py
r533 r548 10 10 11 11 12 __ version__= '$LastChangedRevision$'12 __revision__ = '$LastChangedRevision$' 13 13 __id__ = '$Id$' 14 14 __headurl__ = '$HeadURL$' 15 15 __docformat__ = 'restructuredtext' 16 __version__ = '0.6.1' 16 17 17 18 … … 46 47 47 48 def __init__(self): 48 self.log.info(' id: %s' % str(__id__))49 self.log.info('processors: %s' % str(GraphvizMacro.processors))50 self.log.info('formats: %s' % str(GraphvizMacro.formats))49 self.log.info('version: %s - id: %s' % (__version__, str(__id__))) 50 #self.log.info('processors: %s' % str(GraphvizMacro.processors)) 51 #self.log.info('formats: %s' % str(GraphvizMacro.formats)) 51 52 52 53 … … 89 90 """ 90 91 91 self.log.debug('dir(req): %s' % str(dir(req)))92 if hasattr(req, 'args'):93 self.log.debug('req.args: %s' % str(req.args))94 else:95 self.log.debug('req.args attribute does not exist')96 if hasattr(req, 'base_url'):97 self.log.debug('req.base_url: %s' % str(req.base_url))98 else:99 self.log.debug('req.base_url attribute does not exist')92 #self.log.debug('dir(req): %s' % str(dir(req))) 93 #if hasattr(req, 'args'): 94 # self.log.debug('req.args: %s' % str(req.args)) 95 #else: 96 # self.log.debug('req.args attribute does not exist') 97 #if hasattr(req, 'base_url'): 98 # self.log.debug('req.base_url: %s' % str(req.base_url)) 99 #else: 100 # self.log.debug('req.base_url attribute does not exist') 100 101 101 102 # check and load the configuration … … 156 157 self.clean_cache() 157 158 158 self.log.debug('render_macro.URL_in_graph: %s' % str(URL_in_graph))159 #self.log.debug('render_macro.URL_in_graph: %s' % str(URL_in_graph)) 159 160 if URL_in_graph: # translate wiki TracLinks in URL 160 content = re.sub(r'URL="(.*)"', self.expand_wiki_links, content) 161 content = re.sub(r'URL="(.*?)"', self.expand_wiki_links, content) 162 161 163 162 164 # Antialias PNGs with rsvg, if requested … … 164 166 # 1. SVG output 165 167 cmd = '"%s" %s -Tsvg -o%s.svg' % (proc_cmd, self.processor_options, img_path) 166 self.log.debug('render_macro: running command %s' % cmd)168 #self.log.debug('render_macro: running command %s' % cmd) 167 169 out, err = self.launch(cmd, content) 168 170 if len(out) or len(err): … … 171 173 # 2. SVG to PNG rasterization 172 174 cmd = '"%s" --dpi-x=%d --dpi-y=%d %s.svg %s' % (self.rsvg_path, self.dpi, self.dpi, img_path, img_path) 173 self.log.debug('render_macro: running command %s' % cmd)175 #self.log.debug('render_macro: running command %s' % cmd) 174 176 out, err = self.launch(cmd, None) 175 177 if len(out) or len(err): … … 179 181 else: # Render other image formats 180 182 cmd = '"%s" %s -T%s -o%s' % (proc_cmd, self.processor_options, self.out_format, img_path) 181 self.log.debug('render_macro: running command %s' % cmd)183 #self.log.debug('render_macro: running command %s' % cmd) 182 184 out, err = self.launch(cmd, content) 183 185 if len(out) or len(err): … … 191 193 if not os.path.exists(map_path): 192 194 cmd = '"%s" %s -Tcmap -o%s' % (proc_cmd, self.processor_options, map_path) 193 self.log.debug('render_macro: running command %s' % cmd)195 #self.log.debug('render_macro: running command %s' % cmd) 194 196 out, err = self.launch(cmd, content) 195 197 if len(out) or len(err): … … 236 238 237 239 def expand_wiki_links(self, match): 238 self.log.debug('expand_wiki_links.match.groups: %s' % str(match.groups()))240 #self.log.debug('expand_wiki_links.match.groups: %s' % str(match.groups())) 239 241 240 242 wiki_url = match.groups()[0] # TracLink ([1], source:file/, ...) … … 243 245 244 246 url = 'URL="%s"' % href.groups()[0] 245 self.log.debug('expand_wiki_links.url: %(url)s' % locals())247 #self.log.debug('expand_wiki_links.url: %(url)s' % locals()) 246 248 247 249 return url … … 272 274 buf = self.show_err(msg) 273 275 trouble = True 274 self.log.debug('self.cache_dir: %s' % self.cache_dir)276 #self.log.debug('self.cache_dir: %s' % self.cache_dir) 275 277 276 278 # check for the cmd_path entry … … 292 294 trouble = True 293 295 294 self.log.debug('self.cmd_path: %s' % self.cmd_path)296 #self.log.debug('self.cmd_path: %s' % self.cmd_path) 295 297 296 298 # check for the prefix_url entry … … 301 303 else: 302 304 self.prefix_url = self.config.get('graphviz', 'prefix_url') 303 self.log.debug('self.prefix_url: %s' % self.prefix_url)305 #self.log.debug('self.prefix_url: %s' % self.prefix_url) 304 306 305 307 … … 311 313 else: 312 314 self.out_format = GraphvizMacro.formats[0] 313 self.log.debug('self.out_format: %s' % self.out_format)315 #self.log.debug('self.out_format: %s' % self.out_format) 314 316 315 317 # check for the default processor - processor … … 318 320 else: 319 321 self.processor = GraphvizMacro.processors[0] 320 self.log.debug('self.processor: %s' % self.processor)322 #self.log.debug('self.processor: %s' % self.processor) 321 323 322 324 # check if png anti aliasing should be done - png_antialias … … 325 327 else: 326 328 self.png_anti_alias = False 327 self.log.debug('self.png_anti_alias: %s' % self.png_anti_alias)329 #self.log.debug('self.png_anti_alias: %s' % self.png_anti_alias) 328 330 329 331 self.rsvg_path = '/usr/bin/rsvg' … … 336 338 buf = self.show_err(err) 337 339 trouble = True 338 self.log.debug('self.rsvg_path: %s' % self.rsvg_path)340 #self.log.debug('self.rsvg_path: %s' % self.rsvg_path) 339 341 340 342 # get default graph/node/edge attributes … … 357 359 self.cache_manager = True 358 360 359 self.cache_max_size = int(self.config.get('graphviz', 'cache_max_size')) 360 self.cache_min_size = int(self.config.get('graphviz', 'cache_min_size')) 361 self.cache_max_count = int(self.config.get('graphviz', 'cache_max_count')) 362 self.cache_min_count = int(self.config.get('graphviz', 'cache_min_count')) 363 364 self.log.debug('self.cache_max_count: %d' % self.cache_max_count) 365 self.log.debug('self.cache_min_count: %d' % self.cache_min_count) 366 self.log.debug('self.cache_max_size: %d' % self.cache_max_size) 367 self.log.debug('self.cache_min_size: %d' % self.cache_min_size) 361 if self.config.parser.has_option('graphviz', 'cache_max_size'): 362 self.cache_max_size = int(self.config.get('graphviz', 'cache_max_size')) 363 else: 364 self.cache_max_size = 10000000 365 366 if self.config.parser.has_option('graphviz', 'cache_min_size'): 367 self.cache_min_size = int(self.config.get('graphviz', 'cache_min_size')) 368 else: 369 self.cache_min_size = 5000000 370 371 if self.config.parser.has_option('graphviz', 'cache_max_count'): 372 self.cache_max_count = int(self.config.get('graphviz', 'cache_max_count')) 373 else: 374 self.cache_max_count = 2000 375 376 if self.config.parser.has_option('graphviz', 'cache_min_count'): 377 self.cache_min_count = int(self.config.get('graphviz', 'cache_min_count')) 378 else: 379 self.cache_min_count = 1500 380 381 #self.log.debug('self.cache_max_count: %d' % self.cache_max_count) 382 #self.log.debug('self.cache_min_count: %d' % self.cache_min_count) 383 #self.log.debug('self.cache_max_size: %d' % self.cache_max_size) 384 #self.log.debug('self.cache_min_size: %d' % self.cache_min_size) 368 385 369 386 else: … … 429 446 430 447 for name in os.listdir(self.cache_dir): 431 self.log.debug('clean_cache.entry: %s' % name)448 #self.log.debug('clean_cache.entry: %s' % name) 432 449 entry_list[name] = os.stat(os.path.join(self.cache_dir, name)) 433 450 … … 441 458 atime_keys.sort() 442 459 443 self.log.debug('clean_cache.atime_keys: %s' % atime_keys)444 self.log.debug('clean_cache.count: %d' % count)445 self.log.debug('clean_cache.size: %d' % size)460 #self.log.debug('clean_cache.atime_keys: %s' % atime_keys) 461 #self.log.debug('clean_cache.count: %d' % count) 462 #self.log.debug('clean_cache.size: %d' % size) 446 463 447 464 # In the spirit of keeping the code fairly simple, the … … 454 471 key = atime_keys.pop(0) 455 472 for file in atime_list[key]: 456 self.log.debug('clean_cache.unlink: %s' % file)473 #self.log.debug('clean_cache.unlink: %s' % file) 457 474 os.unlink(os.path.join(self.cache_dir, file)) 458 475 count = count - 1 459 476 size = size - entry_list[file][6] 460 477 else: 461 self.log.debug('clean_cache: cache_manager not set') 478 #self.log.debug('clean_cache: cache_manager not set') 479 pass graphvizplugin/branches/v0.6/graphviz/__init__.py
r156 r548 9 9 10 10 11 __ version__= '$LastChangedRevision$'11 __revision__ = '$LastChangedRevision$' 12 12 __id__ = '$Id$' 13 13 __headurl__ = '$HeadURL$' graphvizplugin/branches/v0.6/ReleaseNotes.txt
r533 r548 1 1 Trac Graphviz Plugin v0.6 Release Notes 2 2 ======================================= 3 Mar 2 2, 20063 Mar 23, 2006 4 4 5 Graphviz plugin v0.6 for Trac is now available. The Graphviz wiki5 Graphviz plugin v0.6.1 for Trac is now available. The Graphviz wiki 6 6 processor is a plugin for Trac that allows the the dynamic generation 7 7 of diagrams by the various graphviz programs. The text of a wiki page 8 8 can contain the source text for graphviz and the web browser will show 9 9 the resulting image. 10 11 12 Changes for release v0.6.1 13 -------------------------- 14 15 * Applied patch from eblot to correct the regular expression for 16 embedded URLs. Resolves issue http://trac-hacks.org/ticket/161. 17 18 * Renamed module variable __version__ to __revision__ to better 19 reflect the intent. 20 21 * Moved the release version number from setup.py to 22 graphviz/graphviz.py. The version number is now logged when the 23 graphviz module is initialized. 24 25 * Commented out the many self.log.debug messages. As pointed out in, 26 http://trac-hacks.org/ticket/238, the core seems to be mostly stable 27 and having lots and lots of debugging messages may no longer be 28 needed. 29 30 * Added defaults for the cache management control values: 31 32 * cache_max_size = 10,000,000 33 * cache_min_size = 5,000,000 34 * cache_max_count = 2,000 35 * cache_min_count = 1,500 36 37 The resolves issue http://trac-hacks.org/ticket/160. 10 38 11 39 … … 24 52 25 53 Changes for release v0.5.1 26 ------------------------ 54 -------------------------- 27 55 28 56 * Corrected typo in graphviz.py where the wrong internal variable was graphvizplugin/branches/v0.6/setup.py
r214 r548 16 16 17 17 from setuptools import setup, find_packages 18 import graphviz 18 19 19 20 setup ( 20 21 name = 'graphviz', 21 version = "0.6",22 version = graphviz.graphviz.__version__, 22 23 packages = find_packages(), 23 24 package_data = { 'graphviz' : ['examples/*',],
