[issue6422] timeit called from within Python should allow autoranging

2009-07-08 Thread Scott David Daniels

Changes by Scott David Daniels :


--
keywords: +patch
Added file: http://bugs.python.org/file14472/timeit.patch

___
Python tracker 
<http://bugs.python.org/issue6422>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6422] timeit called from within Python should allow autoranging

2009-07-07 Thread Scott David Daniels

Scott David Daniels  added the comment:

I've got the code "working" on trunk2 for my tests.
Should I port to py3K before checking in, and give diffs from there, or 
what?

--

___
Python tracker 
<http://bugs.python.org/issue6422>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6422] timeit called from within Python should allow autoranging

2009-07-05 Thread Scott David Daniels

New submission from Scott David Daniels :

timeit.main has a _very_ handy autoranging facility to pick an
appropriate number of repetitions when not specified.  The autoranging
code should be lifted to a method on Timer instances (so non-main code
can use it).  If number is specified as 0 or None, I would like to use
the results of that autoranging code in Timer.repeat and Timer.timeit.

Patch to follow.

--
components: Library (Lib)
messages: 90157
nosy: scott_daniels
severity: normal
status: open
title: timeit called from within Python should allow autoranging
type: feature request
versions: Python 2.7, Python 3.2

___
Python tracker 
<http://bugs.python.org/issue6422>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Scott David Daniels

Scott David Daniels  added the comment:

Help  /  Python31

Instead of docs showing up, all Idle windows closed.
To demonstrate for yourself, edit ~/.idlerc/config-main.cfg
add a line at the end (where additional docs show up), like:
4 = Python31c1;C:/Python31/Doc/python31c1.chm

(where the 4 is just over what you have already).  In my case, I
had a line much like the above left over from the previous candidate.

--Scott David Daniels
scott.dani...@acm.org

--

___
Python tracker 
<http://bugs.python.org/issue6285>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Scott David Daniels

Scott David Daniels  added the comment:

I uninstalled 3.1rc1, installed 3.1rc2, was exercising, and went to look
up something in the docs, and Idle disappeared.  I tried again, same
result.  So I opened a command window, and ran Idle as:
 python -m idlelib.idle
Tried it again and got an error message that I chased down.
Figured out it was an oncovered exception, and 

--Scott David Daniels
scott.dani...@acm.org

--

___
Python tracker 
<http://bugs.python.org/issue6285>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6285] Silent abort on XP help document display

2009-06-14 Thread Scott David Daniels

New submission from Scott David Daniels :

When running Idle on Windows XP, Python 3.1rc2, 
a failure to find an entry in the help documents causes Idle to exit
(with no visible indication of why).  The reason is in a failure of the
call to os.startfile, and apparenly the exception causes Idle to exit
silently.  Here is a patch to .../Lib/idlelib/EditorWindow.py:

@@ -436,20 +436,24 @@ class EditorWindow(object):
 def config_dialog(self, event=None):
 configDialog.ConfigDialog(self.top,'Settings')

 def help_dialog(self, event=None):

fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt')
 textView.view_file(self.top,'Help',fn)

 def python_docs(self, event=None):
-if sys.platform[:3] == 'win':
-os.startfile(self.help_url)
-else:
-webbrowser.open(self.help_url)
+try:
+if sys.platform[:3] == 'win':
+os.startfile(self.help_url)
+else:
+webbrowser.open(self.help_url)
+except EnvironmentError as why:
+tkMessageBox.showerror(title='Document Start Failure',
+   message=str(why), parent=self.text)
 return "break"

 def cut(self,event):
 self.text.event_generate("<>")
 return "break"

 def copy(self,event):
 if not self.text.tag_ranges("sel"):
@@ -741,20 +745,25 @@ class EditorWindow(object):
 # and update the menu dictionary
 self.menudict['help'] = helpmenu

 def __extra_help_callback(self, helpfile):
 "Create a callback with the helpfile value frozen at definition
time"
 def display_extra_help(helpfile=helpfile):
 if not helpfile.startswith(('www', 'http')):
 url = os.path.normpath(helpfile)
-if sys.platform[:3] == 'win':
-os.startfile(helpfile)
-else:
-webbrowser.open(helpfile)
+try:
+if sys.platform[:3] == 'win':
+os.startfile(helpfile)
+else:
+webbrowser.open(helpfile)
+except EnvironmentError as why:
+tkMessageBox.showerror(title='Document Start Failure',
+   message=str(why), parent=self.text)
+return "break"
 return display_extra_help

 def update_recent_files_list(self, new_file=None):
 "Load and update the recent files list and menus"
 rf_list = []
 if os.path.exists(self.recent_files_path):
 rf_list_file = open(self.recent_files_path,'r')
 try:

--
components: IDLE
messages: 89378
nosy: scott_daniels
severity: normal
status: open
title: Silent abort on XP help document display
versions: Python 3.1

___
Python tracker 
<http://bugs.python.org/issue6285>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3926] Idle doesn't obey the new improved warnings arguements

2008-11-23 Thread Scott David Daniels

Scott David Daniels <[EMAIL PROTECTED]> added the comment:

Attached parts.zip -- a zip of updates for Python 2.6 and Python 3.0
against the current source [zip has two 

For Python 2.6:
py26/diff_py26.txt  -- differ against python26-maint tree
py26/PyShell.py -- Replacement file for .../Lib/idlelib/PyShell.py
py26/run.py -- Replacement file for .../Lib/idlelib/run.py

For Python 3.0:
py30/py3k_diff.txt  -- differ against python3k tree
py30/PyShell.py -- Replacement file for .../Lib/idlelib/PyShell.py
py30/run.py -- Replacement file for .../Lib/idlelib/run.py

Added file: http://bugs.python.org/file12113/parts.zip

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3926>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3926] Idle doesn't obey the new improved warnings arguements

2008-09-27 Thread Scott David Daniels

Scott David Daniels <[EMAIL PROTECTED]> added the comment:

Here is a test for the fixes provided.

Added file: http://bugs.python.org/file11637/test_idle_warnings.py

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3926>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3926] Idle doesn't obey the new improved warnings arguements

2008-09-27 Thread Scott David Daniels

Scott David Daniels <[EMAIL PROTECTED]> added the comment:

OK, Issues:
1) warnings.py 
I/O errors in formatwarning will be masked and misinterpreted as
failures to write on stderr, and no output will be attempted.  

2) warnings.py
A line with of whitespace will be shown, rather than suppressed.

3) idlelib/PyShell.py 
idle_show_warning did not take new args to showwarning.
& a repeat of an error much like 1.

3) idlelib/PyShell.py
idle_format_warning did not take new arg to formatwarning.

4) idlelib/PyShell.py
extended_linecache_checkcache did not pass its arg along to 
orig_checkcache.  Had to rename the element in the loop to
avoid trashing the arg.

5) idlelib/run.py
idle_formatwarning_subproc must also follow the new protocol for 
formatwarning.

--
components: +IDLE, Library (Lib)
Added file: http://bugs.python.org/file11636/diff_trunk

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3926>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3926] Idle doesn't obey the new improved warnings arguements

2008-09-23 Thread Scott David Daniels

Scott David Daniels <[EMAIL PROTECTED]> added the comment:

I found that patch, but it confuses showwarning and formatwarning 
parameter changes.

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3926>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3926] Idle doesn't obey the new improved warnings arguements

2008-09-21 Thread Scott David Daniels

New submission from Scott David Daniels <[EMAIL PROTECTED]>:

Idle doesn't accept the new improved warnings arguments, thus escalating
warnings to failures.  This is, I believe, the core reason that Idle was
failing on windows (warnings about deprecated set_daemon call escalated
to a failure).

Files affected: idlelib/PyShell.py and idlelib/run.py

On chasing this, it looks like the code in warnings.py is masking 
IOErrors a little too broadly, so we should probably also narrow the
exception handling in warnings.py

Patch coming, but not ready just yet.

--
messages: 73541
nosy: scott_daniels
severity: normal
status: open
title: Idle doesn't obey the new improved warnings arguements
type: behavior
versions: Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3926>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com