Opened 17 years ago
Closed 16 years ago
#2157 closed enhancement (fixed)
Option to create specified `cache_dir` if it does not exist
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Component: | GraphvizPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I think it would be nice if the macro code tried to created the cache_dir
specified in trac.ini
if it does not exists. To this end, I hacked on graphviz.py
from http://trac-hacks.org/svn/graphvizplugin/0.9/ to add this feature. It is enabled by adding
create_cache_dir_if_needed = true
to the trac.ini
file.
Attached is my version of graphviz.py
and the diff file. I realize that what I did is rough and I'm sure does not follow many standards, so I submit it as a starting point for those who know more about this. However, it does work!
Attachments (4)
Change History (7)
Changed 17 years ago by
Attachment: | graphviz.py added |
---|
Changed 17 years ago by
Attachment: | graphviz_diff added |
---|
Diff between my version of graphviz.py and that found in http://trac-hacks.org/svn/graphvizplugin/0.9/
comment:1 Changed 16 years ago by
Trac Release: | 0.10 → 0.11 |
---|
Well, for me this little issue doesn't seem worth the trouble of an extra option.
When you install that plugin for the first time, chances are that you also will test it right away, then you'll notice that the cache directory must exist. Improving both the cache_dir
documentation and the error message to mention this seems to be enough to me.
What would be more useful on this topic is to allow specifying a relative path for the cache_dir
(path will be relative to the Trac environment), like we do now for most other stuff in Trac (like the repository_dir
), the idea being that you could just move your self-contained Trac environment around. Patches follow.
Changed 16 years ago by
Attachment: | document_cache_dir.patch added |
---|
document the need for creating the cache_dir before hand
Changed 16 years ago by
Attachment: | relative_cache_dir.patch added |
---|
[graphviz] cache_dir
can be relative to the Trac environment path (must be applied after the previous patch)
comment:2 Changed 16 years ago by
Owner: | changed from Peter Kropf to Christian Boos |
---|
- document_cache_dir.patch applied in [4391]
- relative_cache_dir.patch applied in [4392]
There's one more change related to this ticket to come: effectively creating the cache_dir folder when it doesn't exist, but only when that folder is the default relative one, in order to support "plug&play" installations.
comment:3 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [4404]) GraphvizPlugin: in order to help "plug&play" installs, automatically create the cache_dir folder, but only if this corresponds to the default path.
If one sets explicitly a non-default cache_dir, one can as well make sure that this folder exists.
Closes #2157.
Hacked version that will create specified cache_dir if it does not exist when create_cache_dir_if_needed = true is found in trac.ini file