Changeset 7719
- Timestamp:
- Nov 28, 2008, 1:58:58 PM (15 years ago)
- Location:
- branches/0.11-stable/trac
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11-stable/trac/core.py
r7397 r7719 208 208 return component 209 209 210 def disable_component(self, component): 211 """Force a component to be disabled. 212 213 The argument `component` can be a class or an instance. 214 """ 215 if not isinstance(component, type): 216 component = component.__class__ 217 self.enabled[component] = False 218 self.components[component] = None 219 210 220 def component_activated(self, component): 211 221 """Can be overridden by sub-classes so that special initialization for -
branches/0.11-stable/trac/mimeview/enscript.py
r6904 r7719 141 141 np = NaivePopen(cmdline, content.encode('utf-8'), capturestderr=1) 142 142 if np.errorlevel or np.err: 143 err = 'Running (%s) failed: %s, %s.' % (cmdline, np.errorlevel, 144 np.err) 145 raise Exception, err 143 self.env.disable_component(self) 144 err = "Running enscript failed with (%s, %s), disabling " \ 145 "EnscriptRenderer (command: '%s')" \ 146 % (np.errorlevel, np.err.strip(), cmdline) 147 raise Exception(err) 146 148 odata = np.out 147 149
Note:
See TracChangeset
for help on using the changeset viewer.