Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17967/framework
Modified Files:
Tag: py3k
app.py bitmap.py dbgcommands.py dlgappcore.py help.py
interact.py intpyapp.py intpydde.py mdi_pychecker.py
scriptutils.py sgrepmdi.py startup.py stdin.py toolmenu.py
winout.py
Log Message:
Changes for Python 3
Index: intpyapp.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpyapp.py,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -d -r1.11 -r1.11.2.1
*** intpyapp.py 9 Aug 2008 16:47:07 -0000 1.11
--- intpyapp.py 29 Aug 2008 06:16:41 -0000 1.11.2.1
***************
*** 7,15 ****
import sys
import string
! import app
import traceback
from pywin.mfc import window, afxres, dialog
import commctrl
! import dbgcommands
lastLocateFileName = ".py" # used in the "File/Locate" dialog...
--- 7,15 ----
import sys
import string
! from . import app
import traceback
from pywin.mfc import window, afxres, dialog
import commctrl
! from . import dbgcommands
lastLocateFileName = ".py" # used in the "File/Locate" dialog...
***************
*** 47,51 ****
# And a "Tools" menu on the main frame.
menu = self.GetMenu()
! import toolmenu
toolmenu.SetToolsMenu(menu, 2)
# And fix the "Help" menu on the main frame
--- 47,51 ----
# And a "Tools" menu on the main frame.
menu = self.GetMenu()
! from . import toolmenu
toolmenu.SetToolsMenu(menu, 2)
# And fix the "Help" menu on the main frame
***************
*** 128,133 ****
# Return None if no existing instance
try:
! import intpydde
except ImportError:
# No dde support!
return None
--- 128,134 ----
# Return None if no existing instance
try:
! from . import intpydde
except ImportError:
+ traceback.print_exc()
# No dde support!
return None
***************
*** 144,148 ****
# remote DDE app, and we should terminate.
try:
! import intpydde
except ImportError:
self.ddeServer = None
--- 145,149 ----
# remote DDE app, and we should terminate.
try:
! from . import intpydde
except ImportError:
self.ddeServer = None
***************
*** 177,183 ****
# Allow Pythonwin to host OCX controls.
win32ui.EnableControlContainer()
!
! # Display the interactive window if the user wants it.
! import interact
interact.CreateInteractiveWindowUserPreference()
--- 178,182 ----
# Allow Pythonwin to host OCX controls.
win32ui.EnableControlContainer()
! from . import interact
interact.CreateInteractiveWindowUserPreference()
***************
*** 206,210 ****
win32ui.DestroyDebuggerThread()
try:
! import interact
interact.DestroyInteractiveWindow()
except:
--- 205,209 ----
win32ui.DestroyDebuggerThread()
try:
! from . import interact
interact.DestroyInteractiveWindow()
except:
***************
*** 238,247 ****
argType = args[0]
if argStart >= len(args):
! raise TypeError, "The command line requires an additional arg."
if argType=="/edit":
# Load up the default application.
if dde:
fname = win32api.GetFullPathName(args[argStart])
! dde.Exec("win32ui.GetApp().OpenDocumentFile(%s)" % (`fname`))
else:
win32ui.GetApp().OpenDocumentFile(args[argStart])
--- 237,246 ----
argType = args[0]
if argStart >= len(args):
! raise TypeError("The command line requires an additional arg.")
if argType=="/edit":
# Load up the default application.
if dde:
fname = win32api.GetFullPathName(args[argStart])
! dde.Exec("win32ui.GetApp().OpenDocumentFile(%s)" % (repr(fname)))
else:
win32ui.GetApp().OpenDocumentFile(args[argStart])
***************
*** 250,254 ****
dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 1)" % (args[argStart], ' '.join(args[argStart+1:])))
else:
! import scriptutils
scriptutils.RunScript(args[argStart], ' '.join(args[argStart+1:]))
elif argType=="/run":
--- 249,253 ----
dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 1)" % (args[argStart], ' '.join(args[argStart+1:])))
else:
! from . import scriptutils
scriptutils.RunScript(args[argStart], ' '.join(args[argStart+1:]))
elif argType=="/run":
***************
*** 256,263 ****
dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 0)" % (args[argStart], ' '.join(args[argStart+1:])))
else:
! import scriptutils
scriptutils.RunScript(args[argStart], ' '.join(args[argStart+1:]), 0)
elif argType=="/app":
! raise RuntimeError, "/app only supported for new instances of Pythonwin.exe"
elif argType=='/new': # Allow a new instance of Pythonwin
return 1
--- 255,262 ----
dde.Exec("import scriptutils;scriptutils.RunScript('%s', '%s', 0)" % (args[argStart], ' '.join(args[argStart+1:])))
else:
! from . import scriptutils
scriptutils.RunScript(args[argStart], ' '.join(args[argStart+1:]), 0)
elif argType=="/app":
! raise RuntimeError("/app only supported for new instances of Pythonwin.exe")
elif argType=='/new': # Allow a new instance of Pythonwin
return 1
***************
*** 268,277 ****
win32ui.MessageBox("The /dde command can only be used\r\nwhen Pythonwin is already running")
else:
! raise TypeError, "Command line arguments not recognised"
except:
typ, val, tb = sys.exc_info()
! print "There was an error processing the command line args"
traceback.print_exception(typ, val, tb, None, sys.stdout)
! win32ui.OutputDebug("There was a problem with the command line args - %s: %s" % (`typ`,`val`))
tb = None # Prevent a cycle
--- 267,276 ----
win32ui.MessageBox("The /dde command can only be used\r\nwhen Pythonwin is already running")
else:
! raise TypeError("Command line arguments not recognised")
except:
typ, val, tb = sys.exc_info()
! print("There was an error processing the command line args")
traceback.print_exception(typ, val, tb, None, sys.stdout)
! win32ui.OutputDebug("There was a problem with the command line args - %s: %s" % (repr(typ),repr(val)))
tb = None # Prevent a cycle
***************
*** 292,300 ****
for module in modules:
try:
! exec "import "+module
except: # Catch em all, else the app itself dies! 'ImportError:
traceback.print_exc()
msg = 'Startup import of user module "%s" failed' % module
! print msg
win32ui.MessageBox(msg)
--- 291,299 ----
for module in modules:
try:
! exec("from . import "+module)
except: # Catch em all, else the app itself dies! 'ImportError:
traceback.print_exc()
msg = 'Startup import of user module "%s" failed' % module
! print(msg)
win32ui.MessageBox(msg)
***************
*** 303,312 ****
#
def OnDDECommand(self, command):
! # print "DDE Executing", `command`
try:
! exec command + "\n"
except:
! print "ERROR executing DDE command: ", command
! traceback.print_exc()
raise
--- 302,312 ----
#
def OnDDECommand(self, command):
! print ("DDE Executing", repr(command))
try:
! exec(command + "\n")
except:
! t,v,tb=sys.exc_info()
! print("ERROR executing DDE command: ", command)
! traceback.print_exception(t,v,tb)
raise
***************
*** 333,351 ****
def OnFileImport( self, id, code ):
" Called when a FileImport message is received. Import the current or specified file"
! import scriptutils
scriptutils.ImportFile()
def OnFileCheck( self, id, code ):
" Called when a FileCheck message is received. Check the current file."
! import scriptutils
scriptutils.CheckFile()
def OnUpdateFileCheck(self, cmdui):
! import scriptutils
cmdui.Enable( scriptutils.GetActiveFileName(0) is not None )
def OnFileRun( self, id, code ):
" Called when a FileRun message is received. "
! import scriptutils
showDlg = win32api.GetKeyState(win32con.VK_SHIFT) >= 0
scriptutils.RunScript(None, None, showDlg)
--- 333,351 ----
def OnFileImport( self, id, code ):
" Called when a FileImport message is received. Import the current or specified file"
! from . import scriptutils
scriptutils.ImportFile()
def OnFileCheck( self, id, code ):
" Called when a FileCheck message is received. Check the current file."
! from . import scriptutils
scriptutils.CheckFile()
def OnUpdateFileCheck(self, cmdui):
! from . import scriptutils
cmdui.Enable( scriptutils.GetActiveFileName(0) is not None )
def OnFileRun( self, id, code ):
" Called when a FileRun message is received. "
! from . import scriptutils
showDlg = win32api.GetKeyState(win32con.VK_SHIFT) >= 0
scriptutils.RunScript(None, None, showDlg)
***************
*** 353,357 ****
def OnFileLocate( self, id, code ):
from pywin.mfc import dialog
! import scriptutils
import os
global lastLocateFileName # save the new version away for next time...
--- 353,357 ----
def OnFileLocate( self, id, code ):
from pywin.mfc import dialog
! from . import scriptutils
import os
global lastLocateFileName # save the new version away for next time...
***************
*** 382,387 ****
from pywin.dialogs import ideoptions
sheet.AddPage( ideoptions.OptionsPropPage() )
!
! import toolmenu
sheet.AddPage( toolmenu.ToolMenuPropPage() )
--- 382,386 ----
from pywin.dialogs import ideoptions
sheet.AddPage( ideoptions.OptionsPropPage() )
! from . import toolmenu
sheet.AddPage( toolmenu.ToolMenuPropPage() )
***************
*** 416,420 ****
def OnInteractiveWindow(self, id, code):
# toggle the existing state.
! import interact
interact.ToggleInteractiveWindow()
--- 415,419 ----
def OnInteractiveWindow(self, id, code):
# toggle the existing state.
! from . import interact
interact.ToggleInteractiveWindow()
***************
*** 431,436 ****
# Only attempt to save editor documents.
from pywin.framework.editor import editorTemplate
! docs = filter(lambda doc: doc.IsModified() and doc.GetPathName(), editorTemplate.GetDocumentList())
! map(lambda doc: doc.OnSaveDocument(doc.GetPathName()), docs)
win32ui.SetStatusText("%d documents saved" % len(docs), 1)
--- 430,435 ----
# Only attempt to save editor documents.
from pywin.framework.editor import editorTemplate
! docs = [doc for doc in editorTemplate.GetDocumentList() if doc.IsModified() and doc.GetPathName()]
! list(map(lambda doc: doc.OnSaveDocument(doc.GetPathName()), docs))
win32ui.SetStatusText("%d documents saved" % len(docs), 1)
***************
*** 444,448 ****
def OnHelpIndex( self, id, code ):
! import help
help.SelectAndRunHelpFile()
--- 443,447 ----
def OnHelpIndex( self, id, code ):
! from . import help
help.SelectAndRunHelpFile()
Index: mdi_pychecker.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/mdi_pychecker.py,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** mdi_pychecker.py 9 Aug 2008 16:47:07 -0000 1.2
--- mdi_pychecker.py 29 Aug 2008 06:16:42 -0000 1.2.2.1
***************
*** 39,43 ****
import win32con
import sys, string, re, glob, os, stat, time
! import scriptutils
def getsubdirs(d):
--- 39,43 ----
import win32con
import sys, string, re, glob, os, stat, time
! from . import scriptutils
def getsubdirs(d):
***************
*** 57,61 ****
if os.path.isdir(d):
d = d.lower()
! if not dirs.has_key(d):
dirs[d] = None
if recurse:
--- 57,61 ----
if os.path.isdir(d):
d = d.lower()
! if d not in dirs:
dirs[d] = None
if recurse:
***************
*** 63,67 ****
for sd in subdirs:
sd = sd.lower()
! if not dirs.has_key(sd):
dirs[sd] = None
elif os.path.isfile(d):
--- 63,67 ----
for sd in subdirs:
sd = sd.lower()
! if sd not in dirs:
dirs[sd] = None
elif os.path.isfile(d):
***************
*** 69,73 ****
else:
x = None
! if os.environ.has_key(d):
x = dirpath(os.environ[d])
elif d[:5] == 'HKEY_':
--- 69,73 ----
else:
x = None
! if d in os.environ:
x = dirpath(os.environ[d])
elif d[:5] == 'HKEY_':
***************
*** 90,94 ****
if x:
for xd in x:
! if not dirs.has_key(xd):
dirs[xd] = None
if recurse:
--- 90,94 ----
if x:
for xd in x:
! if xd not in dirs:
dirs[xd] = None
if recurse:
***************
*** 96,103 ****
for sd in subdirs:
sd = sd.lower()
! if not dirs.has_key(sd):
dirs[sd] = None
self.dirs = []
! for d in dirs.keys():
self.dirs.append(d)
--- 96,103 ----
for sd in subdirs:
sd = sd.lower()
! if sd not in dirs:
dirs[sd] = None
self.dirs = []
! for d in list(dirs.keys()):
self.dirs.append(d)
***************
*** 248,252 ****
self.GetFirstView().Append('#Pychecker Run in '+self.dirpattern+' %s\n'%time.asctime())
if self.verbose:
! self.GetFirstView().Append('# ='+`self.dp.dirs`+'\n')
self.GetFirstView().Append('# Files '+self.filpattern+'\n')
self.GetFirstView().Append('# Options '+self.greppattern+'\n')
--- 248,252 ----
self.GetFirstView().Append('#Pychecker Run in '+self.dirpattern+' %s\n'%time.asctime())
if self.verbose:
! self.GetFirstView().Append('# ='+repr(self.dp.dirs)+'\n')
self.GetFirstView().Append('# Files '+self.filpattern+'\n')
self.GetFirstView().Append('# Options '+self.greppattern+'\n')
***************
*** 262,266 ****
##self.flist = glob.glob(self.dp[0]+'\\'+self.fplist[0])
import operator
! self.flist = reduce(operator.add, map(glob.glob,self.fplist) )
#import pywin.debugger;pywin.debugger.set_trace()
self.startPycheckerRun()
--- 262,266 ----
##self.flist = glob.glob(self.dp[0]+'\\'+self.fplist[0])
import operator
! self.flist = reduce(operator.add, list(map(glob.glob,self.fplist)) )
#import pywin.debugger;pywin.debugger.set_trace()
self.startPycheckerRun()
***************
*** 276,281 ****
old=win32api.SetCursor(win32api.LoadCursor(0, win32con.IDC_APPSTARTING))
win32ui.GetApp().AddIdleHandler(self.idleHandler)
! import thread
! thread.start_new(self.threadPycheckerRun,())
##win32api.SetCursor(old)
def threadPycheckerRun(self):
--- 276,281 ----
old=win32api.SetCursor(win32api.LoadCursor(0, win32con.IDC_APPSTARTING))
win32ui.GetApp().AddIdleHandler(self.idleHandler)
! import _thread
! _thread.start_new(self.threadPycheckerRun,())
##win32api.SetCursor(old)
def threadPycheckerRun(self):
***************
*** 313,317 ****
finally:
self.result=result
! print '== Pychecker run finished =='
self.GetFirstView().Append('\n'+'== Pychecker run finished ==')
self.SetModifiedFlag(0)
--- 313,317 ----
finally:
self.result=result
! print('== Pychecker run finished ==')
self.GetFirstView().Append('\n'+'== Pychecker run finished ==')
self.SetModifiedFlag(0)
***************
*** 327,331 ****
line = lines[i]
if self.pat.search(line) != None:
! self.GetFirstView().Append(f+'('+`i+1` + ') '+line)
else:
self.fndx = -1
--- 327,331 ----
line = lines[i]
if self.pat.search(line) != None:
! self.GetFirstView().Append(f+'('+repr(i+1) + ') '+line)
else:
self.fndx = -1
***************
*** 349,353 ****
def GetParams(self):
! return self.dirpattern+'\t'+self.filpattern+'\t'+self.greppattern+'\t'+`self.casesensitive`+'\t'+`self.recurse`+'\t'+`self.verbose`
def OnSaveDocument(self, filename):
--- 349,353 ----
def GetParams(self):
! return self.dirpattern+'\t'+self.filpattern+'\t'+self.greppattern+'\t'+repr(self.casesensitive)+'\t'+repr(self.recurse)+'\t'+repr(self.verbose)
def OnSaveDocument(self, filename):
***************
*** 557,561 ****
items = items + newitems
for item in items:
! win32api.WriteProfileVal(section, `i`, item, ini)
i = i + 1
self.UpdateData(0)
--- 557,561 ----
items = items + newitems
for item in items:
! win32api.WriteProfileVal(section, repr(i), item, ini)
i = i + 1
self.UpdateData(0)
Index: startup.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/startup.py,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -d -r1.4 -r1.4.2.1
*** startup.py 9 Aug 2008 18:37:22 -0000 1.4
--- startup.py 29 Aug 2008 06:16:42 -0000 1.4.2.1
***************
*** 38,43 ****
sys.appargv = sys.argv[:]
# Must check for /app param here.
! if len(sys.argv)>=2 and sys.argv[0].lower()=='/app':
! import cmdline
moduleName = cmdline.FixArgFileName(sys.argv[1])
sys.appargvoffset = 2
--- 38,43 ----
sys.appargv = sys.argv[:]
# Must check for /app param here.
! if len(sys.argv)>=2 and sys.argv[0].lower()=='/app':
! from . import cmdline
moduleName = cmdline.FixArgFileName(sys.argv[1])
sys.appargvoffset = 2
***************
*** 46,50 ****
sys.argv = newargv
! exec "import %s\n" % moduleName
try:
--- 46,50 ----
sys.argv = newargv
! from . import intpyapp
try:
***************
*** 55,61 ****
# that does exist does not have a Python class (ie, was created
# by the host .EXE). In this case, we do the "old style" init...
! import app
if app.AppBuilder is None:
! raise TypeError, "No application object has been registered"
app.App = app.AppBuilder()
--- 55,61 ----
# that does exist does not have a Python class (ie, was created
# by the host .EXE). In this case, we do the "old style" init...
! from . import app
if app.AppBuilder is None:
! raise TypeError("No application object has been registered")
app.App = app.AppBuilder()
Index: stdin.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/stdin.py,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** stdin.py 9 Aug 2008 16:47:07 -0000 1.3
--- stdin.py 29 Aug 2008 06:16:42 -0000 1.3.2.1
***************
*** 22,26 ****
true = 1
false = 0
! get_input_line = raw_input
class Stdin:
--- 22,28 ----
true = 1
false = 0
!
! import code
! get_input_line = code.InteractiveConsole.raw_input
class Stdin:
***************
*** 110,114 ****
"""
line = get_input_line()
! print '>>>',line # echo input to console
self.buffer = self.buffer + line + '\n'
--- 112,116 ----
"""
line = get_input_line()
! print('>>>',line) # echo input to console
self.buffer = self.buffer + line + '\n'
***************
*** 120,124 ****
"""
if self.closed:
! return apply(self.real_file.readlines, sizehint)
result = []
--- 122,126 ----
"""
if self.closed:
! return self.real_file.readlines(*sizehint)
result = []
***************
*** 159,163 ****
test_input = test_input[end_of_line_pos + 1:]
if len(result) == 0 or result[0] == '~':
! raise 'EOF'
return result
--- 161,165 ----
test_input = test_input[end_of_line_pos + 1:]
if len(result) == 0 or result[0] == '~':
! raise EOFError
return result
***************
*** 167,176 ****
try:
x = Stdin()
! print x.read()
! print x.readline()
! print x.read(12)
! print x.readline(47)
! print x.readline(3)
! print x.readlines()
finally:
get_input_line = raw_input
--- 169,178 ----
try:
x = Stdin()
! print(x.read())
! print(x.readline())
! print(x.read(12))
! print(x.readline(47))
! print(x.readline(3))
! print(x.readlines())
finally:
get_input_line = raw_input
Index: interact.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/interact.py,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** interact.py 9 Aug 2008 16:47:07 -0000 1.17
--- interact.py 29 Aug 2008 06:16:41 -0000 1.17.2.1
***************
*** 28,33 ****
trace=pywin.scintilla.formatter.trace
!
! import winout
import re
--- 28,32 ----
trace=pywin.scintilla.formatter.trace
! from . import winout
import re
***************
*** 229,233 ****
styleStart = STYLE_INTERACTIVE_BANNER
self.scintilla.SCIStartStyling(start, 31)
! self.style_buffer = array.array("c", chr(0)*len(stringVal))
self.ColorizeInteractiveCode(stringVal, styleStart, stylePyStart)
self.scintilla.SCISetStylingEx(self.style_buffer)
--- 228,232 ----
styleStart = STYLE_INTERACTIVE_BANNER
self.scintilla.SCIStartStyling(start, 31)
! self.style_buffer = array.array("b", (0,)*len(stringVal))
self.ColorizeInteractiveCode(stringVal, styleStart, stylePyStart)
self.scintilla.SCISetStylingEx(self.style_buffer)
***************
*** 255,259 ****
def runcode(self, code):
try:
! exec code in self.globals, self.locals
except SystemExit:
raise
--- 254,258 ----
def runcode(self, code):
try:
! exec(code, self.globals, self.locals)
except SystemExit:
raise
***************
*** 305,314 ****
if pywin.is_platform_unicode:
try:
! line = unicode(line, pywin.default_scintilla_encoding).encode(pywin.default_platform_encoding)
except:
# We should fix the underlying problem rather than always masking errors
# so make it complain.
! print "Unicode error converting", repr(line)
! line = unicode(line, pywin.default_scintilla_encoding, "ignore").encode(pywin.default_platform_encoding)
while line and line[-1] in ['\r', '\n']:
--- 304,313 ----
if pywin.is_platform_unicode:
try:
! line = str(line, pywin.default_scintilla_encoding).encode(pywin.default_platform_encoding)
except:
# We should fix the underlying problem rather than always masking errors
# so make it complain.
! print("Unicode error converting", repr(line))
! line = str(line, pywin.default_scintilla_encoding, "ignore").encode(pywin.default_platform_encoding)
while line and line[-1] in ['\r', '\n']:
***************
*** 331,335 ****
return
terms = (["\n" + sys.ps2] * (len(bufLines)-1)) + ['']
! for bufLine, term in map(None, bufLines, terms):
if bufLine.strip():
self.write( bufLine + term )
--- 330,334 ----
return
terms = (["\n" + sys.ps2] * (len(bufLines)-1)) + ['']
! for bufLine, term in zip(bufLines, terms):
if bufLine.strip():
self.write( bufLine + term )
***************
*** 541,545 ****
win32clipboard.OpenClipboard()
try:
! win32clipboard.SetClipboardData(win32clipboard.CF_UNICODETEXT, unicode(out_code))
finally:
win32clipboard.CloseClipboard()
--- 540,544 ----
win32clipboard.OpenClipboard()
try:
! win32clipboard.SetClipboardData(win32clipboard.CF_UNICODETEXT, out_code)
finally:
win32clipboard.CloseClipboard()
***************
*** 556,560 ****
try:
o=compile(code, '<clipboard>', 'exec')
! exec o in __main__.__dict__
except:
traceback.print_exc()
--- 555,559 ----
try:
o=compile(code, '<clipboard>', 'exec')
! exec(o, __main__.__dict__)
except:
traceback.print_exc()
***************
*** 606,610 ****
win32ui.SetStatusText("The last active Window has been closed.")
except AttributeError:
! print "Can't find the last active window!"
lastActive = None
if lastActive is not None:
--- 605,609 ----
win32ui.SetStatusText("The last active Window has been closed.")
except AttributeError:
! print("Can't find the last active window!")
lastActive = None
if lastActive is not None:
Index: app.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/app.py,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -C2 -d -r1.14 -r1.14.2.1
*** app.py 11 Aug 2008 00:38:28 -0000 1.14
--- app.py 29 Aug 2008 06:16:41 -0000 1.14.2.1
***************
*** 13,17 ****
from pywin.mfc import window, dialog, thread, afxres
import traceback
! from pywin.framework import scriptutils
## NOTE: App and AppBuild should NOT be used - instead, you should contruct your
--- 13,17 ----
from pywin.mfc import window, dialog, thread, afxres
import traceback
! from . import scriptutils
## NOTE: App and AppBuild should NOT be used - instead, you should contruct your
***************
*** 25,32 ****
# Helpers that should one day be removed!
def AddIdleHandler(handler):
! print "app.AddIdleHandler is deprecated - please use win32ui.GetApp().AddIdleHandler() instead."
return win32ui.GetApp().AddIdleHandler(handler)
def DeleteIdleHandler(handler):
! print "app.DeleteIdleHandler is deprecated - please use win32ui.GetApp().DeleteIdleHandler() instead."
return win32ui.GetApp().DeleteIdleHandler(handler)
--- 25,32 ----
# Helpers that should one day be removed!
def AddIdleHandler(handler):
! print("app.AddIdleHandler is deprecated - please use win32ui.GetApp().AddIdleHandler() instead.")
return win32ui.GetApp().AddIdleHandler(handler)
def DeleteIdleHandler(handler):
! print("app.DeleteIdleHandler is deprecated - please use win32ui.GetApp().DeleteIdleHandler() instead.")
return win32ui.GetApp().DeleteIdleHandler(handler)
***************
*** 169,175 ****
thisRet = handler(handler, count)
except:
! print "Idle handler %s failed" % (`handler`)
traceback.print_exc()
! print "Idle handler removed from list"
try:
self.DeleteIdleHandler(handler)
--- 169,175 ----
thisRet = handler(handler, count)
except:
! print("Idle handler %s failed" % (repr(handler)))
traceback.print_exc()
! print("Idle handler removed from list")
try:
self.DeleteIdleHandler(handler)
***************
*** 206,210 ****
win32ui.MessageBox("The help file is not registered!")
else:
! import help
help.OpenHelpFile(helpFile, helpCmd)
except:
--- 206,210 ----
win32ui.MessageBox("The help file is not registered!")
else:
! from . import help
help.OpenHelpFile(helpFile, helpCmd)
except:
***************
*** 365,382 ****
ret=dialog.GetSimpleInput(prompt)
if ret==None:
! raise KeyboardInterrupt, "operation cancelled"
return ret
def Win32Input(prompt=None):
"Provide input() for gui apps"
! return eval(raw_input(prompt))
! sys.modules['__builtin__'].raw_input=Win32RawInput
! sys.modules['__builtin__'].input=Win32Input
def HaveGoodGUI():
"""Returns true if we currently have a good gui available.
"""
! return sys.modules.has_key("pywin.framework.startup")
def CreateDefaultGUI( appClass = None):
--- 365,386 ----
ret=dialog.GetSimpleInput(prompt)
if ret==None:
! raise KeyboardInterrupt("operation cancelled")
return ret
def Win32Input(prompt=None):
"Provide input() for gui apps"
! return eval(input(prompt))
!
! ## sys.modules['__builtin__'].raw_input=Win32RawInput
! ## sys.modules['__builtin__'].input=Win32Input
! import code
! code.InteractiveConsole.raw_input=Win32RawInput
! code.InteractiveConsole.input=Win32Input
def HaveGoodGUI():
"""Returns true if we currently have a good gui available.
"""
! return "pywin.framework.startup" in sys.modules
def CreateDefaultGUI( appClass = None):
***************
*** 384,388 ****
"""
if appClass is None:
! import intpyapp # Bring in the default app - could be param'd later.
appClass = intpyapp.InteractivePythonApp
# Create and init the app.
--- 388,392 ----
"""
if appClass is None:
! from . import intpyapp # Bring in the default app - could be param'd later.
appClass = intpyapp.InteractivePythonApp
# Create and init the app.
Index: sgrepmdi.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/sgrepmdi.py,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -d -r1.7 -r1.7.2.1
*** sgrepmdi.py 9 Aug 2008 16:47:07 -0000 1.7
--- sgrepmdi.py 29 Aug 2008 ...
[truncated message content] |