[Python-checkins] r65301 - sandbox/trunk/ttk-gsoc/src/idlelib/editorpage.py
guilherme.polo
python-checkins at python.org
Wed Jul 30 14:34:50 CEST 2008
Author: guilherme.polo
Date: Wed Jul 30 14:34:50 2008
New Revision: 65301
Log:
Fixed attempt to load a directory resulting in an error box. Corrected an instance attribute
Modified:
sandbox/trunk/ttk-gsoc/src/idlelib/editorpage.py
Modified: sandbox/trunk/ttk-gsoc/src/idlelib/editorpage.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/idlelib/editorpage.py (original)
+++ sandbox/trunk/ttk-gsoc/src/idlelib/editorpage.py Wed Jul 30 14:34:50 2008
@@ -71,8 +71,9 @@
self.io = IOBinding.IOBinding(self)
self.io.set_filename_change_hook(self.filename_change_hook)
if filename:
- fail = self.io.loadfile(filename)
- if fail:
+ if os.path.exists(filename) and not os.path.isdir(filename):
+ self.io.loadfile(filename)
+ else:
self.io.set_filename(filename)
self.saved_change_hook()
@@ -796,7 +797,7 @@
# to compute ab initio, but is probably already known by the
# platform's colorizer.
def __is_char_in_string(self, text_index):
- if self.editwin.color: # XXX should this attribute be set per page ?
+ if self.color:
# Return true iff colorizer hasn't (re)gotten this far
# yet, or the character is tagged as being in a string
return self.text.tag_prevrange("TODO", text_index) or \
More information about the Python-checkins
mailing list