Commit 231c3c88 authored by Tim Peters's avatar Tim Peters

Add missing svn:eol-style property to text files.

parent 4f96f1f2
""" """
A number of function that enhance IDLE on MacOSX when it used as a normal A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application). GUI application (as opposed to an X11 application).
""" """
import sys import sys
def runningAsOSXApp(): def runningAsOSXApp():
""" Returns True iff running from the IDLE.app bundle on OSX """ """ Returns True iff running from the IDLE.app bundle on OSX """
return (sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0]) return (sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0])
def addOpenEventSupport(root, flist): def addOpenEventSupport(root, flist):
""" """
This ensures that the application will respont to open AppleEvents, which This ensures that the application will respont to open AppleEvents, which
makes is feaseable to use IDLE as the default application for python files. makes is feaseable to use IDLE as the default application for python files.
""" """
def doOpenFile(*args): def doOpenFile(*args):
for fn in args: for fn in args:
flist.open(fn) flist.open(fn)
# The command below is a hook in aquatk that is called whenever the app # The command below is a hook in aquatk that is called whenever the app
# receives a file open event. The callback can have multiple arguments, # receives a file open event. The callback can have multiple arguments,
# one for every file that should be opened. # one for every file that should be opened.
root.createcommand("::tk::mac::OpenDocument", doOpenFile) root.createcommand("::tk::mac::OpenDocument", doOpenFile)
def hideTkConsole(root): def hideTkConsole(root):
root.tk.call('console', 'hide') root.tk.call('console', 'hide')
def setupApp(root, flist): def setupApp(root, flist):
""" """
Perform setup for the OSX application bundle. Perform setup for the OSX application bundle.
""" """
if not runningAsOSXApp(): return if not runningAsOSXApp(): return
hideTkConsole(root) hideTkConsole(root)
addOpenEventSupport(root, flist) addOpenEventSupport(root, flist)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment