Changes between Version 1 and Version 2 of TracPluggableModules
- Timestamp:
- Nov 18, 2004, 10:46:36 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracPluggableModules
v1 v2 35 35 There needs to be a central facility that manages the discovery and loading of plug-ins as well as the communication between them. We'll call this the {{{ModuleManager}}} for now. 36 36 37 The module manager should probably be part of the environment, or in other words, for any environment their should be one module registry. Module discovery would presumably be based on a given paths (list of directories) that contain python modules. The registry class would find all classes that somehow identify themselves as Trac modules (for example by sub-classing a central {{{Module}}} Âclass, or by defining some module-scope variable). There could also be a 'plugins' folder in Trac environments that would be added the path by default.37 The module manager should probably be part of the environment, or in other words, for any environment their should be one module registry. Module discovery would presumably be based on a given paths (list of directories) that contain python modules. The registry class would find all classes that somehow identify themselves as Trac modules (for example by sub-classing a central {{{Module}}} class, or by defining some module-scope variable). There could also be a 'plugins' folder in Trac environments that would be added the path by default. 38 38 39 39 ''An alternative and possibly more efficient but also more cumbersome approach would be to require the user to specify the "fully qualified" name of every additional module, for example in TracIni. Modules such as the timeline would be in the list by default, but could be disabled by removing them.'' … … 60 60 }}} 61 61 62 In an environment such as [wiki:TracStandalone tracd] Âor [wiki:TracModPython mod_python], the {{{process}}} method might be called concurrently on the same module object, so module implementations should not store request-specific data as instance variables, but rather pass such data through as parameters to other methods.62 In an environment such as [wiki:TracStandalone tracd] or [wiki:TracModPython mod_python], the {{{process}}} method might be called concurrently on the same module object, so module implementations should not store request-specific data as instance variables, but rather pass such data through as parameters to other methods. 63 63 64 ''Renaming the current "{{{render}}}" Â to "{{{process}}}"Âhere simply because the latter sounds more appropriate.'''64 ''Renaming the current "{{{render}}}" to "{{{process}}}" here simply because the latter sounds more appropriate.''' 65 65 66 66 == Module Cooperation == … … 86 86 The wiki module would contribute to the timeline simply by appropriately implementing these functions. Same for any other module that wants to put events in the timeline. 87 87 88 The timeline module would use a convenience function in the {{{Module}}} Âbase class to collect the events from all available plug-ins. That might look like the following:88 The timeline module would use a convenience function in the {{{Module}}} base class to collect the events from all available plug-ins. That might look like the following: 89 89 90 90 {{{