API docstrings from pydocweb

This commit is contained in:
David Farning 2008-09-19 19:32:55 -05:00
parent dd7442a0fa
commit 62128530c3
3 changed files with 185 additions and 0 deletions

View File

@ -38,13 +38,39 @@ class Animator(gobject.GObject):
self._start_time = None
def add(self, animation):
"""
Parameter
---------
animation :
"""
self._animations.append(animation)
def remove_all(self):
"""
Parameters
----------
None :
Returns
-------
None :
"""
self.stop()
self._animations = []
def start(self):
"""
Parameters
----------
None :
Returns
-------
None
"""
if self._timeout_sid:
self.stop()
@ -53,6 +79,16 @@ class Animator(gobject.GObject):
int(self._interval * 1000), self._next_frame_cb)
def stop(self):
"""
Parameters
----------
None :
Returns
-------
None :
"""
if self._timeout_sid:
gobject.source_remove(self._timeout_sid)
self._timeout_sid = 0
@ -77,6 +113,19 @@ class Animation(object):
self.end = end
def do_frame(self, t, duration, easing):
"""
Parameters
----------
t:
duration:
easing:
Returns
None:
"""
start = self.start
change = self.end - self.start

View File

@ -36,6 +36,16 @@ class ComboBox(gtk.ComboBox):
self.set_row_separator_func(self._is_separator)
def get_value(self):
"""
Parameters
----------
None :
Returns:
--------
value :
"""
row = self.get_active_item()
if not row:
return None
@ -55,6 +65,22 @@ class ComboBox(gtk.ComboBox):
return fname
def append_item(self, action_id, text, icon_name=None, file_name=None):
"""
Parameters
----------
action_id :
text :
icon_name=None :
file_name=None :
Returns
-------
None
"""
if not self._icon_renderer and (icon_name or file_name):
self._icon_renderer = gtk.CellRendererPixbuf()
@ -89,9 +115,29 @@ class ComboBox(gtk.ComboBox):
self._model.append([action_id, text, pixbuf, False])
def append_separator(self):
"""
Parameters
----------
None
Returns
-------
None
"""
self._model.append([0, None, None, True])
def get_active_item(self):
"""
Parameters
----------
None
Returns
-------
Active_item :
"""
index = self.get_active()
if index == -1:
index = 0
@ -102,6 +148,16 @@ class ComboBox(gtk.ComboBox):
return self._model[row]
def remove_all(self):
"""
Parameters
----------
None
Returns
-------
None
"""
self._model.clear()
def _is_separator(self, model, row):

View File

@ -323,6 +323,16 @@ class Icon(gtk.Image):
self._buffer.file_name = self.props.file
def do_size_request(self, requisition):
"""
Parameters
----------
requisition :
Returns
-------
None
"""
self._sync_image_properties()
surface = self._buffer.get_surface()
if surface:
@ -335,6 +345,16 @@ class Icon(gtk.Image):
requisition[0] = requisition[1] = 0
def do_expose_event(self, event):
"""
Parameters
----------
event :
Returns:
--------
None
"""
self._sync_image_properties()
sensitive = (self.state != gtk.STATE_INSENSITIVE)
surface = self._buffer.get_surface(sensitive, self)
@ -358,6 +378,16 @@ class Icon(gtk.Image):
cr.paint()
def set_xo_color(self, value):
"""
Parameters
----------
value :
Returns
-------
None
"""
if self._buffer.xo_color != value:
self._buffer.xo_color = value
self.queue_draw()
@ -366,28 +396,78 @@ class Icon(gtk.Image):
type=object, getter=None, setter=set_xo_color)
def set_fill_color(self, value):
"""
Parameters
----------
value :
Returns
-------
None
"""
if self._buffer.fill_color != value:
self._buffer.fill_color = value
self.queue_draw()
def get_fill_color(self):
"""
Parameters
----------
None
Returns
-------
fill_color :
"""
return self._buffer.fill_color
fill_color = gobject.property(
type=object, getter=get_fill_color, setter=set_fill_color)
def set_stroke_color(self, value):
"""
Parameters
----------
value :
Returns
-------
None
"""
if self._buffer.stroke_color != value:
self._buffer.stroke_color = value
self.queue_draw()
def get_stroke_color(self):
"""
Parameters
----------
None
Returns
-------
stroke_color :
"""
return self._buffer.stroke_color
stroke_color = gobject.property(
type=object, getter=get_stroke_color, setter=set_stroke_color)
def set_badge_name(self, value):
"""
Parameters
----------
value:
Returns
-------
None
"""
if self._buffer.badge_name != value:
self._buffer.badge_name = value
self.queue_resize()