Changes between Version 3 and Version 4 of TracDev/Proposals/AdvancedNotification/INotificationFormatter
- Timestamp:
- Oct 20, 2013, 10:03:12 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/Proposals/AdvancedNotification/INotificationFormatter
v3 v4 70 70 Maybe `styles()` should be changed to enumerate the supported style / transport / realm combinations as tuples: 71 71 {{{#!python 72 def styles(self):72 def get_supported_styles(self): 73 73 yield ('text/plain', 'sms', 'ticket') 74 74 }}} … … 84 84 * Define the interface with ''two methods''. One method with parameters as before; another method without parameters must list all supported styles for any transport or realm. 85 85 * Define the interface with one method, with ''optional parameters''. If the parameters are `None` the method must list all supported styles for any transport or realm. 86 * Introduce a mechanism similar to `IAnnouncementProducer.realms()` that enumerates all supported realms. Iterating over all possible realm / transport combinations then gets a complete list of supported styles. 86 87 87 Similary, could some formatters want to support all realms? 88 Similary, could some formatters want to support all realms? If not, another possible solution could be to keep the `transport` parameter, but not the `realm` parameter: 89 {{{#!python 90 def get_supported_styles(self, transport): 91 if transport == 'sms': 92 yield ('text/plain', 'ticket') 93 }}} 94 This solves the immediate problem for listing the supported styles per transport. (But does not help if in the future we want to allow the user to selected his preferred style per realm-specific rule.) 88 95 89 96 The chosen solution should be simple and easy to implement correctly by plugin authors. 97 98 === Quality level? 99 Other extension points that enumerate supported cases (e.g. IRepositoryConnector, IHTMLPreviewRenderer, IContentConverter and IDatabaseConnector) also return some kind of ''quality level''. Should something like this be added: 100 {{{#!python 101 def get_supported_styles(self): 102 yield ('text/plain', 'sms', 'ticket', 8) 103 }}}