[Pkg-bazaar-commits] ./bzr-gtk/unstable r322: Add docstrings.
Jelmer Vernooij
jelmer at samba.org
Fri Apr 10 07:45:20 UTC 2009
------------------------------------------------------------
revno: 322
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Wed 2007-10-24 20:03:11 +0200
message:
Add docstrings.
modified:
viz/branchwin.py
viz/treeview.py
-------------- next part --------------
=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py 2007-10-21 16:55:31 +0000
+++ b/viz/branchwin.py 2007-10-24 18:03:11 +0000
@@ -30,6 +30,14 @@
"""
def __init__(self, branch, start, maxnum, parent=None):
+ """Create a new BranchWindow.
+
+ :param branch: Branch object for branch to show.
+ :param start: Revision id of top revision.
+ :param maxnum: Maximum number of revisions to display,
+ None for no limit.
+ """
+
Window.__init__(self, parent=parent)
self.set_border_width(0)
=== modified file 'viz/treeview.py'
--- a/viz/treeview.py 2007-10-21 16:29:25 +0000
+++ b/viz/treeview.py 2007-10-24 18:03:11 +0000
@@ -30,6 +30,13 @@
}
def __init__(self, branch, start, maxnum):
+ """Create a new TreeView.
+
+ :param branch: Branch object for branch to show.
+ :param start: Revision id of top revision.
+ :param maxnum: Maximum number of revisions to display,
+ None for no limit.
+ """
gtk.ScrolledWindow.__init__(self)
self.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
@@ -49,19 +56,33 @@
self.connect('destroy', lambda w: self.branch.unlock())
def get_revision(self):
+ """Return revision id of currently selected revision, or None."""
return self.revision
def set_revision(self, revid):
+ """Change the currently selected revision.
+
+ :param revid: Revision id of revision to display.
+ """
self.treeview.set_cursor(self.index[revid])
self.treeview.grab_focus()
def get_children(self):
+ """Return the children of the currently selected revision.
+
+ :return: list of revision ids.
+ """
return self.children
def get_parents(self):
+ """Return the parents of the currently selected revision.
+
+ :return: list of revision ids.
+ """
return self.parents
def back(self):
+ """Signal handler for the Back button."""
(path, col) = self.treeview.get_cursor()
revision = self.model[path][treemodel.REVISION]
parents = self.model[path][treemodel.PARENTS]
@@ -79,6 +100,7 @@
self.treeview.grab_focus()
def forward(self):
+ """Signal handler for the Forward button."""
(path, col) = self.treeview.get_cursor()
revision = self.model[path][treemodel.REVISION]
children = self.model[path][treemodel.CHILDREN]
@@ -96,6 +118,12 @@
self.treeview.grab_focus()
def populate(self, start, maxnum):
+ """Fill the treeview with contents.
+
+ :param start: Revision id of revision to start with.
+ :param maxnum: Maximum number of revisions to display, or None
+ for no limit.
+ """
(linegraphdata, index, columns_len) = linegraph(self.branch,
start,
maxnum)
More information about the Pkg-bazaar-commits
mailing list