From b8d3e2a836c980904d4b72ce1e3805453abe3de6 Mon Sep 17 00:00:00 2001
From: Gonzalo Odiard <godiard@sugarlabs.org>
Date: Tue, 26 Oct 2010 09:10:54 -0300
Subject: [PATCH 6/8] make widgets.py pep8 complaint
---
widgets.py | 37 +++++++++++++++++++++++--------------
1 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/widgets.py b/widgets.py
index ecdaf19..ce2a601 100644
a
|
b
|
from sugar.datastore import datastore |
27 | 27 | |
28 | 28 | logger = logging.getLogger('write-activity') |
29 | 29 | |
| 30 | |
30 | 31 | class FontCombo(ComboBox): |
| 32 | |
31 | 33 | def __init__(self, abi): |
32 | 34 | ComboBox.__init__(self) |
33 | 35 | |
… |
… |
class FontCombo(ComboBox): |
85 | 87 | self.set_active(font_index) |
86 | 88 | self.handler_unblock(self._fonts_changed_id) |
87 | 89 | |
| 90 | |
88 | 91 | class FontSizeCombo(ComboBox): |
| 92 | |
89 | 93 | def __init__(self, abi): |
90 | 94 | ComboBox.__init__(self) |
91 | 95 | |
… |
… |
class FontSizeCombo(ComboBox): |
120 | 124 | self.handler_unblock(self._changed_id) |
121 | 125 | break |
122 | 126 | |
| 127 | |
123 | 128 | class AbiButton(RadioToolButton): |
| 129 | |
124 | 130 | def __init__(self, abi, abi_signal, do_abi_cb, on_abi_cb=None, **kwargs): |
125 | 131 | RadioToolButton.__init__(self, **kwargs) |
126 | 132 | |
… |
… |
class AbiButton(RadioToolButton): |
152 | 158 | finally: |
153 | 159 | self.handler_unblock(self._toggled_handler) |
154 | 160 | |
| 161 | |
155 | 162 | class ExportButton(ToolButton): |
156 | | _EXPORT_FORMATS = [{'mime_type' : 'application/rtf', |
157 | | 'title' : _('Rich Text (RTF)'), |
158 | | 'jpostfix' : _('RTF'), |
159 | | 'exp_props' : ''}, |
160 | | |
161 | | {'mime_type' : 'text/html', |
162 | | 'title' : _('Hypertext (HTML)'), |
163 | | 'jpostfix' : _('HTML'), |
164 | | 'exp_props' : 'html4:yes; declare-xml:no; ' \ |
| 163 | |
| 164 | _EXPORT_FORMATS = [{'mime_type': 'application/rtf', |
| 165 | 'title': _('Rich Text (RTF)'), |
| 166 | 'jpostfix': _('RTF'), |
| 167 | 'exp_props': ''}, |
| 168 | |
| 169 | {'mime_type': 'text/html', |
| 170 | 'title': _('Hypertext (HTML)'), |
| 171 | 'jpostfix': _('HTML'), |
| 172 | 'exp_props': 'html4:yes; declare-xml:no; ' \ |
165 | 173 | 'embed-css:yes; embed-images:yes;'}, |
166 | 174 | |
167 | | {'mime_type' : 'text/plain', |
168 | | 'title' : _('Plain Text (TXT)'), |
169 | | 'jpostfix' : _('TXT'), |
170 | | 'exp_props' : ''}] |
| 175 | {'mime_type': 'text/plain', |
| 176 | 'title': _('Plain Text (TXT)'), |
| 177 | 'jpostfix': _('TXT'), |
| 178 | 'exp_props': ''}] |
171 | 179 | |
172 | 180 | def __init__(self, activity, abi): |
173 | 181 | ToolButton.__init__(self, 'document-save') |
… |
… |
class ExportButton(ToolButton): |
200 | 208 | act_meta = activity.metadata |
201 | 209 | fileObject.metadata['title'] = \ |
202 | 210 | act_meta['title'] + ' (' + format['jpostfix'] + ')' |
203 | | fileObject.metadata['title_set_by_user'] = act_meta['title_set_by_user'] |
| 211 | fileObject.metadata['title_set_by_user'] = \ |
| 212 | act_meta['title_set_by_user'] |
204 | 213 | fileObject.metadata['mime_type'] = format['mime_type'] |
205 | 214 | fileObject.metadata['fulltext'] = abi.get_content( |
206 | 215 | extension_or_mimetype=".txt")[:3000] |