# HG changeset patch # User Todd Larsen # Date 1222223221 0 # Node ID 8bdb1d2d0c36fae6691ab0addcf5feeb9786c5d2 # Parent 3d30a7a96ce7cc7a0db4e7136419eeda07a53324 Change indentation level to 2 (from 4) and rename MCE_DEF_SETTINGS to DEF_MCE_SETTINGS to match the "default constant" naming convention elsewhere in the code. diff -r 3d30a7a96ce7 -r 8bdb1d2d0c36 app/soc/views/helpers/custom_widgets.py --- a/app/soc/views/helpers/custom_widgets.py Wed Sep 24 02:24:49 2008 +0000 +++ b/app/soc/views/helpers/custom_widgets.py Wed Sep 24 02:27:01 2008 +0000 @@ -44,31 +44,33 @@ {% endblock %} """ - MCE_DEF_SETTINGS = { 'mode': "exact", + DEF_MCE_SETTINGS = { 'mode': "exact", 'theme': "simple", 'theme_advanced_toolbar_location': "top", 'theme_advanced_toolbar_align': "center"} - mce_settings = MCE_DEF_SETTINGS + mce_settings = DEF_MCE_SETTINGS - TINY_MCE_HTML_FMT = u''' - ''' + TINY_MCE_HTML_FMT = u'''\ + +''' def render(self, name, value, attrs=None): - """Render TinyMCE widget as HTML. - """ - if value is None: - value = '' - value = smart_unicode(value) - final_attrs = self.build_attrs(attrs, name=name) + """Render TinyMCE widget as HTML. + """ + if value is None: + value = '' + value = smart_unicode(value) + final_attrs = self.build_attrs(attrs, name=name) - self.mce_settings['elements'] = "id_%s" % name + self.mce_settings['elements'] = "id_%s" % name - # convert mce_settings from dict to JSON - mce_json = simplejson.JSONEncoder().encode(self.mce_settings) + # convert mce_settings from dict to JSON + mce_json = simplejson.JSONEncoder().encode(self.mce_settings) - return mark_safe( self.TINY_MCE_HTML_FMT % - { 'attrs': flatatt(final_attrs), - 'value': escape(value), - 'settings_json': mce_json}) + return mark_safe(self.TINY_MCE_HTML_FMT % + {'attrs': flatatt(final_attrs), + 'value': escape(value), + 'settings_json': mce_json})