##// END OF EJS Templates
implement active_types via formatter.enabled attributes...
MinRK -
Show More
@@ -63,7 +63,14 b' class DisplayFormatter(Configurable):'
63 63 help="""List of currently active mime-types""")
64 64 def _active_types_default(self):
65 65 return self.format_types
66
66
67 def _active_types_changed(self, name, old, new):
68 for key, formatter in self.formatters.keys():
69 if key in new:
70 formatter.enabled = True
71 else:
72 formatter.enabled = False
73
67 74 # A dict of formatter whose keys are format types (MIME types) and whose
68 75 # values are subclasses of BaseFormatter.
69 76 formatters = Dict()
@@ -109,7 +116,6 b' class DisplayFormatter(Configurable):'
109 116 A list of format type strings (MIME types) to include in the
110 117 format data dict. If this is set *only* the format types included
111 118 in this list will be computed.
112 If unspecified, `active_types` will be used.
113 119 exclude : list or tuple, optional
114 120 A list of format type string (MIME types) to exclude in the format
115 121 data dict. If this is set all format types will be computed,
@@ -125,8 +131,6 b' class DisplayFormatter(Configurable):'
125 131 that format.
126 132 """
127 133 format_dict = {}
128 if include is None:
129 include = self.active_types
130 134
131 135 for format_type, formatter in self.formatters.items():
132 136 if format_type not in include:
General Comments 0
You need to be logged in to leave comments. Login now