Commit Graph

272 Commits

Author SHA1 Message Date
Jack Jansen 0194ad5c7d Got the first MacPython module working under MacOSX/MachO (gestalt). Main changes
are including Carbon/Carbon.h in stead of the old headers (unless WITHOUT_FRAMEWORKS
is defined, as it will be for classic MacPython) and selectively disabling all the
stuff that is unneeded in a unix-Python (event handling, etc).
2001-05-12 22:46:35 +00:00
Jack Jansen 6e68a7e74f Be more sensible about when to use TARGET_API_MAC_OS8 in stead of !TARGET_API_MAC_CARBON. This should greatly facilitate porting stuff to OSX in its MachO/BSD incarnation. 2001-05-12 21:31:34 +00:00
Jack Jansen 15f1c08d96 - Raise console window on input. Fixes Carbon hang.
- Better handling of menu bar save/restore.
- Override abort() so it honours the "keep console window" flag.
2001-04-25 22:07:27 +00:00
Jack Jansen c6cecf55d1 Reset the resource file chain before calling PyMac_OpenPrefFile. I'm not sure why this wasn't a problem before... 2001-02-28 15:54:18 +00:00
Jack Jansen add8b246f6 Release a PYC resource after reading it. No need to keep it incore. 2001-02-21 15:48:19 +00:00
Jack Jansen 657ba27dde More changes to attempt to get the menubar back on exit. Without success:-( 2001-02-17 22:02:07 +00:00
Jack Jansen fab7415831 Made version string shorter for Carbon so it fits on one line. 2001-02-17 22:00:43 +00:00
Jack Jansen 8a38714ba0 Bit the bullet and added a private GUSISIOUX for Python. This makes the delayconsole and keepopen code neater. Also tells Sioux to behave better with events, and handles cmd-. during print better. The pythonpreferences have also changed due to this. 2001-02-11 01:08:04 +00:00
Jack Jansen 340eb88fa8 On MacOSX StackSpace() may lie because it doesn't know about the stack rlimit. For now we set a hard limit of 256K (default rlimit is 512K). 2001-02-02 22:40:28 +00:00
Jack Jansen c00df0bbba Trigger keep-console-open on GUSISIOUX_STATE_UNKNOWN. Better than the previous complicated expression. 2001-01-16 15:54:58 +00:00
Jack Jansen d7b68021ce Fixed Carbon command-dot handling. There is still a problem, though, and you may have to hit it repeatedly. 2001-01-12 23:42:28 +00:00
Jack Jansen 8e0ee7761d Got rid of ifdefs to enable MacTCP GUSI support, Open Transport always works fine nowadays. 2001-01-12 23:41:46 +00:00
Jack Jansen 264630e855 When compiling for GUSI and Carbon disable te "keep open on unseen output", for the time being. 2001-01-11 23:04:32 +00:00
Jack Jansen 6ba34aa07f Disabled a few other routines that are available in CarbonLib. 2001-01-11 23:03:56 +00:00
Jack Jansen ebadcb1c1d FSSpec names may be longer on carbon (1024 chars), cater for that in buffer sizes. 2001-01-09 22:25:49 +00:00
Jack Jansen 91faef83ca Don't need to define c2pstrcpy() on Carbon: it's in CarbonLib. 2001-01-09 22:24:56 +00:00
Jack Jansen 6ff228c6d2 If we're not using GUSI the "keep open on unseen output" becomes the same as "always keep open". 2001-01-09 22:24:06 +00:00
Jack Jansen 5afad8315b Added a c2pstrcpy() function. 2000-12-12 22:12:14 +00:00
Jack Jansen 8413b47ba7 Added PyMac_OutputSeen(), which acknowledges all current output in the stdio window, i.e. it acts like input has been read insofar as the keep-console-open option is interested. 2000-10-19 22:02:16 +00:00
Jack Jansen dc86f9ebf9 Made options global (as PyMac_options) so macosmodule can access it. 2000-10-12 21:23:19 +00:00
Jack Jansen 4a5eb967b8 Keepconsole is now a 4-way option: never/errorexit/unseen output/always. Default is "unseen output". Upped the Popt version number. 2000-09-22 21:50:11 +00:00
Jack Jansen 53bafd97d0 PyOS_CheckStack now understands multiple threads. Other threads are not stack-checked, but at least they don't appear to always be out of stack. 2000-09-08 22:05:48 +00:00
Jack Jansen 65c3ee0f66 Use same short banner message as unix/win Python. 2000-09-08 10:20:37 +00:00
Jack Jansen 6be3480083 Removed debug output. 2000-08-25 21:58:00 +00:00
Jack Jansen 14a9171cff Cheaper implementation of PyOS_CheckStack: only call StackSpace once and keep a sentinel in a static variable. 2000-08-25 21:57:23 +00:00
Jack Jansen fb106c8c2f Removed temporary code to disable OT networking (this was a workaround for getpeername() not working in a previous release of GUSI, but it has been fixed). 2000-08-17 20:04:26 +00:00
Jack Jansen d843a018e9 Removed temporary code that always set creator to SimpleText. 2000-08-17 20:01:24 +00:00
Jack Jansen 5bdbabd203 Added more prototypes. 2000-07-24 19:52:52 +00:00
Jack Jansen 1f9f2f4c49 Added PyMac_getscript() which returns the pythonic name of the current script. Not ideal and not complete, but good enough for the time being. Idea and most of the code by Fredrik Lund. 2000-07-24 19:50:16 +00:00
Jack Jansen 660bb1d1c7 MacPython on MacOSX DP4 gets started in the wrong directory. The workaround (ifdeffed by USE_ARGV0_CHDIR) is to do a chdir() to the folder part of our executable name. 2000-07-18 09:40:39 +00:00
Jack Jansen 74a1e63a89 Test for TARGET_API_MAC_CARBON with #if in stead of #ifdef. 2000-07-14 22:37:27 +00:00
Jack Jansen 41e25cc317 include macdefs.h for declaration of getwd, if non-gusi python. 2000-07-14 22:16:01 +00:00
Jack Jansen bb7e213a8b PyMac_PromptGetFile and PyMac_GetDirectory don't exist in carbonpython. 2000-07-14 22:15:24 +00:00
Jack Jansen e17fd2a5af Got rid of __SC__ ifdefs. 2000-07-11 22:37:03 +00:00
Jack Jansen 1af5b082ab Removed guesstabsize.c, which is obsolete. 2000-07-11 21:18:44 +00:00
Jack Jansen 9ae898b415 ANSIfication step 2: make sure all needed prototypes are available, and all needed
header files included.
2000-07-11 21:16:03 +00:00
Jack Jansen d88296d25a ANSIfication step 1: get rid of Py_PROTO and Py_FPROTO. 2000-07-11 19:51:05 +00:00
Jack Jansen fe38d2998f PyMac_FindModuleExtension now uses a size_t as its size parameter for compatibility. 2000-07-03 23:53:40 +00:00
Jack Jansen ca23d910f8 Made argc/argv processing work again under carbon. 2000-06-20 07:40:34 +00:00
Jack Jansen 868f0c7155 Oops, default type and creator were reversed. 2000-06-14 09:12:44 +00:00
Jack Jansen 490121355e Removed assorted old ifdefs. 2000-06-04 22:11:10 +00:00
Jack Jansen 021da55579 Removed THINK_C support. 2000-06-04 21:56:05 +00:00
Jack Jansen d9f6e92fbf Removed THINK_C support.
Added a CARBON indicator to the version string.
2000-06-04 21:51:36 +00:00
Jack Jansen 33d1ad28cb Replaced GetFInfo and SetFInfo calls with FspGetFInfo and FspSetFInfo calls, which are carbon-compatible. 2000-06-02 21:29:59 +00:00
Jack Jansen ee6eeb1876 Removed (within an #ifdef) Carbon-incompatabilities:
- Don't call all the toolbox init routines.
- No balloon help, so removed help code from the initial dialog.
2000-06-02 21:28:52 +00:00
Jack Jansen bb6d83a8c4 Removed (within an #ifdef) Carbon-incompatabilities:
- Use TickCount() in stead of LMGetTicks()
- Don't use xxxGetFile event filter
- Don't call SystemTask or HandleSysWindowEvent (is this also automatically handled under os9??)
- Don't scan event queue for cmd-. (to be fixed at some point).
2000-06-02 21:27:11 +00:00
Jack Jansen 14cd750004 Fixed callback function arguments to be carbon-compatible.
(Temporarily?) removed call to ProcessHighLevelEvent until we find out how to do this (Carbon only).
2000-06-02 21:23:09 +00:00
Jack Jansen 9cfce18c4f GUSI 2.0.5 has a non-functional getsockname() if you use Open Transport. For now the workaround is to only enable MacTCP sockets. 2000-05-10 15:15:54 +00:00
Jack Jansen 0c6d037cc5 Removed string-exception preference, added tabcheck and NavService preference, upped version number. 2000-05-05 23:11:14 +00:00
Jack Jansen 850d118f74 Got rid of w/MSL in the version string. 2000-05-05 23:08:47 +00:00
Jack Jansen 69652f8abe Moved to the Compat folder (in case anyone still wants to try MPW building), it hasn't been used for years. 2000-05-03 08:42:26 +00:00
Jack Jansen 6a066805e0 Removed, the core-python getmtime works fine with GUSI2. 2000-05-03 08:41:56 +00:00
Jack Jansen ee0810403d Made the GUSI options work again with GUSI 2. 2000-04-21 23:53:37 +00:00
Jack Jansen 2d1306b7cf Started on GUSI2 and threading support. 2000-04-07 09:10:49 +00:00
Jack Jansen 3d7575406f If there's an error in an fsspec argument raise MacOS.Error, not ValueError. 2000-01-24 09:56:06 +00:00
Jack Jansen 205b435c50 Added initializer routine optionally to be used as PEF fragment initialization routine, which allows us to get at our own resource fork even if some shared library init routine opens other resource files. 2000-01-07 14:53:31 +00:00
Jack Jansen b734adef4b Added PyMac_BuildOptStr255, which returns None on a null pointer. 1999-12-17 17:15:50 +00:00
Jack Jansen 608b3fa801 Dummy functions which return unimpErr for lots of toolbox calls that are unavailable for 68K. This way we don't have to disable thm in bgen, so we
can still use them on PPC.
1999-12-12 21:38:29 +00:00
Jack Jansen 8bb573e2ab Oops, PLstring funcs should be "pascal". Funny this never caused problems before... 1999-12-12 21:37:14 +00:00
Jack Jansen 8f5725af60 First bits and pieces of appearance support: an init routine, a global flag PyMac_AppearanceCompliant (exported thru MacOS). If USE_APPEARANCE
is off the code is disabled (but the variables are still there, set to 0).
1999-12-07 23:08:10 +00:00
Jack Jansen e742487ca5 Bigger buffer size for C profiler (if profiling is enabled). 1999-09-30 11:20:11 +00:00
Jack Jansen fac3008e77 Optimization: don't try to get a tabsize resource if we know the file
doesn't have one (stdin and such), OpenRF appears to be an expensive call.
1999-09-30 11:19:16 +00:00
Jack Jansen 68ecab455c Put the applet code inside USE_MAC_APPLET_SUPPORT ifdefs, to make 68k standalone Python compile. 1999-02-15 23:34:56 +00:00
Jack Jansen 6b6e61dd32 (finally) unified the interpreter and the applet as Just suggested ages ago. The
resulting program is called PythonInterpreter.
1999-02-15 21:33:34 +00:00
Just van Rossum 26a69db4c7 put the preferences file in a folder called "Python" inside the prefs folder, just like the IDE does -- jvr 1999-02-02 15:49:03 +00:00
Jack Jansen deff89c8be Replaced fprintf(stderr,...) with PySys_WriteStderr(...) where appropriate. 1998-10-12 20:53:15 +00:00
Jack Jansen 48a9c3634b Mods by Just to allow aliases in sys.path entries 1998-09-07 11:36:17 +00:00
Jack Jansen b93f52158b Support for freezing packages (Just). 1998-08-18 12:23:11 +00:00
Jack Jansen 87c485c1ad Initialize the program name before adding shared library resources (Just). 1998-07-31 09:38:01 +00:00
Jack Jansen 2e6445caa6 Don't add the library file to the resource file chain if it is the
same as the application file (Just).
1998-07-31 09:37:02 +00:00
Jack Jansen 7e1fb7c92d New about box, with the version mesage filled in in a text item, and
PLstrcmp() fixed. (Just)
1998-07-31 09:36:30 +00:00
Jack Jansen 017e0ff1a0 The PYD resource should now contain 2 strings: one for the ppc
fragment name and one for the cfm68k fragment name (Just).
Also, some unused variables removed.
1998-07-31 09:34:47 +00:00
Jack Jansen abdf93c6dc Re-indented properly (Just). 1998-07-31 09:33:28 +00:00
Jack Jansen ac82b6a041 If the preference filename resource is empty don't try to open or
create the preferences file. This is so that frozen programs don't
interfere with an existing Python installation, or leave turds in the
Preferences folder.
1998-07-13 13:38:29 +00:00
Jack Jansen 1e2260fcb4 All import-related code has moved to macimport.c.
There's also new support for importing code fragments: if a file on
sys.path contains a PYD resource with resourcename equal to the name
of the module to be imported this PYD resource should contain a
(pascal) string with the name of a code fragment to load. This allows
freezing Python programs without access to source or a development
environment.
1998-07-13 13:37:12 +00:00
Jack Jansen fa68b07526 Print message when we load a PYC resource, if verbose import flag is on. 1998-06-26 14:52:04 +00:00
Jack Jansen 0072b8d994 An applet with Popt and GUSI preferences but without alis resource
didn't work, because the resource file chain was incomplete when we
tried to open the preference file. Fixed.
1998-05-07 13:08:58 +00:00
Jack Jansen bbf4be2c2f Incorrect argument for PyMacBuildwide() 1998-04-23 13:20:17 +00:00
Jack Jansen d58cd630eb Added PyMac_{Get,Build}wide. These should support python longints at
some point in the future.
1998-04-21 15:24:39 +00:00
Jack Jansen efaada75e4 - Universal Headers 3 mods
- Started on menubar-restore code (but it still doesn't work 100%)
1998-02-20 16:03:15 +00:00
Jack Jansen 213649023c Bug fix for fast module location 1997-10-08 15:32:46 +00:00
Jack Jansen a7a89ebdbe Implemented nositepython and oldexceptions flags 1997-10-07 21:48:57 +00:00
Jack Jansen c73f83c8d9 Fixed for new "import dir.module" semantics. Needs accompanying fix in
import.c (yes Guido, I'll send it tomorrow)
1997-10-07 21:48:31 +00:00
Jack Jansen 36b983c2c2 Added old-exception and no-site-python options and balloon help 1997-09-09 13:53:21 +00:00
Jack Jansen 5b3c9717c4 The preference resource now has a version number 1997-09-08 13:22:49 +00:00
Jack Jansen ac62569fd0 sys.prefix and sys.exec_prefix are now set correctly. 1997-09-08 13:22:22 +00:00
Jack Jansen 0c96887d35 Handle systemclicks ourselves, in stead of passing them to Sioux. This
fixes (or masks?) a bug with Python becoming unreactive during
time.sleep() if you have already switched applications before.
1997-08-26 13:20:34 +00:00
Jack Jansen a8441ded7a Added (dummy) PyOS_FiniInterrupts 1997-08-08 14:57:37 +00:00
Jack Jansen 7330b39a41 Adapted for 1.5a3: Py_SupressPrintingFlag is gone, and
Py_SetProgramName replaces Py_GetProgramName
1997-08-08 14:56:41 +00:00
Jack Jansen 36ed506f09 Added PyMac_SetEventHandler which allows you to replace complete event
handling in inner loop with python code. Also move (previously
machine independent) PyErr_CheckSignals here, so we can propagate
exceptions in event handling code.
1997-06-20 16:18:15 +00:00
Jack Jansen eda78634a4 Make imports faster on the Mac, by
- Remembering whether sys.path components refer to files or folders,
- Using mac-specific code to check for file existence, in stead of trying
  to fopen() each possible file.

These mods need an accompanying mod to import.c.
1997-06-12 15:29:46 +00:00
Jack Jansen caa7c46ac4 - Restore SIOUX menubar just before exiting, if the console window is kept
open (so the user can quit with cmd-Q, print, etc)
- Removed a few unused routines
1997-06-12 10:49:13 +00:00
Jack Jansen e3ae0dfeb7 Removed old scheduler parameterizing calls and replaced with something
a bit easier to use and understand
1997-06-03 15:28:29 +00:00
Jack Jansen a39f1b0ce2 - Added Py_GetProgramFullPath
- Added PyMac_StopGUSISpin and have it called at exit time (fixes crash
  when exiting with sockets open)
- Added PLstr... funcs needed by gusi: those provided by StdCLib are
  broken under cfm68k
1997-05-23 15:35:14 +00:00
Jack Jansen e44545fc0b Workaround for bug in MSL and CWGUSI interaction that stopped the
"don't close window on exit" feature to work.
1997-05-07 15:48:54 +00:00
Jack Jansen 3089b7eead - Various names in CodeFragments.h have changed
- a dummy main program was added, so we can use the standard MW MSL
  runtime library for main programs (in stead of rolling our own, as we
  did previously).
1997-05-07 15:48:01 +00:00
Jack Jansen 08c3be35c3 Changed the few old routine names still used to the new ones
Started working on MSL support
1997-04-08 15:27:00 +00:00
Jack Jansen c587301e2e - Changed GestaltEqu.h to Gestalt.h
- Changed FragLoader.h to CodeFragments.h
- Removed Desk.h
1997-02-24 13:59:38 +00:00
Jack Jansen 7e94404081 Only go into eventloop/interrupt check 10 times per second 1997-02-20 15:23:18 +00:00
Jack Jansen 42218ce33c Added/updated copyright notices
(and the &*^$%@ resource files got binhexed again, sigh)
1997-01-31 16:15:11 +00:00