Olemis Lang avatar Olemis Lang committed a517793

GViz providers: Adopting Trac=1.0 EnvironmentStub approach to enable/disable components

Comments (0)

Files changed (3)

trac-dev/gviz/TODO

 X Include helper to convert CSV files under version control to GViz 
   API JSON format.
 
+- Fix GViz providers index, broken using Trac=1.0
+
 ~ Write tests for data sources included in TracGViz 1.3.4 that are 
   not about version control.
 

trac-dev/gviz/tracgviz/testing/__init__.py

   def enable_component(self, clsdef):
     r"""Enable a plugin temporarily at testing time.
     """
-    if clsdef not in self.enabled_components :
-      self.enabled_components.append(clsdef)
+    self.config.set('components', clsdef, 'enabled')
   
   def disable_component(self, clsdef):
     r"""Disable a plugin temporarily at testing time.
     """
-    try:
-      self.enabled_components.remove(clsdef)
-    except ValueError :
-      self.log.warning("Component %s was not enabled", clsdef)
+    self.config.set('components', clsdef, 'disabled')
 
   def rip_component(self, cls):
     r"""Disable a plugin forever and RIP it using the super-laser beam.

trac-dev/gviz/tracgviz/testing/test_rpc.py

   l = MultiTestLoader(
         [defaultTestLoader, \
           DocTestRpcLoader(extraglobs=magic_vars, \
-                            enable=['trac.[a-uw-z]*', 'tracrpc.*', \
-                                        'tracgviz.*'], \
+                            enable=[
+                                'trac.*', 'tracrpc.*', 'tracgviz.*'
+                              ], \
                             default_data=True,
-                            optionflags=ELLIPSIS | # REPORT_UDIFF | \
+                            optionflags=ELLIPSIS | REPORT_UDIFF | \
                                         NORMALIZE_WHITESPACE) \
         ])
   
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.