Ticket #3559 (closed defect: fixed)

Opened 5 months ago

Last modified 3 months ago

Error for non trac-projects in the project dir

Reported by: bobbysmith007 Assigned to: airadier
Priority: normal Component: SearchAllPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

I have a few directories in my trac project dir which are not tracs (such as .egg-cache).

To get the search all to succeed I simply added a try/except continue around opening the environment. I think that overall this makes the plugin more robust without it losing any capability.

Index: tracsearchall/searchall.py
===================================================================
--- tracsearchall/searchall.py  (revision 4145)
+++ tracsearchall/searchall.py  (working copy)
@@ -58,8 +58,10 @@
             project_path = os.path.join(search_path,project)
             if not os.path.isdir( project_path ):
                 continue
-
-            env = open_environment(project_path)
+            try:
+                env = open_environment(project_path)
+            except:
+                continue


             self.env.log.debug("Searching project %s" % project )

HTH and thanks for the plugin, Russ

Attachments

Change History

08/18/08 10:06:05 changed by bobbysmith007

PS. airadier

If you want to give me commit access to this plugin, I would be more than happy to apply the outstanding patches and work on this occasionally. I run a couple of other plugins, so I know a bit about how they should work. Up to you, but I thought I would make the offer as there are some outstanding patches, which I have tested.

09/26/08 06:08:51 changed by airadier

  • status changed from new to closed.
  • resolution set to fixed.

(In [4343]) Fix search with non-environment folders. Closes #3559, thanks to bobbysmith007


Add/Change #3559 (Error for non trac-projects in the project dir)




Change Properties
Action