Line too long fixes.

This commit is contained in:
Marco Pesenti Gritti 2008-09-22 10:55:05 +02:00
parent 88295072bd
commit 9e6ef4d2a9

View File

@ -20,8 +20,8 @@ create a simple alert message.
# Populate the title and text body of the alert. # Populate the title and text body of the alert.
alert.props.title=_('Title of Alert Goes Here') alert.props.title=_('Title of Alert Goes Here')
alert.props.msg = _('Text message of alert goes here') alert.props.msg = _('Text message of alert goes here')
# Call the add_alert() method (inherited via the sugar.graphics.Window superclass of Activity) # Call the add_alert() method (inherited via the sugar.graphics.Window
# to add this alert to the activity window. # superclass of Activity) to add this alert to the activity window.
self.add_alert(alert) self.add_alert(alert)
alert.show() alert.show()
@ -183,8 +183,8 @@ class Alert(gtk.EventBox):
Parameters Parameters
---------- ----------
response_id : response_id :
will be emitted with the response signal a response ID should one of the will be emitted with the response signal a response ID should one
pre-defined GTK Response Type Constants or a positive number of the pre-defined GTK Response Type Constants or a positive number
label : label :
that will occure right to the buttom that will occure right to the buttom
@ -254,7 +254,8 @@ class ConfirmationAlert(Alert):
.. code-block:: python .. code-block:: python
from sugar.graphics.alert import ConfirmationAlert from sugar.graphics.alert import ConfirmationAlert
... ...
#### Method: _alert_confirmation, create a Confirmation alert (with ok and cancel buttons standard) #### Method: _alert_confirmation, create a Confirmation alert (with ok
and cancel buttons standard)
# and add it to the UI. # and add it to the UI.
def _alert_confirmation(self): def _alert_confirmation(self):
alert = ConfirmationAlert() alert = ConfirmationAlert()
@ -264,10 +265,11 @@ class ConfirmationAlert(Alert):
self.add_alert(alert) self.add_alert(alert)
#### Method: _alert_response_cb, called when an alert object throws a response event. #### Method: _alert_response_cb, called when an alert object throws a
response event.
def _alert_response_cb(self, alert, response_id): def _alert_response_cb(self, alert, response_id):
#remove the alert from the screen, since either a response button was clicked or #remove the alert from the screen, since either a response button
#there was a timeout #was clicked or there was a timeout
self.remove_alert(alert) self.remove_alert(alert)
#Do any work that is specific to the type of button clicked. #Do any work that is specific to the type of button clicked.
@ -326,21 +328,23 @@ class TimeoutAlert(Alert):
.. code-block:: python .. code-block:: python
from sugar.graphics.alert import TimeoutAlert from sugar.graphics.alert import TimeoutAlert
... ...
#### Method: _alert_timeout, create a Timeout alert (with ok and cancel buttons standard) #### Method: _alert_timeout, create a Timeout alert (with ok and cancel
buttons standard)
# and add it to the UI. # and add it to the UI.
def _alert_timeout(self): def _alert_timeout(self):
#Notice that for a TimeoutAlert, you pass the number of seconds in which to timeout. By #Notice that for a TimeoutAlert, you pass the number of seconds in
#default, this is 5. #which to timeout. By default, this is 5.
alert = TimeoutAlert(10) alert = TimeoutAlert(10)
alert.props.title=_('Title of Alert Goes Here') alert.props.title=_('Title of Alert Goes Here')
alert.props.msg = _('Text message of timeout alert goes here') alert.props.msg = _('Text message of timeout alert goes here')
alert.connect('response', self._alert_response_cb) alert.connect('response', self._alert_response_cb)
self.add_alert(alert) self.add_alert(alert)
#### Method: _alert_response_cb, called when an alert object throws a response event. #### Method: _alert_response_cb, called when an alert object throws a
response event.
def _alert_response_cb(self, alert, response_id): def _alert_response_cb(self, alert, response_id):
#remove the alert from the screen, since either a response button was clicked or #remove the alert from the screen, since either a response button
#there was a timeout #was clicked or there was a timeout
self.remove_alert(alert) self.remove_alert(alert)
#Do any work that is specific to the type of button clicked. #Do any work that is specific to the type of button clicked.
@ -392,11 +396,12 @@ class NotifyAlert(Alert):
.. code-block:: python .. code-block:: python
from sugar.graphics.alert import NotifyAlert from sugar.graphics.alert import NotifyAlert
... ...
#### Method: _alert_notify, create a Notify alert (with only an 'OK' button) #### Method: _alert_notify, create a Notify alert (with only an 'OK'
button)
# and add it to the UI. # and add it to the UI.
def _alert_notify(self): def _alert_notify(self):
#Notice that for a NotifyAlert, you pass the number of seconds in which to notify. By #Notice that for a NotifyAlert, you pass the number of seconds in
#default, this is 5. #which to notify. By default, this is 5.
alert = NotifyAlert(10) alert = NotifyAlert(10)
alert.props.title=_('Title of Alert Goes Here') alert.props.title=_('Title of Alert Goes Here')
alert.props.msg = _('Text message of notify alert goes here') alert.props.msg = _('Text message of notify alert goes here')