Rev 225: Add docstrings, remove unused code. in file:///data/jelmer/bzr-gtk/trunk/

Jelmer Vernooij jelmer at samba.org
Sun Jul 15 21:53:00 BST 2007


At file:///data/jelmer/bzr-gtk/trunk/

------------------------------------------------------------
revno: 225
revision-id: jelmer at samba.org-20070715152229-clmlen0vpd8d2pzx
parent: jelmer at samba.org-20070715151559-122mfwpoeb0qwqmy
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sun 2007-07-15 18:22:29 +0300
message:
  Add docstrings, remove unused code.
modified:
  history.py                     history.py-20070203142424-98xvm0a59m3gs6g6-1
  ui.py                          ui.py-20060716163355-owuqwa9uhnlfsojs-1
=== modified file 'history.py'
--- a/history.py	2007-02-03 15:04:56 +0000
+++ b/history.py	2007-07-15 15:22:29 +0000
@@ -17,14 +17,30 @@
 delimiter = " "
 
 class UrlHistory:
+    """Simple helper class for storing URL history."""
+
     def __init__(self, config, name):
+        """Access URL History in a Config object.
+
+        :param config: Config object to use
+        :param name: Name of the history variable.
+        """
         self._config = config
         self._name = name
 
     def add_entry(self, url):
-        self._config.set_user_option(self._name, delimiter.join(self.get_entries() + [url]))
+        """Add a new entry to the list.
+
+        :param url: Url to add
+        """
+        self._config.set_user_option(self._name, delimiter.join(
+            self.get_entries() + [url]))
 
     def get_entries(self):
+        """Obtain all URLs currently listed.
+
+        :return list of URLs or empty list if no URLs set yet.
+        """
         history = self._config.get_user_option(self._name)
         if history is None:
             return []

=== modified file 'ui.py'
--- a/ui.py	2007-03-19 01:56:10 +0000
+++ b/ui.py	2007-07-15 15:22:29 +0000
@@ -1,4 +1,5 @@
 # Copyright (C) 2006 Szilveszter Farkas <szilveszter.farkas at gmail.com>
+# Copyright (C) 2007 Jelmer Vernooij <jelmer at samba.org>
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -35,7 +36,8 @@
         
         self.vbox.show_all()
 
-        self.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_YES, gtk.STOCK_NO, gtk.RESPONSE_NO)
+        self.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_YES, gtk.STOCK_NO, 
+                         gtk.RESPONSE_NO)
 
 
 class GtkProgressBar(gtk.ProgressBar):
@@ -117,14 +119,6 @@
 
         """
         super(GtkUIFactory, self).__init__()
-        if stdout is None:
-            self.stdout = sys.stdout
-        else:
-            self.stdout = stdout
-        if stderr is None:
-            self.stderr = sys.stderr
-        else:
-            self.stderr = stderr
         self._progress_bar_stack = None
 
     def get_boolean(self, prompt):




More information about the bazaar-commits mailing list