#3951 closed enhancement (fixed)
create cache directory
Reported by: | rupert thurner | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | GraphvizPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
a cache directory may be set to a temporary directory which will be cleaned from time to time. so it would be favourable if the cache directory will be recreated by the plugin instead of complaining about it as "missing".
Attachments (0)
Change History (12)
comment:1 Changed 16 years ago by
Owner: | changed from Peter Kropf to Christian Boos |
---|---|
Trac Release: | 0.10 → 0.11 |
comment:4 Changed 15 years ago by
I suggest something like the following which is working for us:
-
graphviz/graphviz.py
456 456 self.cache_dir = os.path.join(self.env.path, self.cache_dir) 457 457 458 458 if not os.path.exists(self.cache_dir): 459 if self.cache_dir_option == self.DEFAULT_CACHE_DIR:460 os.mkdir(self.cache_dir)461 else:462 return _("The cache_dir '%(path)s' doesn't exist, "463 "please create it.", path=self.cache_dir)459 #if self.cache_dir_option == self.DEFAULT_CACHE_DIR: 460 try: 461 os.makedirs(self.cache_dir) 462 except Exception, e: 463 return _("The cache_dir '%(path)s' doesn't exist, and we failed to create it please create it. :%(e)s", path=self.cache_dir, e=e) 464 464 465 465 # Get optional configuration parameters from trac.ini. 466 466
comment:6 Changed 13 years ago by
I've just implemented this same feature for the TracPlantUmlPlugin ([11255]), in the way described by bobbysmith007 in comment:4. I'd like to go ahead and implement the same for this plugin. If no objection from the author / maintainer, or no response for two weeks in accordance with AdoptingHacks, I will proceed.
I added an option to specify the cache directory in [11255], but after reading the comments in this ticket, I agree that an option is overkill. I'd propose just creating the directory at $TRACENV/cache/graphviz
.
comment:7 Changed 13 years ago by
Owner: | changed from Christian Boos to Ryan J Ollos |
---|---|
Priority: | normal → high |
Status: | new → assigned |
comment:8 Changed 11 years ago by
Priority: | high → normal |
---|
comment:9 Changed 11 years ago by
Status: | assigned → new |
---|
comment:10 Changed 5 years ago by
Owner: | Ryan J Ollos deleted |
---|
comment:11 Changed 4 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Cache directory is created for recent releases. In latest, $env/files/gvcache
is created.
This is an use case I haven't thought about when closing #2157.
Do you think it's worth to add an option for that, like suggested in the above ticket, or should we just go ahead and create the folder if it's missing?