Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/widgets.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@sugarlabs.org>2010-10-28 19:52:32 (GMT)
committer Gonzalo Odiard <godiard@sugarlabs.org>2010-10-28 19:56:30 (GMT)
commit0a7523bbb33c62807e235c42475e7ca671654eea (patch)
tree3a32e0761dc78eeb48ed6f0c5cb08b4fe8546ee2 /widgets.py
parent72e8e40d76e572e104ab5e5db5adaacf2f58a2bb (diff)
make the sources of Write pep8 complaint
Diffstat (limited to 'widgets.py')
-rw-r--r--widgets.py37
1 files changed, 23 insertions, 14 deletions
diff --git a/widgets.py b/widgets.py
index c31a2ed..0d6b4aa 100644
--- a/widgets.py
+++ b/widgets.py
@@ -27,7 +27,9 @@ from sugar.datastore import datastore
logger = logging.getLogger('write-activity')
+
class FontCombo(ComboBox):
+
def __init__(self, abi):
ComboBox.__init__(self)
@@ -85,7 +87,9 @@ class FontCombo(ComboBox):
self.set_active(font_index)
self.handler_unblock(self._fonts_changed_id)
+
class FontSizeCombo(ComboBox):
+
def __init__(self, abi):
ComboBox.__init__(self)
@@ -120,7 +124,9 @@ class FontSizeCombo(ComboBox):
self.handler_unblock(self._changed_id)
break
+
class AbiButton(RadioToolButton):
+
def __init__(self, abi, abi_signal, do_abi_cb, on_abi_cb=None, **kwargs):
RadioToolButton.__init__(self, **kwargs)
@@ -152,22 +158,24 @@ class AbiButton(RadioToolButton):
finally:
self.handler_unblock(self._toggled_handler)
+
class ExportButton(ToolButton):
- _EXPORT_FORMATS = [{'mime_type' : 'application/rtf',
- 'title' : _('Rich Text (RTF)'),
- 'jpostfix' : _('RTF'),
- 'exp_props' : ''},
-
- {'mime_type' : 'text/html',
- 'title' : _('Hypertext (HTML)'),
- 'jpostfix' : _('HTML'),
- 'exp_props' : 'html4:yes; declare-xml:no; ' \
+
+ _EXPORT_FORMATS = [{'mime_type': 'application/rtf',
+ 'title': _('Rich Text (RTF)'),
+ 'jpostfix': _('RTF'),
+ 'exp_props': ''},
+
+ {'mime_type': 'text/html',
+ 'title': _('Hypertext (HTML)'),
+ 'jpostfix': _('HTML'),
+ 'exp_props': 'html4:yes; declare-xml:no; ' \
'embed-css:yes; embed-images:yes;'},
- {'mime_type' : 'text/plain',
- 'title' : _('Plain Text (TXT)'),
- 'jpostfix' : _('TXT'),
- 'exp_props' : ''},
+ {'mime_type': 'text/plain',
+ 'title': _('Plain Text (TXT)'),
+ 'jpostfix': _('TXT'),
+ 'exp_props': ''},
{'mime_type': 'application/pdf',
'title': _('Portable Document Format (PDF)'),
@@ -205,7 +213,8 @@ class ExportButton(ToolButton):
act_meta = activity.metadata
fileObject.metadata['title'] = \
act_meta['title'] + ' (' + format['jpostfix'] + ')'
- fileObject.metadata['title_set_by_user'] = act_meta['title_set_by_user']
+ fileObject.metadata['title_set_by_user'] = \
+ act_meta['title_set_by_user']
fileObject.metadata['mime_type'] = format['mime_type']
fileObject.metadata['fulltext'] = abi.get_content(
extension_or_mimetype=".txt")[:3000]