diff options
author | James Simmons <jim@olpc2.simmons> | 2010-03-05 22:17:41 (GMT) |
---|---|---|
committer | James Simmons <jim@olpc2.simmons> | 2010-03-05 22:17:41 (GMT) |
commit | c8833e114e9962b2214c08ed308e6bdfd784a2eb (patch) | |
tree | 98c8b052b26d95faa78eeccdcc55ec254574285e | |
parent | 022a85b2951ac46f0b4540af672f54cb0787f982 (diff) |
Fix bugs found by pychecker.
-rw-r--r-- | Add_Refinements/ReadEtextsActivity2.py | 5 | ||||
-rwxr-xr-x | Adding_TTS/ReadEtextsTTS.py | 5 | ||||
-rw-r--r-- | Adding_TTS/testtts.txt~ | 11 | ||||
-rw-r--r-- | Making_Shared_Activities/ReadEtextsActivity3.py | 7 |
4 files changed, 5 insertions, 23 deletions
diff --git a/Add_Refinements/ReadEtextsActivity2.py b/Add_Refinements/ReadEtextsActivity2.py index 906edac..d11be21 100644 --- a/Add_Refinements/ReadEtextsActivity2.py +++ b/Add_Refinements/ReadEtextsActivity2.py @@ -16,12 +16,9 @@ # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -import sys import os import zipfile -import pygtk import gtk import pango from sugar.activity import activity @@ -253,7 +250,7 @@ class ReadEtextsActivity(activity.Activity): try: f.write(filebytes) finally: - f.close + f.close() def get_saved_page_number(self): global page diff --git a/Adding_TTS/ReadEtextsTTS.py b/Adding_TTS/ReadEtextsTTS.py index 935a0ee..28e3cfd 100755 --- a/Adding_TTS/ReadEtextsTTS.py +++ b/Adding_TTS/ReadEtextsTTS.py @@ -200,7 +200,7 @@ class ReadEtextsActivity(): try: f.write(filebytes) finally: - f.close + f.close() def read_file(self, filename): "Read the Etext file" @@ -251,16 +251,13 @@ class ReadEtextsActivity(): self.textview.set_left_margin(50) self.textview.set_cursor_visible(False) self.textview.connect("key_press_event", self.keypress_cb) - buffer = self.textview.get_buffer() self.font_desc = pango.FontDescription("sans 12") - font_size = self.font_desc.get_size() self.textview.modify_font(self.font_desc) self.show_page(0) self.scrolled_window.add(self.textview) self.window.add(self.scrolled_window) self.textview.show() self.scrolled_window.show() - v_adjustment = self.scrolled_window.get_vadjustment() self.window.show() gtk.main() diff --git a/Adding_TTS/testtts.txt~ b/Adding_TTS/testtts.txt~ deleted file mode 100644 index 38baf0e..0000000 --- a/Adding_TTS/testtts.txt~ +++ /dev/null @@ -1,11 +0,0 @@ -Jane Austen? Why I go so far as to say that any library is a good library that does not contain a volume by Jane Austen. Even if it contains no other book. -- quoted in Remembered Yesterdays, Robert Underwood Johnson - -To me his prose is unreadable -- like Jane Austin's [sic]. No there is a difference. I could read his prose on salary, but not Jane's. Jane is entirely impossible. It seems a great pity that they allowed her to die a natural death. -- Letter to W. D. Howells, 18 January 1909 - -Jane Austen's books, too, are absent from this library. Just that one omission alone would make a fairly good library out of a library that hadn't a book in it. -- Following the Equator - -I haven't any right to criticise books, and I don't do it except when I hate them. I often want to criticise Jane Austen, but her books madden me so that I can't conceal my frenzy from the reader; and therefore I have to stop every time I begin. Everytime I read 'Pride and Prejudice' I want to dig her up and beat her over the skull with her own shin-bone. -- Letter to Joseph Twichell, 13 September 1898 diff --git a/Making_Shared_Activities/ReadEtextsActivity3.py b/Making_Shared_Activities/ReadEtextsActivity3.py index ada9846..5513e2a 100644 --- a/Making_Shared_Activities/ReadEtextsActivity3.py +++ b/Making_Shared_Activities/ReadEtextsActivity3.py @@ -337,7 +337,7 @@ class ReadEtextsActivity(activity.Activity): try: f.write(filebytes) finally: - f.close + f.close() def get_saved_page_number(self): global page @@ -421,17 +421,16 @@ class ReadEtextsActivity(activity.Activity): def write_file(self, filename): "Save meta data for the file." - if self.is_received_document == True: + if self.is_received_document: # This document was given to us by someone, so we have # to save it to the Journal. self.etext_file.seek(0) filebytes = self.etext_file.read() - print 'saving shared document' f = open(filename, 'wb') try: f.write(filebytes) finally: - f.close + f.close() elif self.tempfile: if self.close_requested: os.link(self.tempfile, filename) |