From: Kevin A. <ka...@us...> - 2004-08-18 16:25:05
|
Update of /cvsroot/pythoncard/PythonCard/tools/codeEditor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15286 Modified Files: Info.plist codeEditor.py macbuild.py Log Message: added MacOpenFile to codeEditor Index: Info.plist =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/Info.plist,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Info.plist 18 Aug 2004 16:03:37 -0000 1.2 --- Info.plist 18 Aug 2004 16:24:56 -0000 1.3 *************** *** 40,45 **** <string>*</string> </array> - <key>CFBundleTypeIconFile</key> - <string>file</string> <key>CFBundleTypeMIMETypes</key> <array> --- 40,43 ---- Index: codeEditor.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/codeEditor.py,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** codeEditor.py 17 Aug 2004 19:11:51 -0000 1.124 --- codeEditor.py 18 Aug 2004 16:24:56 -0000 1.125 *************** *** 1224,1228 **** if __name__ == '__main__': ! app = model.Application(CodeEditor) app.MainLoop() --- 1224,1238 ---- + # KEA 2004-08-18 + # I'll probably move this functionality into model.Application + # and just call a macOpenFile method in the current background + class MyApplication(model.Application): + # support drag and drop on the application icon on the Mac + def MacOpenFile(self, filename): + # code to load filename goes here + self.backgrounds[0].openFile(filename) + + if __name__ == '__main__': ! app = MyApplication(CodeEditor) app.MainLoop() Index: macbuild.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/tools/codeEditor/macbuild.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** macbuild.py 18 Aug 2004 16:03:37 -0000 1.5 --- macbuild.py 18 Aug 2004 16:24:56 -0000 1.6 *************** *** 2,5 **** --- 2,6 ---- import os, sys import bundlebuilder + import plistlib # I set this to make adding subfolders into the package easier *************** *** 26,30 **** myapp.standalone = 1 myapp.name = "CodeEditor" ! myapp.plist = bundlebuilder.Plist.fromFile(os.path.join(packageroot, "Info.plist")) # includePackages forces certain packages to be added to the app bundle --- 27,31 ---- myapp.standalone = 1 myapp.name = "CodeEditor" ! myapp.plist = plistlib.Plist.fromFile(os.path.join(packageroot, "Info.plist")) # includePackages forces certain packages to be added to the app bundle |