[Python-checkins] python/dist/src/Lib/plat-mac Audio_mac.py, 1.3, 1.4 EasyDialogs.py, 1.15, 1.16 FrameWork.py, 1.6, 1.7 MiniAEFrame.py, 1.4, 1.5 PixMapWrapper.py, 1.3, 1.4 aepack.py, 1.6, 1.7 aetools.py, 1.9, 1.10 aetypes.py, 1.6, 1.7 applesingle.py, 1.3, 1.4 appletrawmain.py, 1.2, 1.3 bgenlocations.py, 1.7, 1.8 buildtools.py, 1.11, 1.12 cfmfile.py, 1.3, 1.4 findertools.py, 1.4, 1.5 gensuitemodule.py, 1.11, 1.12 ic.py, 1.6, 1.7 icopen.py, 1.2, 1.3 macfs.py, 1.10, 1.11 macostools.py, 1.3, 1.4 macresource.py, 1.5, 1.6 pimp.py, 1.34, 1.35 videoreader.py, 1.3, 1.4

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Jul 18 08:15:21 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/plat-mac
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31286/plat-mac

Modified Files:
	Audio_mac.py EasyDialogs.py FrameWork.py MiniAEFrame.py 
	PixMapWrapper.py aepack.py aetools.py aetypes.py 
	applesingle.py appletrawmain.py bgenlocations.py buildtools.py 
	cfmfile.py findertools.py gensuitemodule.py ic.py icopen.py 
	macfs.py macostools.py macresource.py pimp.py videoreader.py 
Log Message:
Whitespace normalization, via reindent.py.


Index: Audio_mac.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/Audio_mac.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Audio_mac.py	9 Apr 2003 13:25:42 -0000	1.3
--- Audio_mac.py	18 Jul 2004 06:14:45 -0000	1.4
***************
*** 82,86 ****
          if self._usercallback:
              self._usercallback()
!             
      def setcallback(self, callback):
          self._usercallback = callback
--- 82,86 ----
          if self._usercallback:
              self._usercallback()
! 
      def setcallback(self, callback):
          self._usercallback = callback

Index: EasyDialogs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/EasyDialogs.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** EasyDialogs.py	12 Feb 2004 17:35:10 -0000	1.15
--- EasyDialogs.py	18 Jul 2004 06:14:45 -0000	1.16
***************
*** 374,393 ****
  ##
  def _setmenu(control, items):
!         mhandle = control.GetControlData_Handle(Controls.kControlMenuPart,
!                 Controls.kControlPopupButtonMenuHandleTag)
!         menu = Menu.as_Menu(mhandle)
!         for item in items:
!             if type(item) == type(()):
!                 label = item[0]
!             else:
!                 label = item
!             if label[-1] == '=' or label[-1] == ':':
!                 label = label[:-1]
!             menu.AppendMenu(label)
  ##          mhandle, mid = menu.getpopupinfo()
  ##          control.SetControlData_Handle(Controls.kControlMenuPart,
  ##                  Controls.kControlPopupButtonMenuHandleTag, mhandle)
!         control.SetControlMinimum(1)
!         control.SetControlMaximum(len(items)+1)
  
  def _selectoption(d, optionlist, idx):
--- 374,393 ----
  ##
  def _setmenu(control, items):
!     mhandle = control.GetControlData_Handle(Controls.kControlMenuPart,
!             Controls.kControlPopupButtonMenuHandleTag)
!     menu = Menu.as_Menu(mhandle)
!     for item in items:
!         if type(item) == type(()):
!             label = item[0]
!         else:
!             label = item
!         if label[-1] == '=' or label[-1] == ':':
!             label = label[:-1]
!         menu.AppendMenu(label)
  ##          mhandle, mid = menu.getpopupinfo()
  ##          control.SetControlData_Handle(Controls.kControlMenuPart,
  ##                  Controls.kControlPopupButtonMenuHandleTag, mhandle)
!     control.SetControlMinimum(1)
!     control.SetControlMaximum(len(items)+1)
  
  def _selectoption(d, optionlist, idx):
***************
*** 837,839 ****
      except KeyboardInterrupt:
          Message("Operation Canceled.")
- 
--- 837,838 ----

Index: FrameWork.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/FrameWork.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FrameWork.py	12 Feb 2004 17:35:10 -0000	1.6
--- FrameWork.py	18 Jul 2004 06:14:45 -0000	1.7
***************
*** 636,640 ****
                  self._parent.menu.DisableMenuItem(self._parent_item)
          if self.bar and self.bar.parent:
!                 self.bar.parent.needmenubarredraw = 1
  
  class PopupMenu(Menu):
--- 636,640 ----
                  self._parent.menu.DisableMenuItem(self._parent_item)
          if self.bar and self.bar.parent:
!             self.bar.parent.needmenubarredraw = 1
  
  class PopupMenu(Menu):

Index: MiniAEFrame.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/MiniAEFrame.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MiniAEFrame.py	12 Feb 2004 17:35:10 -0000	1.4
--- MiniAEFrame.py	18 Jul 2004 06:14:45 -0000	1.5
***************
*** 60,66 ****
  
      def dooneevent(self, mask = everyEvent, timeout = 60*60):
!             got, event = Evt.WaitNextEvent(mask, timeout)
!             if got:
!                 self.lowlevelhandler(event)
  
      def lowlevelhandler(self, event):
--- 60,66 ----
  
      def dooneevent(self, mask = everyEvent, timeout = 60*60):
!         got, event = Evt.WaitNextEvent(mask, timeout)
!         if got:
!             self.lowlevelhandler(event)
  
      def lowlevelhandler(self, event):

Index: PixMapWrapper.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/PixMapWrapper.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PixMapWrapper.py	9 Apr 2003 13:25:42 -0000	1.3
--- PixMapWrapper.py	18 Jul 2004 06:14:45 -0000	1.4
***************
*** 1,4 ****
  """PixMapWrapper - defines the PixMapWrapper class, which wraps an opaque
! QuickDraw PixMap data structure in a handy Python class.  Also provides 
  methods to convert to/from pixel data (from, e.g., the img module) or a
  Python Imaging Library Image object.
--- 1,4 ----
  """PixMapWrapper - defines the PixMapWrapper class, which wraps an opaque
! QuickDraw PixMap data structure in a handy Python class.  Also provides
  methods to convert to/from pixel data (from, e.g., the img module) or a
  Python Imaging Library Image object.
***************
*** 78,82 ****
              0, 0, 0)                # planeBytes, pmTable, pmReserved
          self.__dict__['_pm'] = Qd.RawBitMap(self._header)
!     
      def _stuff(self, element, bytes):
          offset = _pmElemOffset[element]
--- 78,82 ----
              0, 0, 0)                # planeBytes, pmTable, pmReserved
          self.__dict__['_pm'] = Qd.RawBitMap(self._header)
! 
      def _stuff(self, element, bytes):
          offset = _pmElemOffset[element]
***************
*** 86,90 ****
              + self._header[offset + struct.calcsize(fmt):]
          self.__dict__['_pm'] = None
!     
      def _unstuff(self, element):
          offset = _pmElemOffset[element]
--- 86,90 ----
              + self._header[offset + struct.calcsize(fmt):]
          self.__dict__['_pm'] = None
! 
      def _unstuff(self, element):
          offset = _pmElemOffset[element]
***************
*** 114,118 ****
              self._stuff(attr, val)
          else:
!             self.__dict__[attr] = val   
  
      def __getattr__(self, attr):
--- 114,118 ----
              self._stuff(attr, val)
          else:
!             self.__dict__[attr] = val
  
      def __getattr__(self, attr):
***************
*** 134,140 ****
              return self._unstuff(attr)
          else:
!             return self.__dict__[attr]  
  
-         
      def PixMap(self):
          "Return a QuickDraw PixMap corresponding to this data."
--- 134,140 ----
              return self._unstuff(attr)
          else:
!             return self.__dict__[attr]
! 
  
      def PixMap(self):
          "Return a QuickDraw PixMap corresponding to this data."
***************
*** 144,148 ****
  
      def blit(self, x1=0,y1=0,x2=None,y2=None, port=None):
!         """Draw this pixmap into the given (default current) grafport.""" 
          src = self.bounds
          dest = [x1,y1,x2,y2]
--- 144,148 ----
  
      def blit(self, x1=0,y1=0,x2=None,y2=None, port=None):
!         """Draw this pixmap into the given (default current) grafport."""
          src = self.bounds
          dest = [x1,y1,x2,y2]
***************
*** 154,158 ****
          Qd.CopyBits(self.PixMap(), port.GetPortBitMapForCopyBits(), src, tuple(dest),
                  QuickDraw.srcCopy, None)
!     
      def fromstring(self,s,width,height,format=imgformat.macrgb):
          """Stuff this pixmap with raw pixel data from a string.
--- 154,158 ----
          Qd.CopyBits(self.PixMap(), port.GetPortBitMapForCopyBits(), src, tuple(dest),
                  QuickDraw.srcCopy, None)
! 
      def fromstring(self,s,width,height,format=imgformat.macrgb):
          """Stuff this pixmap with raw pixel data from a string.
***************
*** 189,193 ****
          # We need data in ARGB format; PIL can't currently do that,
          # but it can do RGBA, which we can use by inserting one null
!         # up frontpm = 
          if im.mode != 'RGBA': im = im.convert('RGBA')
          data = chr(0) + im.tostring()
--- 189,193 ----
          # We need data in ARGB format; PIL can't currently do that,
          # but it can do RGBA, which we can use by inserting one null
!         # up frontpm =
          if im.mode != 'RGBA': im = im.convert('RGBA')
          data = chr(0) + im.tostring()
***************
*** 213,215 ****
      pm.blit(20,20)
      return pm
- 
--- 213,214 ----

Index: aepack.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/aepack.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** aepack.py	9 Apr 2003 13:25:42 -0000	1.6
--- aepack.py	18 Jul 2004 06:14:45 -0000	1.7
***************
*** 75,79 ****
  def pack(x, forcetype = None):
      """Pack a python object into an AE descriptor"""
!     
      if forcetype:
          if type(x) is StringType:
--- 75,79 ----
  def pack(x, forcetype = None):
      """Pack a python object into an AE descriptor"""
! 
      if forcetype:
          if type(x) is StringType:
***************
*** 81,88 ****
          else:
              return pack(x).AECoerceDesc(forcetype)
!             
      if x == None:
          return AE.AECreateDesc('null', '')
!         
      if isinstance(x, AEDescType):
          return x
--- 81,88 ----
          else:
              return pack(x).AECoerceDesc(forcetype)
! 
      if x == None:
          return AE.AECreateDesc('null', '')
! 
      if isinstance(x, AEDescType):
          return x
***************
*** 129,137 ****
      """Unpack an AE descriptor to a python object"""
      t = desc.type
!     
      if unpacker_coercions.has_key(t):
          desc = desc.AECoerceDesc(unpacker_coercions[t])
          t = desc.type # This is a guess by Jack....
!     
      if t == typeAEList:
          l = []
--- 129,137 ----
      """Unpack an AE descriptor to a python object"""
      t = desc.type
! 
      if unpacker_coercions.has_key(t):
          desc = desc.AECoerceDesc(unpacker_coercions[t])
          t = desc.type # This is a guess by Jack....
! 
      if t == typeAEList:
          l = []
***************
*** 249,253 ****
          return mklogical(unpack(record, formodulename))
      return mkunknown(desc.type, desc.data)
!     
  def coerce(data, egdata):
      """Coerce a python object to another type using the AE coercers"""
--- 249,253 ----
          return mklogical(unpack(record, formodulename))
      return mkunknown(desc.type, desc.data)
! 
  def coerce(data, egdata):
      """Coerce a python object to another type using the AE coercers"""
***************
*** 312,319 ****
  def mkstyledtext(dict):
      return aetypes.StyledText(dict['ksty'], dict['ktxt'])
!     
  def mkaetext(dict):
      return aetypes.AEText(dict[keyAEScriptTag], dict[keyAEStyles], dict[keyAEText])
!     
  def mkinsertionloc(dict):
      return aetypes.InsertionLoc(dict[keyAEObject], dict[keyAEPosition])
--- 312,319 ----
  def mkstyledtext(dict):
      return aetypes.StyledText(dict['ksty'], dict['ktxt'])
! 
  def mkaetext(dict):
      return aetypes.AEText(dict[keyAEScriptTag], dict[keyAEStyles], dict[keyAEText])
! 
  def mkinsertionloc(dict):
      return aetypes.InsertionLoc(dict[keyAEObject], dict[keyAEPosition])
***************
*** 356,360 ****
          newobj.__class__ = classtype
      return newobj
!     
  def mktype(typecode, modulename=None):
      if modulename:
--- 356,360 ----
          newobj.__class__ = classtype
      return newobj
! 
  def mktype(typecode, modulename=None):
      if modulename:

Index: aetools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/aetools.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** aetools.py	18 Jun 2003 14:19:08 -0000	1.9
--- aetools.py	18 Jul 2004 06:14:45 -0000	1.10
***************
*** 114,118 ****
          elif k != '----' and k not in ok:
              raise TypeError, 'Unknown keyword argument: %s'%k
!             
  def enumsubst(arguments, key, edict):
      """Substitute a single enum keyword argument, if it occurs"""
--- 114,118 ----
          elif k != '----' and k not in ok:
              raise TypeError, 'Unknown keyword argument: %s'%k
! 
  def enumsubst(arguments, key, edict):
      """Substitute a single enum keyword argument, if it occurs"""
***************
*** 125,129 ****
      elif not v in ok:
          raise TypeError, 'Unknown enumerator: %s'%v
!         
  def decodeerror(arguments):
      """Create the 'best' argument for a raise MacOS.Error"""
--- 125,129 ----
      elif not v in ok:
          raise TypeError, 'Unknown enumerator: %s'%v
! 
  def decodeerror(arguments):
      """Create the 'best' argument for a raise MacOS.Error"""
***************
*** 138,142 ****
      else:
          err_a3 = None
!     
      return (err_a1, err_a2, err_a3)
  
--- 138,142 ----
      else:
          err_a3 = None
! 
      return (err_a1, err_a2, err_a3)
  
***************
*** 147,151 ****
      _elemdict = {}      # Can be overridden by subclasses
      _propdict = {}      # Can be overridden by subclasses
!     
      __eventloop_initialized = 0
      def __ensure_WMAvailable(klass):
--- 147,151 ----
      _elemdict = {}      # Can be overridden by subclasses
      _propdict = {}      # Can be overridden by subclasses
! 
      __eventloop_initialized = 0
      def __ensure_WMAvailable(klass):
***************
*** 157,164 ****
          return 1
      __ensure_WMAvailable = classmethod(__ensure_WMAvailable)
!     
      def __init__(self, signature=None, start=0, timeout=0):
          """Create a communication channel with a particular application.
!         
          Addressing the application is done by specifying either a
          4-byte signature, an AEDesc or an object that will __aepack__
--- 157,164 ----
          return 1
      __ensure_WMAvailable = classmethod(__ensure_WMAvailable)
! 
      def __init__(self, signature=None, start=0, timeout=0):
          """Create a communication channel with a particular application.
! 
          Addressing the application is done by specifying either a
          4-byte signature, an AEDesc or an object that will __aepack__
***************
*** 185,189 ****
          if start:
              self._start()
!         
      def _start(self):
          """Start the application, if it is not running yet"""
--- 185,189 ----
          if start:
              self._start()
! 
      def _start(self):
          """Start the application, if it is not running yet"""
***************
*** 200,216 ****
                      break
                  time.sleep(1)
!             
      def start(self):
          """Deprecated, used _start()"""
          self._start()
!             
      def newevent(self, code, subcode, parameters = {}, attributes = {}):
          """Create a complete structure for an apple event"""
!         
          event = AE.AECreateAppleEvent(code, subcode, self.target,
                    AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID)
          packevent(event, parameters, attributes)
          return event
!     
      def sendevent(self, event):
          """Send a pre-created appleevent, await the reply and unpack it"""
--- 200,216 ----
                      break
                  time.sleep(1)
! 
      def start(self):
          """Deprecated, used _start()"""
          self._start()
! 
      def newevent(self, code, subcode, parameters = {}, attributes = {}):
          """Create a complete structure for an apple event"""
! 
          event = AE.AECreateAppleEvent(code, subcode, self.target,
                    AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID)
          packevent(event, parameters, attributes)
          return event
! 
      def sendevent(self, event):
          """Send a pre-created appleevent, await the reply and unpack it"""
***************
*** 221,229 ****
          parameters, attributes = unpackevent(reply, self._moduleName)
          return reply, parameters, attributes
!         
      def send(self, code, subcode, parameters = {}, attributes = {}):
          """Send an appleevent given code/subcode/pars/attrs and unpack the reply"""
          return self.sendevent(self.newevent(code, subcode, parameters, attributes))
!     
      #
      # The following events are somehow "standard" and don't seem to appear in any
--- 221,229 ----
          parameters, attributes = unpackevent(reply, self._moduleName)
          return reply, parameters, attributes
! 
      def send(self, code, subcode, parameters = {}, attributes = {}):
          """Send an appleevent given code/subcode/pars/attrs and unpack the reply"""
          return self.sendevent(self.newevent(code, subcode, parameters, attributes))
! 
      #
      # The following events are somehow "standard" and don't seem to appear in any
***************
*** 257,263 ****
                  item.__class__ = as
              return item
!     
      get = _get
!             
      _argmap_set = {
          'to' : 'data',
--- 257,263 ----
                  item.__class__ = as
              return item
! 
      get = _get
! 
      _argmap_set = {
          'to' : 'data',
***************
*** 284,293 ****
          if _arguments.has_key('----'):
              return _arguments['----']
!             
      set = _set
  
      # Magic glue to allow suite-generated classes to function somewhat
      # like the "application" class in OSA.
!     
      def __getattr__(self, name):
          if self._elemdict.has_key(name):
--- 284,293 ----
          if _arguments.has_key('----'):
              return _arguments['----']
! 
      set = _set
  
      # Magic glue to allow suite-generated classes to function somewhat
      # like the "application" class in OSA.
! 
      def __getattr__(self, name):
          if self._elemdict.has_key(name):
***************
*** 298,302 ****
              return cls()
          raise AttributeError, name
!         
  # Tiny Finder class, for local use only
  
--- 298,302 ----
              return cls()
          raise AttributeError, name
! 
  # Tiny Finder class, for local use only
  
***************
*** 322,326 ****
              return _arguments['----']
  #pass
!     
  _finder = _miniFinder('MACS')
  
--- 322,326 ----
              return _arguments['----']
  #pass
! 
  _finder = _miniFinder('MACS')
  
***************
*** 333,342 ****
      """application file - An application's file on disk"""
      want = 'appf'
!     
  _application_file._propdict = {
  }
  _application_file._elemdict = {
  }
!     
  # Test program
  # XXXX Should test more, really...
--- 333,342 ----
      """application file - An application's file on disk"""
      want = 'appf'
! 
  _application_file._propdict = {
  }
  _application_file._elemdict = {
  }
! 
  # Test program
  # XXXX Should test more, really...

Index: aetypes.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/aetypes.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** aetypes.py	12 Feb 2004 17:35:10 -0000	1.6
--- aetypes.py	18 Jul 2004 06:14:45 -0000	1.7
***************
*** 13,17 ****
      from aepack import pack
      return pack( *args, **kwargs)
!     
  def nice(s):
      """'nice' representation of an object"""
--- 13,17 ----
      from aepack import pack
      return pack( *args, **kwargs)
! 
  def nice(s):
      """'nice' representation of an object"""
***************
*** 21,32 ****
  class Unknown:
      """An uninterpreted AE object"""
!     
      def __init__(self, type, data):
          self.type = type
          self.data = data
!     
      def __repr__(self):
          return "Unknown(%r, %r)" % (self.type, self.data)
!     
      def __aepack__(self):
          return pack(self.data, self.type)
--- 21,32 ----
  class Unknown:
      """An uninterpreted AE object"""
! 
      def __init__(self, type, data):
          self.type = type
          self.data = data
! 
      def __repr__(self):
          return "Unknown(%r, %r)" % (self.type, self.data)
! 
      def __aepack__(self):
          return pack(self.data, self.type)
***************
*** 34,47 ****
  class Enum:
      """An AE enumeration value"""
!     
      def __init__(self, enum):
          self.enum = "%-4.4s" % str(enum)
!     
      def __repr__(self):
          return "Enum(%r)" % (self.enum,)
!     
      def __str__(self):
          return string.strip(self.enum)
!     
      def __aepack__(self):
          return pack(self.enum, typeEnumeration)
--- 34,47 ----
  class Enum:
      """An AE enumeration value"""
! 
      def __init__(self, enum):
          self.enum = "%-4.4s" % str(enum)
! 
      def __repr__(self):
          return "Enum(%r)" % (self.enum,)
! 
      def __str__(self):
          return string.strip(self.enum)
! 
      def __aepack__(self):
          return pack(self.enum, typeEnumeration)
***************
*** 59,74 ****
          self.of = of
          self.pos = pos
!     
      def __repr__(self):
          return "InsertionLoc(%r, %r)" % (self.of, self.pos)
!         
      def __aepack__(self):
          rec = {'kobj': self.of, 'kpos': self.pos}
          return pack(rec, forcetype='insl')
!         
  # Convenience functions for dsp:
  def beginning(of):
      return InsertionLoc(of, Enum('bgng'))
!     
  def end(of):
      return InsertionLoc(of, Enum('end '))
--- 59,74 ----
          self.of = of
          self.pos = pos
! 
      def __repr__(self):
          return "InsertionLoc(%r, %r)" % (self.of, self.pos)
! 
      def __aepack__(self):
          rec = {'kobj': self.of, 'kpos': self.pos}
          return pack(rec, forcetype='insl')
! 
  # Convenience functions for dsp:
  def beginning(of):
      return InsertionLoc(of, Enum('bgng'))
! 
  def end(of):
      return InsertionLoc(of, Enum('end '))
***************
*** 76,86 ****
  class Boolean:
      """An AE boolean value"""
!     
      def __init__(self, bool):
          self.bool = (not not bool)
!     
      def __repr__(self):
          return "Boolean(%r)" % (self.bool,)
!     
      def __str__(self):
          if self.bool:
--- 76,86 ----
  class Boolean:
      """An AE boolean value"""
! 
      def __init__(self, bool):
          self.bool = (not not bool)
! 
      def __repr__(self):
          return "Boolean(%r)" % (self.bool,)
! 
      def __str__(self):
          if self.bool:
***************
*** 88,92 ****
          else:
              return "False"
!     
      def __aepack__(self):
          return pack(struct.pack('b', self.bool), 'bool')
--- 88,92 ----
          else:
              return "False"
! 
      def __aepack__(self):
          return pack(struct.pack('b', self.bool), 'bool')
***************
*** 101,114 ****
  class Type:
      """An AE 4-char typename object"""
!     
      def __init__(self, type):
          self.type = "%-4.4s" % str(type)
!     
      def __repr__(self):
          return "Type(%r)" % (self.type,)
!     
      def __str__(self):
          return string.strip(self.type)
!     
      def __aepack__(self):
          return pack(self.type, typeType)
--- 101,114 ----
  class Type:
      """An AE 4-char typename object"""
! 
      def __init__(self, type):
          self.type = "%-4.4s" % str(type)
! 
      def __repr__(self):
          return "Type(%r)" % (self.type,)
! 
      def __str__(self):
          return string.strip(self.type)
! 
      def __aepack__(self):
          return pack(self.type, typeType)
***************
*** 124,137 ****
  class Keyword:
      """An AE 4-char keyword object"""
!     
      def __init__(self, keyword):
          self.keyword = "%-4.4s" % str(keyword)
!     
      def __repr__(self):
          return "Keyword(%r)" % `self.keyword`
!     
      def __str__(self):
          return string.strip(self.keyword)
!     
      def __aepack__(self):
          return pack(self.keyword, typeKeyword)
--- 124,137 ----
  class Keyword:
      """An AE 4-char keyword object"""
! 
      def __init__(self, keyword):
          self.keyword = "%-4.4s" % str(keyword)
! 
      def __repr__(self):
          return "Keyword(%r)" % `self.keyword`
! 
      def __str__(self):
          return string.strip(self.keyword)
! 
      def __aepack__(self):
          return pack(self.keyword, typeKeyword)
***************
*** 142,156 ****
  class Range:
      """An AE range object"""
!     
      def __init__(self, start, stop):
          self.start = start
          self.stop = stop
!     
      def __repr__(self):
          return "Range(%r, %r)" % (self.start, self.stop)
!     
      def __str__(self):
          return "%s thru %s" % (nice(self.start), nice(self.stop))
!     
      def __aepack__(self):
          return pack({'star': self.start, 'stop': self.stop}, 'rang')
--- 142,156 ----
  class Range:
      """An AE range object"""
! 
      def __init__(self, start, stop):
          self.start = start
          self.stop = stop
! 
      def __repr__(self):
          return "Range(%r, %r)" % (self.start, self.stop)
! 
      def __str__(self):
          return "%s thru %s" % (nice(self.start), nice(self.stop))
! 
      def __aepack__(self):
          return pack({'star': self.start, 'stop': self.stop}, 'rang')
***************
*** 161,176 ****
  class Comparison:
      """An AE Comparison"""
!     
      def __init__(self, obj1, relo, obj2):
          self.obj1 = obj1
          self.relo = "%-4.4s" % str(relo)
          self.obj2 = obj2
!     
      def __repr__(self):
          return "Comparison(%r, %r, %r)" % (self.obj1, self.relo, self.obj2)
!     
      def __str__(self):
          return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2))
!     
      def __aepack__(self):
          return pack({'obj1': self.obj1,
--- 161,176 ----
  class Comparison:
      """An AE Comparison"""
! 
      def __init__(self, obj1, relo, obj2):
          self.obj1 = obj1
          self.relo = "%-4.4s" % str(relo)
          self.obj2 = obj2
! 
      def __repr__(self):
          return "Comparison(%r, %r, %r)" % (self.obj1, self.relo, self.obj2)
! 
      def __str__(self):
          return "%s %s %s" % (nice(self.obj1), string.strip(self.relo), nice(self.obj2))
! 
      def __aepack__(self):
          return pack({'obj1': self.obj1,
***************
*** 181,188 ****
  def IsComparison(x):
      return isinstance(x, Comparison)
!     
  class NComparison(Comparison):
      # The class attribute 'relo' must be set in a subclass
!     
      def __init__(self, obj1, obj2):
          Comparison.__init__(obj1, self.relo, obj2)
--- 181,188 ----
  def IsComparison(x):
      return isinstance(x, Comparison)
! 
  class NComparison(Comparison):
      # The class attribute 'relo' must be set in a subclass
! 
      def __init__(self, obj1, obj2):
          Comparison.__init__(obj1, self.relo, obj2)
***************
*** 190,204 ****
  class Ordinal:
      """An AE Ordinal"""
!     
      def __init__(self, abso):
  #       self.obj1 = obj1
          self.abso = "%-4.4s" % str(abso)
!     
      def __repr__(self):
          return "Ordinal(%r)" % (self.abso,)
!     
      def __str__(self):
          return "%s" % (string.strip(self.abso))
!     
      def __aepack__(self):
          return pack(self.abso, 'abso')
--- 190,204 ----
  class Ordinal:
      """An AE Ordinal"""
! 
      def __init__(self, abso):
  #       self.obj1 = obj1
          self.abso = "%-4.4s" % str(abso)
! 
      def __repr__(self):
          return "Ordinal(%r)" % (self.abso,)
! 
      def __str__(self):
          return "%s" % (string.strip(self.abso))
! 
      def __aepack__(self):
          return pack(self.abso, 'abso')
***************
*** 206,213 ****
  def IsOrdinal(x):
      return isinstance(x, Ordinal)
!     
  class NOrdinal(Ordinal):
      # The class attribute 'abso' must be set in a subclass
!     
      def __init__(self):
          Ordinal.__init__(self, self.abso)
--- 206,213 ----
  def IsOrdinal(x):
      return isinstance(x, Ordinal)
! 
  class NOrdinal(Ordinal):
      # The class attribute 'abso' must be set in a subclass
! 
      def __init__(self):
          Ordinal.__init__(self, self.abso)
***************
*** 215,226 ****
  class Logical:
      """An AE logical expression object"""
!     
      def __init__(self, logc, term):
          self.logc = "%-4.4s" % str(logc)
          self.term = term
!     
      def __repr__(self):
          return "Logical(%r, %r)" % (self.logc, self.term)
!     
      def __str__(self):
          if type(self.term) == ListType and len(self.term) == 2:
--- 215,226 ----
  class Logical:
      """An AE logical expression object"""
! 
      def __init__(self, logc, term):
          self.logc = "%-4.4s" % str(logc)
          self.term = term
! 
      def __repr__(self):
          return "Logical(%r, %r)" % (self.logc, self.term)
! 
      def __str__(self):
          if type(self.term) == ListType and len(self.term) == 2:
***************
*** 230,234 ****
          else:
              return "%s(%s)" % (string.strip(self.logc), nice(self.term))
!     
      def __aepack__(self):
          return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi')
--- 230,234 ----
          else:
              return "%s(%s)" % (string.strip(self.logc), nice(self.term))
! 
      def __aepack__(self):
          return pack({'logc': mkenum(self.logc), 'term': self.term}, 'logi')
***************
*** 239,253 ****
  class StyledText:
      """An AE object respresenting text in a certain style"""
!     
      def __init__(self, style, text):
          self.style = style
          self.text = text
!     
      def __repr__(self):
          return "StyledText(%r, %r)" % (self.style, self.text)
!     
      def __str__(self):
          return self.text
!     
      def __aepack__(self):
          return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT')
--- 239,253 ----
  class StyledText:
      """An AE object respresenting text in a certain style"""
! 
      def __init__(self, style, text):
          self.style = style
          self.text = text
! 
      def __repr__(self):
          return "StyledText(%r, %r)" % (self.style, self.text)
! 
      def __str__(self):
          return self.text
! 
      def __aepack__(self):
          return pack({'ksty': self.style, 'ktxt': self.text}, 'STXT')
***************
*** 258,273 ****
  class AEText:
      """An AE text object with style, script and language specified"""
!     
      def __init__(self, script, style, text):
          self.script = script
          self.style = style
          self.text = text
!     
      def __repr__(self):
          return "AEText(%r, %r, %r)" % (self.script, self.style, self.text)
!     
      def __str__(self):
          return self.text
!     
      def __aepack__(self):
          return pack({keyAEScriptTag: self.script, keyAEStyles: self.style,
--- 258,273 ----
  class AEText:
      """An AE text object with style, script and language specified"""
! 
      def __init__(self, script, style, text):
          self.script = script
          self.style = style
          self.text = text
! 
      def __repr__(self):
          return "AEText(%r, %r, %r)" % (self.script, self.style, self.text)
! 
      def __str__(self):
          return self.text
! 
      def __aepack__(self):
          return pack({keyAEScriptTag: self.script, keyAEStyles: self.style,
***************
*** 279,294 ****
  class IntlText:
      """A text object with script and language specified"""
!     
      def __init__(self, script, language, text):
          self.script = script
          self.language = language
          self.text = text
!     
      def __repr__(self):
          return "IntlText(%r, %r, %r)" % (self.script, self.language, self.text)
!     
      def __str__(self):
          return self.text
!     
      def __aepack__(self):
          return pack(struct.pack('hh', self.script, self.language)+self.text,
--- 279,294 ----
  class IntlText:
      """A text object with script and language specified"""
! 
      def __init__(self, script, language, text):
          self.script = script
          self.language = language
          self.text = text
! 
      def __repr__(self):
          return "IntlText(%r, %r, %r)" % (self.script, self.language, self.text)
! 
      def __str__(self):
          return self.text
! 
      def __aepack__(self):
          return pack(struct.pack('hh', self.script, self.language)+self.text,
***************
*** 300,314 ****
  class IntlWritingCode:
      """An object representing script and language"""
!     
      def __init__(self, script, language):
          self.script = script
          self.language = language
!     
      def __repr__(self):
          return "IntlWritingCode(%r, %r)" % (self.script, self.language)
!     
      def __str__(self):
          return "script system %d, language %d"%(self.script, self.language)
!     
      def __aepack__(self):
          return pack(struct.pack('hh', self.script, self.language),
--- 300,314 ----
  class IntlWritingCode:
      """An object representing script and language"""
! 
      def __init__(self, script, language):
          self.script = script
          self.language = language
! 
      def __repr__(self):
          return "IntlWritingCode(%r, %r)" % (self.script, self.language)
! 
      def __str__(self):
          return "script system %d, language %d"%(self.script, self.language)
! 
      def __aepack__(self):
          return pack(struct.pack('hh', self.script, self.language),
***************
*** 320,334 ****
  class QDPoint:
      """A point"""
!     
      def __init__(self, v, h):
          self.v = v
          self.h = h
!     
      def __repr__(self):
          return "QDPoint(%r, %r)" % (self.v, self.h)
!     
      def __str__(self):
          return "(%d, %d)"%(self.v, self.h)
!     
      def __aepack__(self):
          return pack(struct.pack('hh', self.v, self.h),
--- 320,334 ----
  class QDPoint:
      """A point"""
! 
      def __init__(self, v, h):
          self.v = v
          self.h = h
! 
      def __repr__(self):
          return "QDPoint(%r, %r)" % (self.v, self.h)
! 
      def __str__(self):
          return "(%d, %d)"%(self.v, self.h)
! 
      def __aepack__(self):
          return pack(struct.pack('hh', self.v, self.h),
***************
*** 340,344 ****
  class QDRectangle:
      """A rectangle"""
!     
      def __init__(self, v0, h0, v1, h1):
          self.v0 = v0
--- 340,344 ----
  class QDRectangle:
      """A rectangle"""
! 
      def __init__(self, v0, h0, v1, h1):
          self.v0 = v0
***************
*** 346,356 ****
          self.v1 = v1
          self.h1 = h1
!     
      def __repr__(self):
          return "QDRectangle(%r, %r, %r, %r)" % (self.v0, self.h0, self.v1, self.h1)
!     
      def __str__(self):
          return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1)
!     
      def __aepack__(self):
          return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1),
--- 346,356 ----
          self.v1 = v1
          self.h1 = h1
! 
      def __repr__(self):
          return "QDRectangle(%r, %r, %r, %r)" % (self.v0, self.h0, self.v1, self.h1)
! 
      def __str__(self):
          return "(%d, %d)-(%d, %d)"%(self.v0, self.h0, self.v1, self.h1)
! 
      def __aepack__(self):
          return pack(struct.pack('hhhh', self.v0, self.h0, self.v1, self.h1),
***************
*** 362,377 ****
  class RGBColor:
      """An RGB color"""
!     
      def __init__(self, r, g, b):
          self.r = r
          self.g = g
          self.b = b
!             
      def __repr__(self):
          return "RGBColor(%r, %r, %r)" % (self.r, self.g, self.b)
!     
      def __str__(self):
          return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b)
!     
      def __aepack__(self):
          return pack(struct.pack('hhh', self.r, self.g, self.b),
--- 362,377 ----
  class RGBColor:
      """An RGB color"""
! 
      def __init__(self, r, g, b):
          self.r = r
          self.g = g
          self.b = b
! 
      def __repr__(self):
          return "RGBColor(%r, %r, %r)" % (self.r, self.g, self.b)
! 
      def __str__(self):
          return "0x%x red, 0x%x green, 0x%x blue"% (self.r, self.g, self.b)
! 
      def __aepack__(self):
          return pack(struct.pack('hhh', self.r, self.g, self.b),
***************
*** 382,409 ****
  
  class ObjectSpecifier:
!     
      """A class for constructing and manipulation AE object specifiers in python.
!     
      An object specifier is actually a record with four fields:
!     
      key type    description
      --- ----    -----------
!     
      'want'  type    4-char class code of thing we want,
              e.g. word, paragraph or property
!     
      'form'  enum    how we specify which 'want' thing(s) we want,
              e.g. by index, by range, by name, or by property specifier
!     
      'seld'  any which thing(s) we want,
              e.g. its index, its name, or its property specifier
!     
      'from'  object  the object in which it is contained,
              or null, meaning look for it in the application
!     
      Note that we don't call this class plain "Object", since that name
      is likely to be used by the application.
      """
!     
      def __init__(self, want, form, seld, fr = None):
          self.want = want
--- 382,409 ----
  
  class ObjectSpecifier:
! 
      """A class for constructing and manipulation AE object specifiers in python.
! 
      An object specifier is actually a record with four fields:
! 
      key type    description
      --- ----    -----------
! 
      'want'  type    4-char class code of thing we want,
              e.g. word, paragraph or property
! 
      'form'  enum    how we specify which 'want' thing(s) we want,
              e.g. by index, by range, by name, or by property specifier
! 
      'seld'  any which thing(s) we want,
              e.g. its index, its name, or its property specifier
! 
      'from'  object  the object in which it is contained,
              or null, meaning look for it in the application
! 
      Note that we don't call this class plain "Object", since that name
      is likely to be used by the application.
      """
! 
      def __init__(self, want, form, seld, fr = None):
          self.want = want
***************
*** 411,415 ****
          self.seld = seld
          self.fr = fr
!     
      def __repr__(self):
          s = "ObjectSpecifier(%r, %r, %r" % (self.want, self.form, self.seld)
--- 411,415 ----
          self.seld = seld
          self.fr = fr
! 
      def __repr__(self):
          s = "ObjectSpecifier(%r, %r, %r" % (self.want, self.form, self.seld)
***************
*** 419,423 ****
              s = s + ")"
          return s
!     
      def __aepack__(self):
          return pack({'want': mktype(self.want),
--- 419,423 ----
              s = s + ")"
          return s
! 
      def __aepack__(self):
          return pack({'want': mktype(self.want),
***************
*** 442,446 ****
          else:
              return "Property(%r)" % (self.seld.type,)
!     
      def __str__(self):
          if self.fr:
--- 442,446 ----
          else:
              return "Property(%r)" % (self.seld.type,)
! 
      def __str__(self):
          if self.fr:
***************
*** 461,465 ****
          #   self.want = 'prop'
          self.want = 'prop'
!         ObjectSpecifier.__init__(self, self.want, 'prop', 
                      mktype(self.which), fr)
  
--- 461,465 ----
          #   self.want = 'prop'
          self.want = 'prop'
!         ObjectSpecifier.__init__(self, self.want, 'prop',
                      mktype(self.which), fr)
  
***************
*** 471,475 ****
              rv = rv + ", want=%r" % (self.want,)
          return rv + ")"
!     
      def __str__(self):
          if self.fr:
--- 471,475 ----
              rv = rv + ", want=%r" % (self.want,)
          return rv + ")"
! 
      def __str__(self):
          if self.fr:
***************
*** 480,484 ****
  
  class SelectableItem(ObjectSpecifier):
!     
      def __init__(self, want, seld, fr = None):
          t = type(seld)
--- 480,484 ----
  
  class SelectableItem(ObjectSpecifier):
! 
      def __init__(self, want, seld, fr = None):
          t = type(seld)
***************
*** 507,516 ****
      def __init__(self, which, fr = None):
          SelectableItem.__init__(self, self.want, which, fr)
!     
      def __repr__(self):
          if not self.fr:
              return "%s(%r)" % (self.__class__.__name__, self.seld)
          return "%s(%r, %r)" % (self.__class__.__name__, self.seld, self.fr)
!     
      def __str__(self):
          seld = self.seld
--- 507,516 ----
      def __init__(self, which, fr = None):
          SelectableItem.__init__(self, self.want, which, fr)
! 
      def __repr__(self):
          if not self.fr:
              return "%s(%r)" % (self.__class__.__name__, self.seld)
          return "%s(%r, %r)" % (self.__class__.__name__, self.seld, self.fr)
! 
      def __str__(self):
          seld = self.seld
***************
*** 529,533 ****
          if self.fr: s = s + " of %s" % str(self.fr)
          return s
!         
      def __getattr__(self, name):
          if self._elemdict.has_key(name):
--- 529,533 ----
          if self.fr: s = s + " of %s" % str(self.fr)
          return s
! 
      def __getattr__(self, name):
          if self._elemdict.has_key(name):
***************
*** 538,554 ****
              return cls(self)
          raise AttributeError, name
!         
!         
  class DelayedComponentItem:
      def __init__(self, compclass, fr):
          self.compclass = compclass
          self.fr = fr
!         
      def __call__(self, which):
          return self.compclass(which, self.fr)
!         
      def __repr__(self):
          return "%s(???, %r)" % (self.__class__.__name__, self.fr)
!         
      def __str__(self):
          return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr))
--- 538,554 ----
              return cls(self)
          raise AttributeError, name
! 
! 
  class DelayedComponentItem:
      def __init__(self, compclass, fr):
          self.compclass = compclass
          self.fr = fr
! 
      def __call__(self, which):
          return self.compclass(which, self.fr)
! 
      def __repr__(self):
          return "%s(???, %r)" % (self.__class__.__name__, self.fr)
! 
      def __str__(self):
          return "selector for element %s of %s"%(self.__class__.__name__, str(self.fr))
***************
*** 567,569 ****
  exec template % ("File", 'file')
  exec template % ("InsertionPoint", 'cins')
- 
--- 567,568 ----

Index: applesingle.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/applesingle.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** applesingle.py	18 Nov 2003 23:09:19 -0000	1.3
--- applesingle.py	18 Jul 2004 06:14:45 -0000	1.4
***************
*** 79,83 ****
              elif restype == AS_RESOURCEFORK:
                  self.resourcefork = data
!         
      def tofile(self, path, resonly=False):
          outfile = open(path, 'wb')
--- 79,83 ----
              elif restype == AS_RESOURCEFORK:
                  self.resourcefork = data
! 
      def tofile(self, path, resonly=False):
          outfile = open(path, 'wb')
***************
*** 100,112 ****
                  fp.write(self.resourcefork)
                  fp.close()
!     
  def decode(infile, outpath, resonly=False, verbose=False):
      """decode(infile, outpath [, resonly=False, verbose=False])
  
      Creates a decoded file from an AppleSingle encoded file.
!     If resonly is True, then it will create a regular file at 
      outpath containing only the resource fork from infile.
      Otherwise it will create an AppleDouble file at outpath
!     with the data and resource forks from infile.  On platforms 
      without the MacOS module, it will create inpath and inpath+'.rsrc'
      with the data and resource forks respectively.
--- 100,112 ----
                  fp.write(self.resourcefork)
                  fp.close()
! 
  def decode(infile, outpath, resonly=False, verbose=False):
      """decode(infile, outpath [, resonly=False, verbose=False])
  
      Creates a decoded file from an AppleSingle encoded file.
!     If resonly is True, then it will create a regular file at
      outpath containing only the resource fork from infile.
      Otherwise it will create an AppleDouble file at outpath
!     with the data and resource forks from infile.  On platforms
      without the MacOS module, it will create inpath and inpath+'.rsrc'
      with the data and resource forks respectively.
***************
*** 122,126 ****
      as = AppleSingle(infile, verbose=verbose)
      as.tofile(outpath, resonly=resonly)
!     
  def _test():
      if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4:
--- 122,126 ----
      as = AppleSingle(infile, verbose=verbose)
      as.tofile(outpath, resonly=resonly)
! 
  def _test():
      if len(sys.argv) < 3 or sys.argv[1] == '-r' and len(sys.argv) != 4:
***************
*** 133,137 ****
          resonly = False
      decode(sys.argv[1], sys.argv[2], resonly=resonly)
!     
  if __name__ == '__main__':
      _test()
--- 133,137 ----
          resonly = False
      decode(sys.argv[1], sys.argv[2], resonly=resonly)
! 
  if __name__ == '__main__':
      _test()

Index: appletrawmain.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/appletrawmain.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** appletrawmain.py	9 Apr 2003 13:25:42 -0000	1.2
--- appletrawmain.py	18 Jul 2004 06:14:45 -0000	1.3
***************
*** 24,28 ****
  #
  # Add the Resources directory to the path. This is where files installed
! # by BuildApplet.py with the --extra option show up, and if those files are 
  # modules this sys.path modification is necessary to be able to import them.
  #
--- 24,28 ----
  #
  # Add the Resources directory to the path. This is where files installed
! # by BuildApplet.py with the --extra option show up, and if those files are
  # modules this sys.path modification is necessary to be able to import them.
  #

Index: bgenlocations.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/bgenlocations.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** bgenlocations.py	15 Jul 2004 15:06:07 -0000	1.7
--- bgenlocations.py	18 Jul 2004 06:14:45 -0000	1.8
***************
*** 32,42 ****
  CREATOR="CWIE"
  
! # The previous definitions can be overriden by creating a module 
! # bgenlocationscustomize.py and putting it in site-packages (or anywere else 
  # on sys.path, actually)
  try:
! 	from bgenlocationscustomize import *
  except ImportError:
! 	pass
  
  if not os.path.exists(BGENDIR):
--- 32,42 ----
  CREATOR="CWIE"
  
! # The previous definitions can be overriden by creating a module
! # bgenlocationscustomize.py and putting it in site-packages (or anywere else
  # on sys.path, actually)
  try:
!     from bgenlocationscustomize import *
  except ImportError:
!     pass
  
  if not os.path.exists(BGENDIR):
***************
*** 46,50 ****
  if not os.path.exists(TOOLBOXDIR):
      raise Error, "Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR
!     
  # Sigh, due to the way these are used make sure they end with : or /.
  if BGENDIR[-1] != os.sep:
--- 46,50 ----
  if not os.path.exists(TOOLBOXDIR):
      raise Error, "Please fix bgenlocations.py, TOOLBOXDIR does not exist: %s" % TOOLBOXDIR
! 
  # Sigh, due to the way these are used make sure they end with : or /.
  if BGENDIR[-1] != os.sep:
***************
*** 54,56 ****
  if TOOLBOXDIR[-1] != os.sep:
      TOOLBOXDIR = TOOLBOXDIR + os.sep
-     
--- 54,55 ----

Index: buildtools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/buildtools.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** buildtools.py	12 Feb 2004 17:35:10 -0000	1.11
--- buildtools.py	18 Jul 2004 06:14:45 -0000	1.12
***************
*** 59,66 ****
      file = file.as_pathname()
      return file
!     
! def process(template, filename, destname, copy_codefragment=0, 
          rsrcname=None, others=[], raw=0, progress="default"):
!     
      if progress == "default":
          progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
--- 59,66 ----
      file = file.as_pathname()
      return file
! 
! def process(template, filename, destname, copy_codefragment=0,
          rsrcname=None, others=[], raw=0, progress="default"):
! 
      if progress == "default":
          progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
***************
*** 73,77 ****
      # Read the source and compile it
      # (there's no point overwriting the destination if it has a syntax error)
!     
      fp = open(filename, 'rU')
      text = fp.read()
--- 73,77 ----
      # Read the source and compile it
      # (there's no point overwriting the destination if it has a syntax error)
! 
      fp = open(filename, 'rU')
      text = fp.read()
***************
*** 83,90 ****
      except EOFError:
          raise BuildError, "End-of-file in script %s" % (filename,)
!     
      # Set the destination file name. Note that basename
      # does contain the whole filepath, only a .py is stripped.
!     
      if string.lower(filename[-3:]) == ".py":
          basename = filename[:-3]
--- 83,90 ----
      except EOFError:
          raise BuildError, "End-of-file in script %s" % (filename,)
! 
      # Set the destination file name. Note that basename
      # does contain the whole filepath, only a .py is stripped.
! 
      if string.lower(filename[-3:]) == ".py":
          basename = filename[:-3]
***************
*** 93,97 ****
      else:
          basename = filename
!         
      if not destname:
          if MacOS.runtimemodel == 'macho':
--- 93,97 ----
      else:
          basename = filename
! 
      if not destname:
          if MacOS.runtimemodel == 'macho':
***************
*** 101,105 ****
      if not rsrcname:
          rsrcname = basename + '.rsrc'
!         
      # Try removing the output file. This fails in MachO, but it should
      # do any harm.
--- 101,105 ----
      if not rsrcname:
          rsrcname = basename + '.rsrc'
! 
      # Try removing the output file. This fails in MachO, but it should
      # do any harm.
***************
*** 108,114 ****
      except os.error:
          pass
!     process_common(template, progress, code, rsrcname, destname, 0, 
          copy_codefragment, raw, others, filename)
!     
  
  def update(template, filename, output):
--- 108,114 ----
      except os.error:
          pass
!     process_common(template, progress, code, rsrcname, destname, 0,
          copy_codefragment, raw, others, filename)
! 
  
  def update(template, filename, output):
***************
*** 121,125 ****
      if not output:
          output = filename + ' (updated)'
!     
      # Try removing the output file
      try:
--- 121,125 ----
      if not output:
          output = filename + ' (updated)'
! 
      # Try removing the output file
      try:
***************
*** 130,134 ****
  
  
! def process_common(template, progress, code, rsrcname, destname, is_update, 
          copy_codefragment, raw=0, others=[], filename=None):
      if MacOS.runtimemodel == 'macho':
--- 130,134 ----
  
  
! def process_common(template, progress, code, rsrcname, destname, is_update,
          copy_codefragment, raw=0, others=[], filename=None):
      if MacOS.runtimemodel == 'macho':
***************
*** 140,149 ****
      template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1)
      template = template_fsr.as_pathname()
!     
      # Copy data (not resources, yet) from the template
      if progress:
          progress.label("Copy data fork...")
          progress.set(10)
!     
      if copy_codefragment:
          tmpl = open(template, "rb")
--- 140,149 ----
      template_fsr, d1, d2 = Carbon.File.FSResolveAliasFile(template, 1)
      template = template_fsr.as_pathname()
! 
      # Copy data (not resources, yet) from the template
      if progress:
          progress.label("Copy data fork...")
          progress.set(10)
! 
      if copy_codefragment:
          tmpl = open(template, "rb")
***************
*** 156,162 ****
          del dest
          del tmpl
!     
      # Open the output resource fork
!     
      if progress:
          progress.label("Copy resources...")
--- 156,162 ----
          del dest
          del tmpl
! 
      # Open the output resource fork
! 
      if progress:
          progress.label("Copy resources...")
***************
*** 168,172 ****
          Res.FSCreateResourceFile(destdir, unicode(destfile), RESOURCE_FORK_NAME)
          output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE)
!     
      # Copy the resources from the target specific resource template, if any
      typesfound, ownertype = [], None
--- 168,172 ----
          Res.FSCreateResourceFile(destdir, unicode(destfile), RESOURCE_FORK_NAME)
          output = Res.FSOpenResourceFile(destname, RESOURCE_FORK_NAME, WRITE)
! 
      # Copy the resources from the target specific resource template, if any
      typesfound, ownertype = [], None
***************
*** 184,208 ****
          typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress)
          Res.CloseResFile(input)
!     
      # Check which resource-types we should not copy from the template
      skiptypes = []
      if 'vers' in typesfound: skiptypes.append('vers')
      if 'SIZE' in typesfound: skiptypes.append('SIZE')
!     if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4', 
              'icl8', 'ics4', 'ics8', 'ICN#', 'ics#']
      if not copy_codefragment:
          skiptypes.append('cfrg')
  ##  skipowner = (ownertype <> None)
!     
      # Copy the resources from the template
!     
      input = Res.FSOpenResourceFile(template, RESOURCE_FORK_NAME, READ)
      dummy, tmplowner = copyres(input, output, skiptypes, 1, progress)
!         
      Res.CloseResFile(input)
  ##  if ownertype == None:
  ##      raise BuildError, "No owner resource found in either resource file or template"
      # Make sure we're manipulating the output resource file now
!     
      Res.UseResFile(output)
  
--- 184,208 ----
          typesfound, ownertype = copyres(input, output, skip_oldfile, 0, progress)
          Res.CloseResFile(input)
! 
      # Check which resource-types we should not copy from the template
      skiptypes = []
      if 'vers' in typesfound: skiptypes.append('vers')
      if 'SIZE' in typesfound: skiptypes.append('SIZE')
!     if 'BNDL' in typesfound: skiptypes = skiptypes + ['BNDL', 'FREF', 'icl4',
              'icl8', 'ics4', 'ics8', 'ICN#', 'ics#']
      if not copy_codefragment:
          skiptypes.append('cfrg')
  ##  skipowner = (ownertype <> None)
! 
      # Copy the resources from the template
! 
      input = Res.FSOpenResourceFile(template, RESOURCE_FORK_NAME, READ)
      dummy, tmplowner = copyres(input, output, skiptypes, 1, progress)
! 
      Res.CloseResFile(input)
  ##  if ownertype == None:
  ##      raise BuildError, "No owner resource found in either resource file or template"
      # Make sure we're manipulating the output resource file now
! 
      Res.UseResFile(output)
  
***************
*** 214,221 ****
          newres.AddResource(DEFAULT_APPLET_CREATOR, 0, "Owner resource")
          ownertype = DEFAULT_APPLET_CREATOR
!     
      if code:
          # Delete any existing 'PYC ' resource named __main__
!         
          try:
              res = Res.Get1NamedResource(RESTYPE, RESNAME)
--- 214,221 ----
          newres.AddResource(DEFAULT_APPLET_CREATOR, 0, "Owner resource")
          ownertype = DEFAULT_APPLET_CREATOR
! 
      if code:
          # Delete any existing 'PYC ' resource named __main__
! 
          try:
              res = Res.Get1NamedResource(RESTYPE, RESNAME)
***************
*** 223,238 ****
          except Res.Error:
              pass
!         
          # Create the raw data for the resource from the code object
          if progress:
              progress.label("Write PYC resource...")
              progress.set(120)
!         
          data = marshal.dumps(code)
          del code
          data = (MAGIC + '\0\0\0\0') + data
!         
          # Create the resource and write it
!         
          id = 0
          while id < 128:
--- 223,238 ----
          except Res.Error:
              pass
! 
          # Create the raw data for the resource from the code object
          if progress:
              progress.label("Write PYC resource...")
              progress.set(120)
! 
          data = marshal.dumps(code)
          del code
          data = (MAGIC + '\0\0\0\0') + data
! 
          # Create the resource and write it
! 
          id = 0
          while id < 128:
***************
*** 245,253 ****
          res.WriteResource()
          res.ReleaseResource()
!     
      # Close the output file
!     
      Res.CloseResFile(output)
!     
      # Now set the creator, type and bundle bit of the destination.
      # Done with FSSpec's, FSRef FInfo isn't good enough yet (2.3a1+)
--- 245,253 ----
          res.WriteResource()
          res.ReleaseResource()
! 
      # Close the output file
! 
      Res.CloseResFile(output)
! 
      # Now set the creator, type and bundle bit of the destination.
      # Done with FSSpec's, FSRef FInfo isn't good enough yet (2.3a1+)
***************
*** 259,263 ****
      dest_finfo.Flags = dest_finfo.Flags & ~Carbon.Files.kHasBeenInited
      dest_fss.FSpSetFInfo(dest_finfo)
!     
      macostools.touched(destname)
      if progress:
--- 259,263 ----
      dest_finfo.Flags = dest_finfo.Flags & ~Carbon.Files.kHasBeenInited
      dest_fss.FSpSetFInfo(dest_finfo)
! 
      macostools.touched(destname)
      if progress:
***************
*** 265,269 ****
          progress.inc(0)
  
! def process_common_macho(template, progress, code, rsrcname, destname, is_update, 
          raw=0, others=[], filename=None):
      # Check that we have a filename
--- 265,269 ----
          progress.inc(0)
  
! def process_common_macho(template, progress, code, rsrcname, destname, is_update,
          raw=0, others=[], filename=None):
      # Check that we have a filename
***************
*** 305,309 ****
      if rsrcname:
          realrsrcname = macresource.resource_pathname(rsrcname)
!         builder.files.append((realrsrcname, 
              os.path.join('Contents/Resources', os.path.basename(rsrcname))))
      for o in others:
--- 305,309 ----
      if rsrcname:
          realrsrcname = macresource.resource_pathname(rsrcname)
!         builder.files.append((realrsrcname,
              os.path.join('Contents/Resources', os.path.basename(rsrcname))))
      for o in others:
***************
*** 321,328 ****
      builder.setup()
      builder.build()
!     if progress: 
          progress.label('Done.')
          progress.inc(0)
!     
  ##  macostools.touched(dest_fss)
  
--- 321,328 ----
      builder.setup()
      builder.build()
!     if progress:
          progress.label('Done.')
          progress.inc(0)
! 
  ##  macostools.touched(dest_fss)
  
***************
*** 407,411 ****
                  progress.inc(0)
              shutil.copy2(srcpath, dstpath)
!             
  def writepycfile(codeobject, cfile):
      import marshal
--- 407,411 ----
                  progress.inc(0)
              shutil.copy2(srcpath, dstpath)
! 
  def writepycfile(codeobject, cfile):
      import marshal
***************
*** 418,420 ****
      fc.write(MAGIC)
      fc.close()
- 
--- 418,419 ----

Index: cfmfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/cfmfile.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** cfmfile.py	9 Apr 2003 13:25:42 -0000	1.3
--- cfmfile.py	18 Jul 2004 06:14:45 -0000	1.4
***************
*** 19,24 ****
  
  def mergecfmfiles(srclist, dst, architecture = 'fat'):
!     """Merge all files in srclist into a new file dst. 
!     
      If architecture is given, only code fragments of that type will be used:
      "pwpc" for PPC, "m68k" for cfm68k. This does not work for "classic"
--- 19,24 ----
  
  def mergecfmfiles(srclist, dst, architecture = 'fat'):
!     """Merge all files in srclist into a new file dst.
! 
      If architecture is given, only code fragments of that type will be used:
      "pwpc" for PPC, "m68k" for cfm68k. This does not work for "classic"
***************
*** 26,35 ****
      If architecture is None, all fragments will be used, enabling FAT binaries.
      """
!     
      srclist = list(srclist)
      for i in range(len(srclist)):
          srclist[i] = Carbon.File.pathname(srclist[i])
      dst = Carbon.File.pathname(dst)
!     
      dstfile = open(dst, "wb")
      rf = Res.FSpOpenResFile(dst, 3)
--- 26,35 ----
      If architecture is None, all fragments will be used, enabling FAT binaries.
      """
! 
      srclist = list(srclist)
      for i in range(len(srclist)):
          srclist[i] = Carbon.File.pathname(srclist[i])
      dst = Carbon.File.pathname(dst)
! 
      dstfile = open(dst, "wb")
      rf = Res.FSpOpenResFile(dst, 3)
***************
*** 44,50 ****
                      continue
                  dstcfrg.append(frag)
!                 
                  frag.copydata(dstfile)
!                 
          cfrgres = Res.Resource(dstcfrg.build())
          Res.UseResFile(rf)
--- 44,50 ----
                      continue
                  dstcfrg.append(frag)
! 
                  frag.copydata(dstfile)
! 
          cfrgres = Res.Resource(dstcfrg.build())
          Res.UseResFile(rf)
***************
*** 56,60 ****
  
  class CfrgResource:
!     
      def __init__(self, path = None):
          self.version = 1
--- 56,60 ----
  
  class CfrgResource:
! 
      def __init__(self, path = None):
          self.version = 1
***************
*** 75,83 ****
              self.parse(data)
              if self.version <> 1:
!                 raise error, "unknown 'cfrg' resource format"   
!     
      def parse(self, data):
!         (res1, res2, self.version, 
!             res3, res4, res5, res6, 
              self.memberCount) = struct.unpack("8l", data[:32])
          data = data[32:]
--- 75,83 ----
              self.parse(data)
              if self.version <> 1:
!                 raise error, "unknown 'cfrg' resource format"
! 
      def parse(self, data):
!         (res1, res2, self.version,
!             res3, res4, res5, res6,
              self.memberCount) = struct.unpack("8l", data[:32])
          data = data[32:]
***************
*** 86,90 ****
              data = data[frag.memberSize:]
              self.fragments.append(frag)
!     
      def build(self):
          self.memberCount = len(self.fragments)
--- 86,90 ----
              data = data[frag.memberSize:]
              self.fragments.append(frag)
! 
      def build(self):
          self.memberCount = len(self.fragments)
***************
*** 93,97 ****
              data = data + frag.build()
          return data
!     
      def append(self, frag):
          self.fragments.append(frag)
--- 93,97 ----
              data = data + frag.build()
          return data
! 
      def append(self, frag):
          self.fragments.append(frag)
***************
*** 99,115 ****
  
  class FragmentDescriptor:
!     
      def __init__(self, path, data = None):
          self.path = path
          if data is not None:
              self.parse(data)
!     
      def parse(self, data):
          self.architecture = data[:4]
!         (   self.updatelevel, 
!             self.currentVersion, 
!             self.oldDefVersion, 
              self.stacksize,
!             self.applibdir, 
              self.fragtype,
              self.where,
--- 99,115 ----
  
  class FragmentDescriptor:
! 
      def __init__(self, path, data = None):
          self.path = path
          if data is not None:
              self.parse(data)
! 
      def parse(self, data):
          self.architecture = data[:4]
!         (   self.updatelevel,
!             self.currentVersion,
!             self.oldDefVersion,
              self.stacksize,
!             self.applibdir,
              self.fragtype,
              self.where,
***************
*** 120,132 ****
          pname = data[42:self.memberSize]
          self.name = pname[1:1+ord(pname[0])]
!     
      def build(self):
          data = self.architecture
          data = data + struct.pack("4lhBB4l",
!                 self.updatelevel, 
!                 self.currentVersion, 
!                 self.oldDefVersion, 
                  self.stacksize,
!                 self.applibdir, 
                  self.fragtype,
                  self.where,
--- 120,132 ----
          pname = data[42:self.memberSize]
          self.name = pname[1:1+ord(pname[0])]
! 
      def build(self):
          data = self.architecture
          data = data + struct.pack("4lhBB4l",
!                 self.updatelevel,
!                 self.currentVersion,
!                 self.oldDefVersion,
                  self.stacksize,
!                 self.applibdir,
                  self.fragtype,
                  self.where,
***************
*** 142,146 ****
          data = data + '\000' * (self.memberSize - len(data))
          return data
!     
      def getfragment(self):
          if self.where <> 1:
--- 142,146 ----
          data = data + '\000' * (self.memberSize - len(data))
          return data
! 
      def getfragment(self):
          if self.where <> 1:
***************
*** 154,158 ****
          f.close()
          return frag
!     
      def copydata(self, outfile):
          if self.where <> 1:
--- 154,158 ----
          f.close()
          return frag
! 
      def copydata(self, outfile):
          if self.where <> 1:
***************
*** 162,169 ****
              infile.seek(0, 2)
              self.length = infile.tell()
!         
          # Position input file and record new offset from output file
          infile.seek(self.offset)
!         
          # pad to 16 byte boundaries
          offset = outfile.tell()
--- 162,169 ----
              infile.seek(0, 2)
              self.length = infile.tell()
! 
          # Position input file and record new offset from output file
          infile.seek(self.offset)
! 
          # pad to 16 byte boundaries
          offset = outfile.tell()
***************
*** 172,176 ****
          outfile.seek(offset)
          self.offset = offset
!         
          l = self.length
          while l:
--- 172,176 ----
          outfile.seek(offset)
          self.offset = offset
! 
          l = self.length
          while l:
***************
*** 182,184 ****
                  l = 0
          infile.close()
- 
--- 182,183 ----

Index: findertools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/findertools.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** findertools.py	9 Apr 2003 13:25:42 -0000	1.4
--- findertools.py	18 Jul 2004 06:14:45 -0000	1.5
***************
*** 35,42 ****
      if not _finder_talker:
          _finder_talker = Finder.Finder()
!     _finder_talker.send_flags = ( _finder_talker.send_flags | 
          AppleEvents.kAECanInteract | AppleEvents.kAECanSwitchLayer)
      return _finder_talker
!     
  def launch(file):
      """Open a file thru the finder. Specify file by name or fsspec"""
--- 35,42 ----
      if not _finder_talker:
          _finder_talker = Finder.Finder()
!     _finder_talker.send_flags = ( _finder_talker.send_flags |
          AppleEvents.kAECanInteract | AppleEvents.kAECanSwitchLayer)
      return _finder_talker
! 
  def launch(file):
      """Open a file thru the finder. Specify file by name or fsspec"""
***************
*** 44,48 ****
      fss = Carbon.File.FSSpec(file)
      return finder.open(fss)
!     
  def Print(file):
      """Print a file thru the finder. Specify file by name or fsspec"""
--- 44,48 ----
      fss = Carbon.File.FSSpec(file)
      return finder.open(fss)
! 
  def Print(file):
      """Print a file thru the finder. Specify file by name or fsspec"""
***************
*** 50,54 ****
      fss = Carbon.File.FSSpec(file)
      return finder._print(fss)
!     
  def copy(src, dstdir):
      """Copy a file to a folder"""
--- 50,54 ----
      fss = Carbon.File.FSSpec(file)
      return finder._print(fss)
! 
  def copy(src, dstdir):
      """Copy a file to a folder"""
***************
*** 74,88 ****
      dst_fss = Carbon.File.FSSpec(dstdir)
      return finder.move(src_fss, to=dst_fss)
!     
  def sleep():
      """Put the mac to sleep"""
      finder = _getfinder()
      finder.sleep()
!     
  def shutdown():
      """Shut the mac down"""
      finder = _getfinder()
      finder.shut_down()
!     
  def restart():
      """Restart the mac"""
--- 74,88 ----
      dst_fss = Carbon.File.FSSpec(dstdir)
      return finder.move(src_fss, to=dst_fss)
! 
  def sleep():
      """Put the mac to sleep"""
      finder = _getfinder()
      finder.sleep()
! 
  def shutdown():
      """Shut the mac down"""
      finder = _getfinder()
      finder.shut_down()
! 
  def restart():
      """Restart the mac"""
***************
*** 101,105 ****
      file_alias = fsr.FSNewAliasMinimal()
      return finder.reveal(file_alias)
!     
  def select(file):
      """select a file in the finder. Specify file by name, fsref or fsspec."""
--- 101,105 ----
      file_alias = fsr.FSNewAliasMinimal()
      return finder.reveal(file_alias)
! 
  def select(file):
      """select a file in the finder. Specify file by name, fsref or fsspec."""
***************
*** 108,114 ****
      file_alias = fsr.FSNewAliasMinimal()
      return finder.select(file_alias)
!     
  def update(file):
!     """Update the display of the specified object(s) to match 
      their on-disk representation. Specify file by name, fsref or fsspec."""
      finder = _getfinder()
--- 108,114 ----
      file_alias = fsr.FSNewAliasMinimal()
      return finder.select(file_alias)
! 
  def update(file):
!     """Update the display of the specified object(s) to match
      their on-disk representation. Specify file by name, fsref or fsspec."""
      finder = _getfinder()
***************
*** 130,134 ****
      else:
          return _setcomment(object_alias, comment)
!     
  def _setcomment(object_alias, comment):
      finder = _getfinder()
--- 130,134 ----
      else:
          return _setcomment(object_alias, comment)
! 
  def _setcomment(object_alias, comment):
      finder = _getfinder()
***************
*** 220,228 ****
              return 1
      return 0
!     
  def processinfo(processname):
      """Return an object with all process properties as attributes for processname. MacOS9"""
      p = _process()
!     
      if processname == "Finder":
          p.partition = None
--- 220,228 ----
              return 1
      return 0
! 
  def processinfo(processname):
      """Return an object with all process properties as attributes for processname. MacOS9"""
      p = _process()
! 
      if processname == "Finder":
          p.partition = None
***************
*** 239,243 ****
      p.hasscripting = _processproperty(processname, 'hscr')      #Does the process have a scripting terminology, i.e., can it be scripted?
      return p
!     
  def _processproperty(processname, property):
      """return the partition size and memory used for processname"""
--- 239,243 ----
      p.hasscripting = _processproperty(processname, 'hscr')      #Does the process have a scripting terminology, i.e., can it be scripted?
      return p
! 
  def _processproperty(processname, property):
      """return the partition size and memory used for processname"""
***************
*** 257,261 ****
  #---------------------------------------------------
  #   Mess around with Finder windows.
!     
  def openwindow(object):
      """Open a Finder window for object, Specify object by name or fsspec."""
--- 257,261 ----
  #---------------------------------------------------
  #   Mess around with Finder windows.
! 
  def openwindow(object):
      """Open a Finder window for object, Specify object by name or fsspec."""
***************
*** 272,276 ****
      if args.has_key('errn'):
          raise Error, aetools.decodeerror(args)
!     
  def closewindow(object):
      """Close a Finder window for folder, Specify by path."""
--- 272,276 ----
      if args.has_key('errn'):
          raise Error, aetools.decodeerror(args)
! 
  def closewindow(object):
      """Close a Finder window for folder, Specify by path."""
***************
*** 296,300 ****
          return _getlocation(object_alias)
      return _setlocation(object_alias, pos)
!     
  def _setlocation(object_alias, (x, y)):
      """_setlocation: Set the location of the icon for the object."""
--- 296,300 ----
          return _getlocation(object_alias)
      return _setlocation(object_alias, pos)
! 
  def _setlocation(object_alias, (x, y)):
      """_setlocation: Set the location of the icon for the object."""
***************
*** 310,314 ****
          raise Error, aetools.decodeerror(args)
      return (x,y)
!     
  def _getlocation(object_alias):
      """_getlocation: get the location of the icon for the object."""
--- 310,314 ----
          raise Error, aetools.decodeerror(args)
      return (x,y)
! 
  def _getlocation(object_alias):
      """_getlocation: get the location of the icon for the object."""
***************
*** 335,339 ****
          index = 0
      return _setlabel(object_alias, index)
!     
  def _getlabel(object_alias):
      """label: Get the label for the object."""
--- 335,339 ----
          index = 0
      return _setlabel(object_alias, index)
! 
  def _getlabel(object_alias):
      """label: Get the label for the object."""
***************
*** 379,383 ****
          return _getwindowview(folder_alias)
      return _setwindowview(folder_alias, view)
!     
  def _setwindowview(folder_alias, view=0):
      """set the windowview"""
--- 379,383 ----
          return _getwindowview(folder_alias)
      return _setwindowview(folder_alias, view)
! 
  def _setwindowview(folder_alias, view=0):
      """set the windowview"""
***************
*** 391,401 ****
          _v = aetypes.Type('iimg')
      finder = _getfinder()
!     aeobj_0 = aetypes.ObjectSpecifier(want = aetypes.Type('cfol'), 
              form = 'alis', seld = folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), 
              form = 'prop', seld = aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), 
              form = 'prop', seld = aetypes.Type('pvew'), fr=aeobj_1)
!     aeobj_3 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'), 
              form = 'prop', seld = _v, fr=None)
      _code = 'core'
--- 391,401 ----
          _v = aetypes.Type('iimg')
      finder = _getfinder()
!     aeobj_0 = aetypes.ObjectSpecifier(want = aetypes.Type('cfol'),
              form = 'alis', seld = folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'),
              form = 'prop', seld = aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'),
              form = 'prop', seld = aetypes.Type('pvew'), fr=aeobj_1)
!     aeobj_3 = aetypes.ObjectSpecifier(want = aetypes.Type('prop'),
              form = 'prop', seld = _v, fr=None)
      _code = 'core'
***************
*** 438,442 ****
          return _getwindowsize(folder_alias)
      return _setwindowsize(folder_alias, size)
!     
  def _setwindowsize(folder_alias, (w, h)):
      """Set the size of a Finder window for folder to (w, h)"""
--- 438,442 ----
          return _getwindowsize(folder_alias)
      return _setwindowsize(folder_alias, size)
! 
  def _setwindowsize(folder_alias, (w, h)):
      """Set the size of a Finder window for folder to (w, h)"""
***************
*** 449,455 ****
      aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1)
      args['----'] = aeobj_2
--- 449,455 ----
      aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1)
      args['----'] = aeobj_2
***************
*** 459,463 ****
          raise Error, aetools.decodeerror(args)
      return (w, h)
!         
  def _getwindowsize(folder_alias):
      """Set the size of a Finder window for folder to (w, h)"""
--- 459,463 ----
          raise Error, aetools.decodeerror(args)
      return (w, h)
! 
  def _getwindowsize(folder_alias):
      """Set the size of a Finder window for folder to (w, h)"""
***************
*** 465,473 ****
      args = {}
      attrs = {}
!     aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), 
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('posn'), fr=aeobj_1)
      args['----'] = aeobj_2
--- 465,473 ----
      args = {}
      attrs = {}
!     aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('posn'), fr=aeobj_1)
      args['----'] = aeobj_2
***************
*** 489,493 ****
          pos = (pos.h, pos.v)
      return _setwindowposition(folder_alias, pos)
!             
  def _setwindowposition(folder_alias, (x, y)):
      """Set the size of a Finder window for folder to (w, h)."""
--- 489,493 ----
          pos = (pos.h, pos.v)
      return _setwindowposition(folder_alias, pos)
! 
  def _setwindowposition(folder_alias, (x, y)):
      """Set the size of a Finder window for folder to (w, h)."""
***************
*** 495,503 ****
      args = {}
      attrs = {}
!     aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), 
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('posn'), fr=aeobj_1)
      args['----'] = aeobj_2
--- 495,503 ----
      args = {}
      attrs = {}
!     aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('posn'), fr=aeobj_1)
      args['----'] = aeobj_2
***************
*** 514,522 ****
      args = {}
      attrs = {}
!     aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), 
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1)
      args['----'] = aeobj_2
--- 514,522 ----
      args = {}
      attrs = {}
!     aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'),
              form="alis", seld=folder_alias, fr=None)
!     aeobj_1 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('cwnd'), fr=aeobj_0)
!     aeobj_2 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('ptsz'), fr=aeobj_1)
      args['----'] = aeobj_2
***************
*** 537,541 ****
          return _geticon(object_alias)
      return _seticon(object_alias, icondata)
!     
  def _geticon(object_alias):
      """get the icondata for object. Binary data of some sort."""
--- 537,541 ----
          return _geticon(object_alias)
      return _seticon(object_alias, icondata)
! 
  def _geticon(object_alias):
      """get the icondata for object. Binary data of some sort."""
***************
*** 543,549 ****
      args = {}
      attrs = {}
!     aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), 
              form="alis", seld=object_alias, fr=None)
!     aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00)
      args['----'] = aeobj_01
--- 543,549 ----
      args = {}
      attrs = {}
!     aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'),
              form="alis", seld=object_alias, fr=None)
!     aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00)
      args['----'] = aeobj_01
***************
*** 559,565 ****
      args = {}
      attrs = {}
!     aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'), 
              form="alis", seld=object_alias, fr=None)
!     aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'), 
              form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00)
      args['----'] = aeobj_01
--- 559,565 ----
      args = {}
      attrs = {}
!     aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'),
              form="alis", seld=object_alias, fr=None)
!     aeobj_01 = aetypes.ObjectSpecifier(want=aetypes.Type('prop'),
              form="prop", seld=aetypes.Type('iimg'), fr=aeobj_00)
      args['----'] = aeobj_01
***************
*** 574,578 ****
  #---------------------------------------------------
  #   Volumes and servers.
!     
  def mountvolume(volume, server=None, username=None, password=None):
      """mount a volume, local or on a server on AppleTalk.
--- 574,578 ----
  #---------------------------------------------------
  #   Volumes and servers.
! 
  def mountvolume(volume, server=None, username=None, password=None):
      """mount a volume, local or on a server on AppleTalk.
***************
*** 599,603 ****
      """unmount a volume that's on the desktop"""
      putaway(volume)
!     
  def putaway(object):
      """puth the object away, whereever it came from."""
--- 599,603 ----
      """unmount a volume that's on the desktop"""
      putaway(volume)
! 
  def putaway(object):
      """puth the object away, whereever it came from."""
***************
*** 676,680 ****
              status = 0
      return status
!     
  def movetotrash(path):
      """move the object to the trash"""
--- 676,680 ----
              status = 0
      return status
! 
  def movetotrash(path):
      """move the object to the trash"""
***************
*** 767,771 ****
      print '\tSystem beep volume'
      for i in range(0, 7):
!         volumelevel(i)      
          MacOS.SysBeep()
  
--- 767,771 ----
      print '\tSystem beep volume'
      for i in range(0, 7):
!         volumelevel(i)
          MacOS.SysBeep()
  
***************
*** 806,810 ****
      s = 'This is a comment no one reads!'
      comment(f, s)           # set the Finder comment
!     
  def _test3():
      print 'MacOS9 or better specific functions'
--- 806,810 ----
      s = 'This is a comment no one reads!'
      comment(f, s)           # set the Finder comment
! 
  def _test3():
      print 'MacOS9 or better specific functions'
***************
*** 814,818 ****
      for p in pr:
          print '\t', p
!     
      # get attributes of the first process in the list
      print 'Attributes of the first process in the list:'
--- 814,818 ----
      for p in pr:
          print '\t', p
! 
      # get attributes of the first process in the list
      print 'Attributes of the first process in the list:'
***************
*** 830,832 ****
      _test2()
      _test3()
-     
--- 830,831 ----

Index: gensuitemodule.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/gensuitemodule.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** gensuitemodule.py	12 Feb 2004 17:35:10 -0000	1.11
--- gensuitemodule.py	18 Jul 2004 06:14:45 -0000	1.12
***************
*** 32,36 ****
      sys.stderr.write("Usage: %s [opts] application-or-resource-file\n" % sys.argv[0])
      sys.stderr.write("""Options:
! --output pkgdir  Pathname of the output package (short: -o)  
  --resource       Parse resource file in stead of launching application (-r)
  --base package   Use another base package in stead of default StdSuites (-b)
--- 32,36 ----
      sys.stderr.write("Usage: %s [opts] application-or-resource-file\n" % sys.argv[0])
      sys.stderr.write("""Options:
! --output pkgdir  Pathname of the output package (short: -o)
  --resource       Parse resource file in stead of launching application (-r)
  --base package   Use another base package in stead of default StdSuites (-b)
***************
*** 50,54 ****
          except getopt.GetoptError:
              usage()
!         
          process_func = processfile
          basepkgname = 'StdSuites'
--- 50,54 ----
          except getopt.GetoptError:
              usage()
! 
          process_func = processfile
          basepkgname = 'StdSuites'
***************
*** 58,62 ****
          dump = None
          verbose = None
!         
          for o, a in opts:
              if o in ('-r', '--resource'):
--- 58,62 ----
          dump = None
          verbose = None
! 
          for o, a in opts:
              if o in ('-r', '--resource'):
***************
*** 80,96 ****
              if o in ('-v', '--verbose'):
                  verbose = sys.stderr
!                 
!                     
          if output and len(args) > 1:
              sys.stderr.write("%s: cannot specify --output with multiple inputs\n" % sys.argv[0])
              sys.exit(1)
!             
          for filename in args:
!             process_func(filename, output=output, basepkgname=basepkgname, 
                  edit_modnames=edit_modnames, creatorsignature=creatorsignature,
                  dump=dump, verbose=verbose)
      else:
          main_interactive()
!         
  def main_interactive(interact=0, basepkgname='StdSuites'):
      if interact:
--- 80,96 ----
              if o in ('-v', '--verbose'):
                  verbose = sys.stderr
! 
! 
          if output and len(args) > 1:
              sys.stderr.write("%s: cannot specify --output with multiple inputs\n" % sys.argv[0])
              sys.exit(1)
! 
          for filename in args:
!             process_func(filename, output=output, basepkgname=basepkgname,
                  edit_modnames=edit_modnames, creatorsignature=creatorsignature,
                  dump=dump, verbose=verbose)
      else:
          main_interactive()
! 
  def main_interactive(interact=0, basepkgname='StdSuites'):
      if interact:
***************
*** 120,124 ****
          processfile_fromresource(filename, edit_modnames=edit_modnames,
              basepkgname=basepkgname, verbose=sys.stderr)
!             
  def is_scriptable(application):
      """Return true if the application is scriptable"""
--- 120,124 ----
          processfile_fromresource(filename, edit_modnames=edit_modnames,
              basepkgname=basepkgname, verbose=sys.stderr)
! 
  def is_scriptable(application):
      """Return true if the application is scriptable"""
***************
*** 142,146 ****
      return n_terminology > 0
  
! def processfile_fromresource(fullname, output=None, basepkgname=None, 
          edit_modnames=None, creatorsignature=None, dump=None, verbose=None):
      """Process all resources in a single file"""
--- 142,146 ----
      return n_terminology > 0
  
! def processfile_fromresource(fullname, output=None, basepkgname=None,
          edit_modnames=None, creatorsignature=None, dump=None, verbose=None):
      """Process all resources in a single file"""
***************
*** 160,164 ****
              res = Get1IndResource('aeut', 1+i)
              resources.append(res)
!         if verbose: 
              print >>verbose, "\nLISTING aete+aeut RESOURCES IN", repr(fullname)
          aetelist = []
--- 160,164 ----
              res = Get1IndResource('aeut', 1+i)
              resources.append(res)
!         if verbose:
              print >>verbose, "\nLISTING aete+aeut RESOURCES IN", repr(fullname)
          aetelist = []
***************
*** 177,185 ****
      if dump:
          dumpaetelist(aetelist, dump)
!     compileaetelist(aetelist, fullname, output=output, 
          basepkgname=basepkgname, edit_modnames=edit_modnames,
          creatorsignature=creatorsignature, verbose=verbose)
  
! def processfile(fullname, output=None, basepkgname=None, 
          edit_modnames=None, creatorsignature=None, dump=None,
          verbose=None):
--- 177,185 ----
      if dump:
          dumpaetelist(aetelist, dump)
!     compileaetelist(aetelist, fullname, output=output,
          basepkgname=basepkgname, edit_modnames=edit_modnames,
          creatorsignature=creatorsignature, verbose=verbose)
  
! def processfile(fullname, output=None, basepkgname=None,
          edit_modnames=None, creatorsignature=None, dump=None,
          verbose=None):
***************
*** 205,209 ****
                  print >>verbose, "Launched", fullname
          raw = aetools.unpack(aedescobj)
!         if not raw: 
              if verbose:
                  print >>verbose, 'Unpack returned empty value:', raw
--- 205,209 ----
                  print >>verbose, "Launched", fullname
          raw = aetools.unpack(aedescobj)
!         if not raw:
              if verbose:
                  print >>verbose, 'Unpack returned empty value:', raw
***************
*** 219,225 ****
          return
      compileaete(aete, None, fullname, output=output, basepkgname=basepkgname,
!         creatorsignature=creatorsignature, edit_modnames=edit_modnames, 
          verbose=verbose)
!         
  def getappterminology(fullname, verbose=None):
      """Get application terminology by sending an AppleEvent"""
--- 219,225 ----
          return
      compileaete(aete, None, fullname, output=output, basepkgname=basepkgname,
!         creatorsignature=creatorsignature, edit_modnames=edit_modnames,
          verbose=verbose)
! 
  def getappterminology(fullname, verbose=None):
      """Get application terminology by sending an AppleEvent"""
***************
*** 252,261 ****
      # Now pick the bits out of the return that we need.
      return reply[1]['----'], cr
-     
  
! def compileaetelist(aetelist, fullname, output=None, basepkgname=None, 
              edit_modnames=None, creatorsignature=None, verbose=None):
      for aete, resinfo in aetelist:
!         compileaete(aete, resinfo, fullname, output=output, 
              basepkgname=basepkgname, edit_modnames=edit_modnames,
              creatorsignature=creatorsignature, verbose=verbose)
--- 252,261 ----
      # Now pick the bits out of the return that we need.
      return reply[1]['----'], cr
  
! 
! def compileaetelist(aetelist, fullname, output=None, basepkgname=None,
              edit_modnames=None, creatorsignature=None, verbose=None):
      for aete, resinfo in aetelist:
!         compileaete(aete, resinfo, fullname, output=output,
              basepkgname=basepkgname, edit_modnames=edit_modnames,
              creatorsignature=creatorsignature, verbose=verbose)
***************
*** 264,268 ****
      import pprint
      pprint.pprint(aetelist, output)
!     
  def decode(data, verbose=None):
      """Decode a resource into a python data structure"""
--- 264,268 ----
      import pprint
      pprint.pprint(aetelist, output)
! 
  def decode(data, verbose=None):
      """Decode a resource into a python data structure"""
***************
*** 428,432 ****
      ]
  
! def compileaete(aete, resinfo, fname, output=None, basepkgname=None, 
          edit_modnames=None, creatorsignature=None, verbose=None):
      """Generate code for a full aete resource. fname passed for doc purposes"""
--- 428,432 ----
      ]
  
! def compileaete(aete, resinfo, fname, output=None, basepkgname=None,
          edit_modnames=None, creatorsignature=None, verbose=None):
      """Generate code for a full aete resource. fname passed for doc purposes"""
***************
*** 501,505 ****
      for code, modname in suitelist:
          fp.write("from %s import *\n"%modname)
!     
      # Generate property dicts and element dicts for all types declared in this module
      fp.write("\ndef getbaseclasses(v):\n")
--- 501,505 ----
      for code, modname in suitelist:
          fp.write("from %s import *\n"%modname)
! 
      # Generate property dicts and element dicts for all types declared in this module
      fp.write("\ndef getbaseclasses(v):\n")
***************
*** 535,539 ****
          fp.write("}\n")
  
!     
      if suitelist:
          fp.write("\n\nclass %s(%s_Events"%(packagename, suitelist[0][1]))
--- 535,539 ----
          fp.write("}\n")
  
! 
      if suitelist:
          fp.write("\n\nclass %s(%s_Events"%(packagename, suitelist[0][1]))
***************
*** 555,568 ****
          self.output = output
          self.verbose = verbose
!         
          # Set by precompilesuite
          self.pathname = None
          self.modname = None
!         
          # Set by compilesuite
          self.fp = None
          self.basemodule = None
          self.enumsneeded = {}
!             
      def precompilesuite(self):
          """Parse a single suite without generating the output. This step is needed
--- 555,568 ----
          self.output = output
          self.verbose = verbose
! 
          # Set by precompilesuite
          self.pathname = None
          self.modname = None
! 
          # Set by compilesuite
          self.fp = None
          self.basemodule = None
          self.enumsneeded = {}
! 
      def precompilesuite(self):
          """Parse a single suite without generating the output. This step is needed
***************
*** 570,574 ****
          in other suites"""
          [name, desc, code, level, version, events, classes, comps, enums] = self.suite
!         
          modname = identify(name)
          if len(modname) > 28:
--- 570,574 ----
          in other suites"""
          [name, desc, code, level, version, events, classes, comps, enums] = self.suite
! 
          modname = identify(name)
          if len(modname) > 28:
***************
*** 587,593 ****
          if not self.pathname:
              return None, None, None
!     
          self.modname = os.path.splitext(os.path.split(self.pathname)[1])[0]
!         
          if self.basepackage and self.basepackage._code_to_module.has_key(code):
              # We are an extension of a baseclass (usually an application extending
--- 587,593 ----
          if not self.pathname:
              return None, None, None
! 
          self.modname = os.path.splitext(os.path.split(self.pathname)[1])[0]
! 
          if self.basepackage and self.basepackage._code_to_module.has_key(code):
              # We are an extension of a baseclass (usually an application extending
***************
*** 597,605 ****
              # We are not an extension.
              basemodule = None
!     
          self.enumsneeded = {}
          for event in events:
              self.findenumsinevent(event)
!     
          objc = ObjectCompiler(None, self.modname, basemodule, interact=(self.edit_modnames is None),
              verbose=self.verbose)
--- 597,605 ----
              # We are not an extension.
              basemodule = None
! 
          self.enumsneeded = {}
          for event in events:
              self.findenumsinevent(event)
! 
          objc = ObjectCompiler(None, self.modname, basemodule, interact=(self.edit_modnames is None),
              verbose=self.verbose)
***************
*** 612,625 ****
          for enum in enums:
              objc.compileenumeration(enum)
!         
          for enum in self.enumsneeded.keys():
              objc.checkforenum(enum)
!             
          objc.dumpindex()
!         
          precompinfo = objc.getprecompinfo(self.modname)
!         
          return code, self.modname, precompinfo
!     
      def compilesuite(self, major, minor, language, script, fname, precompinfo):
          """Generate code for a single suite"""
--- 612,625 ----
          for enum in enums:
              objc.compileenumeration(enum)
! 
          for enum in self.enumsneeded.keys():
              objc.checkforenum(enum)
! 
          objc.dumpindex()
! 
          precompinfo = objc.getprecompinfo(self.modname)
! 
          return code, self.modname, precompinfo
! 
      def compilesuite(self, major, minor, language, script, fname, precompinfo):
          """Generate code for a single suite"""
***************
*** 638,650 ****
                  return 1
              return 0
!             
          events.sort()
          classes.sort(class_sorter)
          comps.sort()
          enums.sort()
!         
          self.fp = fp = open(self.pathname, 'w')
          MacOS.SetCreatorAndType(self.pathname, 'Pyth', 'TEXT')
!         
          fp.write('"""Suite %s: %s\n' % (ascii(name), ascii(desc)))
          fp.write("Level %d, version %d\n\n" % (level, version))
--- 638,650 ----
                  return 1
              return 0
! 
          events.sort()
          classes.sort(class_sorter)
          comps.sort()
          enums.sort()
! 
          self.fp = fp = open(self.pathname, 'w')
          MacOS.SetCreatorAndType(self.pathname, 'Pyth', 'TEXT')
! 
          fp.write('"""Suite %s: %s\n' % (ascii(name), ascii(desc)))
          fp.write("Level %d, version %d\n\n" % (level, version))
***************
*** 653,657 ****
              (major, minor, language, script))
          fp.write('"""\n\n')
!         
          fp.write('import aetools\n')
          fp.write('import MacOS\n\n')
--- 653,657 ----
              (major, minor, language, script))
          fp.write('"""\n\n')
! 
          fp.write('import aetools\n')
          fp.write('import MacOS\n\n')
***************
*** 671,675 ****
          self.basemodule = basemodule
          self.compileclassheader()
!     
          self.enumsneeded = {}
          if events:
--- 671,675 ----
          self.basemodule = basemodule
          self.compileclassheader()
! 
          self.enumsneeded = {}
          if events:
***************
*** 678,682 ****
          else:
              fp.write("    pass\n\n")
!     
          objc = ObjectCompiler(fp, self.modname, basemodule, precompinfo, interact=(self.edit_modnames is None),
              verbose=self.verbose)
--- 678,682 ----
          else:
              fp.write("    pass\n\n")
! 
          objc = ObjectCompiler(fp, self.modname, basemodule, precompinfo, interact=(self.edit_modnames is None),
              verbose=self.verbose)
***************
*** 689,698 ****
          for enum in enums:
              objc.compileenumeration(enum)
!         
          for enum in self.enumsneeded.keys():
              objc.checkforenum(enum)
!             
          objc.dumpindex()
!         
      def compileclassheader(self):
          """Generate class boilerplate"""
--- 689,698 ----
          for enum in enums:
              objc.compileenumeration(enum)
! 
          for enum in self.enumsneeded.keys():
              objc.checkforenum(enum)
! 
          objc.dumpindex()
! 
      def compileclassheader(self):
          """Generate class boilerplate"""
***************
*** 704,708 ****
          else:
              self.fp.write("class %s:\n\n"%classname)
!         
      def compileevent(self, event):
          """Generate code for a single event"""
--- 704,708 ----
          else:
              self.fp.write("class %s:\n\n"%classname)
! 
      def compileevent(self, event):
          """Generate code for a single event"""
***************
*** 718,722 ****
                  fp.write("        %r : %r,\n"%(identify(a[0]), a[1]))
              fp.write("    }\n\n")
!             
          #
          # Generate function header
--- 718,722 ----
                  fp.write("        %r : %r,\n"%(identify(a[0]), a[1]))
              fp.write("    }\n\n")
! 
          #
          # Generate function header
***************
*** 724,728 ****
          has_arg = (not is_null(accepts))
          opt_arg = (has_arg and is_optional(accepts))
!         
          fp.write("    def %s(self, "%funcname)
          if has_arg:
--- 724,728 ----
          has_arg = (not is_null(accepts))
          opt_arg = (has_arg and is_optional(accepts))
! 
          fp.write("    def %s(self, "%funcname)
          if has_arg:
***************
*** 804,808 ****
          fp.write("            return _arguments['----']\n")
          fp.write("\n")
!             
      def findenumsinevent(self, event):
          """Find all enums for a single event"""
--- 804,808 ----
          fp.write("            return _arguments['----']\n")
          fp.write("\n")
! 
      def findenumsinevent(self, event):
          """Find all enums for a single event"""
***************
*** 813,817 ****
                  if ename <> '****':
                      self.enumsneeded[ename] = 1
!     
  #
  # This class stores the code<->name translations for a single module. It is used
--- 813,817 ----
                  if ename <> '****':
                      self.enumsneeded[ename] = 1
! 
  #
  # This class stores the code<->name translations for a single module. It is used
***************
*** 822,826 ****
  #
  class CodeNameMapper:
!     
      def __init__(self, interact=1, verbose=None):
          self.code2name = {
--- 822,826 ----
  #
  class CodeNameMapper:
! 
      def __init__(self, interact=1, verbose=None):
          self.code2name = {
***************
*** 840,849 ****
          self.can_interact = interact
          self.verbose = verbose
!         
      def addnamecode(self, type, name, code):
          self.name2code[type][name] = code
          if not self.code2name[type].has_key(code):
              self.code2name[type][code] = name
!         
      def hasname(self, name):
          for dict in self.name2code.values():
--- 840,849 ----
          self.can_interact = interact
          self.verbose = verbose
! 
      def addnamecode(self, type, name, code):
          self.name2code[type][name] = code
          if not self.code2name[type].has_key(code):
              self.code2name[type][code] = name
! 
      def hasname(self, name):
          for dict in self.name2code.values():
***************
*** 851,858 ****
                  return True
          return False
!         
      def hascode(self, type, code):
          return self.code2name[type].has_key(code)
!         
      def findcodename(self, type, code):
          if not self.hascode(type, code):
--- 851,858 ----
                  return True
          return False
! 
      def hascode(self, type, code):
          return self.code2name[type].has_key(code)
! 
      def findcodename(self, type, code):
          if not self.hascode(type, code):
***************
*** 864,871 ****
              qualname = name
          return name, qualname, self.modulename
!         
      def getall(self, type):
          return self.code2name[type].items()
!             
      def addmodule(self, module, name, star_imported):
          self.modulename = name
--- 864,871 ----
              qualname = name
          return name, qualname, self.modulename
! 
      def getall(self, type):
          return self.code2name[type].items()
! 
      def addmodule(self, module, name, star_imported):
          self.modulename = name
***************
*** 879,890 ****
          for code, name in module._compdeclarations.items():
              self.addnamecode('comparison', name, code)
!         
      def prepareforexport(self, name=None):
          if not self.modulename:
              self.modulename = name
          return self
!             
  class ObjectCompiler:
!     def __init__(self, fp, modname, basesuite, othernamemappers=None, interact=1, 
              verbose=None):
          self.fp = fp
--- 879,890 ----
          for code, name in module._compdeclarations.items():
              self.addnamecode('comparison', name, code)
! 
      def prepareforexport(self, name=None):
          if not self.modulename:
              self.modulename = name
          return self
! 
  class ObjectCompiler:
!     def __init__(self, fp, modname, basesuite, othernamemappers=None, interact=1,
              verbose=None):
          self.fp = fp
***************
*** 902,906 ****
              basemapper.addmodule(basesuite, '', 1)
              self.namemappers.append(basemapper)
!         
      def getprecompinfo(self, modname):
          list = []
--- 902,906 ----
              basemapper.addmodule(basesuite, '', 1)
              self.namemappers.append(basemapper)
! 
      def getprecompinfo(self, modname):
          list = []
***************
*** 910,914 ****
                  list.append(emapper)
          return list
!         
      def findcodename(self, type, code):
          while 1:
--- 910,914 ----
                  list.append(emapper)
          return list
! 
      def findcodename(self, type, code):
          while 1:
***************
*** 936,940 ****
                  mapper.addmodule(m, m.__name__, 0)
                  self.namemappers.append(mapper)
!                 
      def hasname(self, name):
          for mapper in self.othernamemappers:
--- 936,940 ----
                  mapper.addmodule(m, m.__name__, 0)
                  self.namemappers.append(mapper)
! 
      def hasname(self, name):
          for mapper in self.othernamemappers:
***************
*** 944,948 ****
                  return True
          return False
!     
      def askdefinitionmodule(self, type, code):
          if not self.can_interact:
--- 944,948 ----
                  return True
          return False
! 
      def askdefinitionmodule(self, type, code):
          if not self.can_interact:
***************
*** 959,963 ****
          self.fp.write("import %s\n"%modname)
          return m
!         
      def compileclass(self, cls):
          [name, code, desc, properties, elements] = cls
--- 959,963 ----
          self.fp.write("import %s\n"%modname)
          return m
! 
      def compileclass(self, cls):
          [name, code, desc, properties, elements] = cls
***************
*** 981,985 ****
          for elem in elements:
              self.compileelement(elem)
!     
      def compileproperty(self, prop, is_application_class=False):
          [name, code, what] = prop
--- 981,985 ----
          for elem in elements:
              self.compileelement(elem)
! 
      def compileproperty(self, prop, is_application_class=False):
          [name, code, what] = prop
***************
*** 1004,1008 ****
          if is_application_class and self.fp:
              self.fp.write("%s = _Prop_%s()\n" % (pname, pname))
!     
      def compileelement(self, elem):
          [code, keyform] = elem
--- 1004,1008 ----
          if is_application_class and self.fp:
              self.fp.write("%s = _Prop_%s()\n" % (pname, pname))
! 
      def compileelement(self, elem):
          [code, keyform] = elem
***************
*** 1057,1064 ****
              else:
                  elist.append((name, ename))
!                 
          plist.sort()
          elist.sort()
!         
          if self.fp:
              self.fp.write("%s._privpropdict = {\n"%cname)
--- 1057,1064 ----
              else:
                  elist.append((name, ename))
! 
          plist.sort()
          elist.sort()
! 
          if self.fp:
              self.fp.write("%s._privpropdict = {\n"%cname)
***************
*** 1070,1074 ****
                  self.fp.write("    '%s' : %s,\n"%(n, fulln))
              self.fp.write("}\n")
!     
      def compilecomparison(self, comp):
          [name, code, comment] = comp
--- 1070,1074 ----
                  self.fp.write("    '%s' : %s,\n"%(n, fulln))
              self.fp.write("}\n")
! 
      def compilecomparison(self, comp):
          [name, code, comment] = comp
***************
*** 1078,1082 ****
              self.fp.write("class %s(aetools.NComparison):\n" % iname)
              self.fp.write('    """%s - %s """\n' % (ascii(name), ascii(comment)))
!         
      def compileenumeration(self, enum):
          [code, items] = enum
--- 1078,1082 ----
              self.fp.write("class %s(aetools.NComparison):\n" % iname)
              self.fp.write('    """%s - %s """\n' % (ascii(name), ascii(comment)))
! 
      def compileenumeration(self, enum):
          [code, items] = enum
***************
*** 1089,1097 ****
          self.namemappers[0].addnamecode('enum', name, code)
          return code
!     
      def compileenumerator(self, item):
          [name, code, desc] = item
          self.fp.write("    %r : %r,\t# %s\n" % (identify(name), code, ascii(desc)))
!         
      def checkforenum(self, enum):
          """This enum code is used by an event. Make sure it's available"""
--- 1089,1097 ----
          self.namemappers[0].addnamecode('enum', name, code)
          return code
! 
      def compileenumerator(self, item):
          [name, code, desc] = item
          self.fp.write("    %r : %r,\t# %s\n" % (identify(name), code, ascii(desc)))
! 
      def checkforenum(self, enum):
          """This enum code is used by an event. Make sure it's available"""
***************
*** 1104,1113 ****
              if self.fp:
                  self.fp.write("from %s import %s\n"%(module, name))
!         
      def dumpindex(self):
          if not self.fp:
              return
          self.fp.write("\n#\n# Indices of types declared in this module\n#\n")
!         
          self.fp.write("_classdeclarations = {\n")
          classlist = self.namemappers[0].getall('class')
--- 1104,1113 ----
              if self.fp:
                  self.fp.write("from %s import %s\n"%(module, name))
! 
      def dumpindex(self):
          if not self.fp:
              return
          self.fp.write("\n#\n# Indices of types declared in this module\n#\n")
! 
          self.fp.write("_classdeclarations = {\n")
          classlist = self.namemappers[0].getall('class')
***************
*** 1116,1120 ****
              self.fp.write("    %r : %s,\n" % (k, v))
          self.fp.write("}\n")
!         
          self.fp.write("\n_propdeclarations = {\n")
          proplist = self.namemappers[0].getall('property')
--- 1116,1120 ----
              self.fp.write("    %r : %s,\n" % (k, v))
          self.fp.write("}\n")
! 
          self.fp.write("\n_propdeclarations = {\n")
          proplist = self.namemappers[0].getall('property')
***************
*** 1123,1127 ****
              self.fp.write("    %r : _Prop_%s,\n" % (k, v))
          self.fp.write("}\n")
!         
          self.fp.write("\n_compdeclarations = {\n")
          complist = self.namemappers[0].getall('comparison')
--- 1123,1127 ----
              self.fp.write("    %r : _Prop_%s,\n" % (k, v))
          self.fp.write("}\n")
! 
          self.fp.write("\n_compdeclarations = {\n")
          complist = self.namemappers[0].getall('comparison')
***************
*** 1130,1134 ****
              self.fp.write("    %r : %s,\n" % (k, v))
          self.fp.write("}\n")
!         
          self.fp.write("\n_enumdeclarations = {\n")
          enumlist = self.namemappers[0].getall('enum')
--- 1130,1134 ----
              self.fp.write("    %r : %s,\n" % (k, v))
          self.fp.write("}\n")
! 
          self.fp.write("\n_enumdeclarations = {\n")
          enumlist = self.namemappers[0].getall('enum')
***************
*** 1141,1154 ****
      [type, description, flags] = data
      return "%r -- %r %s" % (type, description, compiledataflags(flags))
!     
  def is_null(data):
      return data[0] == 'null'
!     
  def is_optional(data):
      return (data[2] & 0x8000)
!     
  def is_enum(data):
      return (data[2] & 0x2000)
!     
  def getdatadoc(data):
      [type, descr, flags] = data
--- 1141,1154 ----
      [type, description, flags] = data
      return "%r -- %r %s" % (type, description, compiledataflags(flags))
! 
  def is_null(data):
      return data[0] == 'null'
! 
  def is_optional(data):
      return (data[2] & 0x8000)
! 
  def is_enum(data):
      return (data[2] & 0x2000)
! 
  def getdatadoc(data):
      [type, descr, flags] = data
***************
*** 1171,1175 ****
                  bits.append(repr(i))
      return '[%s]' % string.join(bits)
!     
  def ascii(str):
      """Return a string with all non-ascii characters hex-encoded"""
--- 1171,1175 ----
                  bits.append(repr(i))
      return '[%s]' % string.join(bits)
! 
  def ascii(str):
      """Return a string with all non-ascii characters hex-encoded"""
***************
*** 1183,1187 ****
              rv = rv + '\\' + 'x%02.2x' % ord(c)
      return rv
!     
  def identify(str):
      """Turn any string into an identifier:
--- 1183,1187 ----
              rv = rv + '\\' + 'x%02.2x' % ord(c)
      return rv
! 
  def identify(str):
      """Turn any string into an identifier:

Index: ic.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/ic.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ic.py	12 Feb 2004 17:35:10 -0000	1.6
--- ic.py	18 Jul 2004 06:14:45 -0000	1.7
***************
*** 39,43 ****
  
  _ICOpaqueDataType=type(ICOpaqueData(''))
!         
  def _decode_default(data, key):
      if len(data) == 0:
--- 39,43 ----
  
  _ICOpaqueDataType=type(ICOpaqueData(''))
! 
  def _decode_default(data, key):
      if len(data) == 0:
***************
*** 47,52 ****
          return data[1:]
      return ICOpaqueData(data)
!     
!     
  def _decode_multistr(data, key):
      numstr = ord(data[0]) << 8 | ord(data[1])
--- 47,52 ----
          return data[1:]
      return ICOpaqueData(data)
! 
! 
  def _decode_multistr(data, key):
      numstr = ord(data[0]) << 8 | ord(data[1])
***************
*** 59,63 ****
          ptr = ptr + strlen + 1
      return rv
!     
  def _decode_fontrecord(data, key):
      size = ord(data[0]) << 8 | ord(data[1])
--- 59,63 ----
          ptr = ptr + strlen + 1
      return rv
! 
  def _decode_fontrecord(data, key):
      size = ord(data[0]) << 8 | ord(data[1])
***************
*** 65,78 ****
      namelen = ord(data[4])
      return size, face, data[5:5+namelen]
!     
  def _decode_boolean(data, key):
      return ord(data[0])
!     
  def _decode_text(data, key):
      return data
!     
  def _decode_charset(data, key):
      return data[:256], data[256:]
!     
  def _decode_appspec(data, key):
      namelen = ord(data[4])
--- 65,78 ----
      namelen = ord(data[4])
      return size, face, data[5:5+namelen]
! 
  def _decode_boolean(data, key):
      return ord(data[0])
! 
  def _decode_text(data, key):
      return data
! 
  def _decode_charset(data, key):
      return data[:256], data[256:]
! 
  def _decode_appspec(data, key):
      namelen = ord(data[4])
***************
*** 81,85 ****
  def _code_default(data, key):
      return chr(len(data)) + data
!         
  def _code_multistr(data, key):
      numstr = len(data)
--- 81,85 ----
  def _code_default(data, key):
      return chr(len(data)) + data
! 
  def _code_multistr(data, key):
      numstr = len(data)
***************
*** 88,110 ****
          rv = rv + _code_default(i)
      return rv
!     
  def _code_fontrecord(data, key):
      size, face, name = data
      return chr((size>>8) & 0xff) + chr(size & 0xff) + chr(face & 0xff) + \
          chr(0) + _code_default(name)
!     
  def _code_boolean(data, key):
      print 'XXXX boolean:', repr(data)
      return chr(data)
!     
  def _code_text(data, key):
      return data
!     
  def _code_charset(data, key):
      return data[0] + data[1]
!     
  def _code_appspec(data, key):
      return data[0] + _code_default(data[1])
!     
  _decoder_table = {
      "ArchieAll" : (_decode_multistr , _code_multistr),
--- 88,110 ----
          rv = rv + _code_default(i)
      return rv
! 
  def _code_fontrecord(data, key):
      size, face, name = data
      return chr((size>>8) & 0xff) + chr(size & 0xff) + chr(face & 0xff) + \
          chr(0) + _code_default(name)
! 
  def _code_boolean(data, key):
      print 'XXXX boolean:', repr(data)
      return chr(data)
! 
  def _code_text(data, key):
      return data
! 
  def _code_charset(data, key):
      return data[0] + data[1]
! 
  def _code_appspec(data, key):
      return data[0] + _code_default(data[1])
! 
  _decoder_table = {
      "ArchieAll" : (_decode_multistr , _code_multistr),
***************
*** 119,123 ****
      "MailHeaders" : (_decode_text , _code_text),
      "NewsHeaders" : (_decode_text , _code_text),
! #   "Mapping" 
      "CharacterSet" : (_decode_charset , _code_charset),
      "Helper\245" : (_decode_appspec , _code_appspec),
--- 119,123 ----
      "MailHeaders" : (_decode_text , _code_text),
      "NewsHeaders" : (_decode_text , _code_text),
! #   "Mapping"
      "CharacterSet" : (_decode_charset , _code_charset),
      "Helper\245" : (_decode_appspec , _code_appspec),
***************
*** 157,161 ****
          coder = _code_default
      return coder(data, key)
!     
  class IC:
      def __init__(self, signature='Pyth', ic=None):
--- 157,161 ----
          coder = _code_default
      return coder(data, key)
! 
  class IC:
      def __init__(self, signature='Pyth', ic=None):
***************
*** 167,171 ****
                  self.ic.ICFindConfigFile()
          self.h = Res.Resource('')
!             
      def keys(self):
          rv = []
--- 167,171 ----
                  self.ic.ICFindConfigFile()
          self.h = Res.Resource('')
! 
      def keys(self):
          rv = []
***************
*** 176,183 ****
          self.ic.ICEnd()
          return rv
!         
      def has_key(self, key):
          return self.__contains__(key)
!         
      def __contains__(self, key):
          try:
--- 176,183 ----
          self.ic.ICEnd()
          return rv
! 
      def has_key(self, key):
          return self.__contains__(key)
! 
      def __contains__(self, key):
          try:
***************
*** 186,198 ****
              return 0
          return 1
!         
      def __getitem__(self, key):
          attr = self.ic.ICFindPrefHandle(key, self.h)
          return _decode(self.h.data, key)
!         
      def __setitem__(self, key, value):
          value = _code(value, key)
          self.ic.ICSetPref(key, ICattr_no_change, value)
!         
      def launchurl(self, url, hint=""):
          # Work around a bug in ICLaunchURL: file:/foo does
--- 186,198 ----
              return 0
          return 1
! 
      def __getitem__(self, key):
          attr = self.ic.ICFindPrefHandle(key, self.h)
          return _decode(self.h.data, key)
! 
      def __setitem__(self, key, value):
          value = _code(value, key)
          self.ic.ICSetPref(key, ICattr_no_change, value)
! 
      def launchurl(self, url, hint=""):
          # Work around a bug in ICLaunchURL: file:/foo does
***************
*** 201,205 ****
              url = 'file:///' + url[6:]
          self.ic.ICLaunchURL(hint, url, 0, len(url))
!         
      def parseurl(self, data, start=None, end=None, hint=""):
          if start == None:
--- 201,205 ----
              url = 'file:///' + url[6:]
          self.ic.ICLaunchURL(hint, url, 0, len(url))
! 
      def parseurl(self, data, start=None, end=None, hint=""):
          if start == None:
***************
*** 212,224 ****
          selStart, selEnd = self.ic.ICParseURL(hint, data, selStart, selEnd, self.h)
          return self.h.data, selStart, selEnd
!         
      def mapfile(self, file):
          if type(file) != type(''):
              file = file.as_tuple()[2]
          return self.ic.ICMapFilename(file)
!         
      def maptypecreator(self, type, creator, filename=""):
          return self.ic.ICMapTypeCreator(type, creator, filename)
!         
      def settypecreator(self, file):
          file = Carbon.File.pathname(file)
--- 212,224 ----
          selStart, selEnd = self.ic.ICParseURL(hint, data, selStart, selEnd, self.h)
          return self.h.data, selStart, selEnd
! 
      def mapfile(self, file):
          if type(file) != type(''):
              file = file.as_tuple()[2]
          return self.ic.ICMapFilename(file)
! 
      def maptypecreator(self, type, creator, filename=""):
          return self.ic.ICMapTypeCreator(type, creator, filename)
! 
      def settypecreator(self, file):
          file = Carbon.File.pathname(file)
***************
*** 226,230 ****
          MacOS.SetCreatorAndType(file, record[2], record[1])
          macostools.touched(fss)
!         
  # Convenience routines
  _dft_ic = None
--- 226,230 ----
          MacOS.SetCreatorAndType(file, record[2], record[1])
          macostools.touched(fss)
! 
  # Convenience routines
  _dft_ic = None
***************
*** 234,258 ****
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.launchurl(url, hint)
!     
  def parseurl(data, start=None, end=None, hint=""):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.parseurl(data, start, end, hint)
!     
  def mapfile(filename):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.mapfile(filename)
!     
  def maptypecreator(type, creator, filename=""):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.maptypecreator(type, creator, filename)
!     
  def settypecreator(file):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.settypecreator(file)
!         
  def _test():
      ic = IC()
--- 234,258 ----
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.launchurl(url, hint)
! 
  def parseurl(data, start=None, end=None, hint=""):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.parseurl(data, start, end, hint)
! 
  def mapfile(filename):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.mapfile(filename)
! 
  def maptypecreator(type, creator, filename=""):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.maptypecreator(type, creator, filename)
! 
  def settypecreator(file):
      global _dft_ic
      if _dft_ic == None: _dft_ic = IC()
      return _dft_ic.settypecreator(file)
! 
  def _test():
      ic = IC()
***************
*** 264,269 ****
          print k, '\t', v
      sys.exit(1)
!     
  if __name__ == '__main__':
      _test()
-     
--- 264,268 ----
          print k, '\t', v
      sys.exit(1)
! 
  if __name__ == '__main__':
      _test()

Index: icopen.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/icopen.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** icopen.py	6 Apr 2003 09:01:02 -0000	1.2
--- icopen.py	18 Jul 2004 06:14:45 -0000	1.3
***************
*** 43,58 ****
  
  def _open_with_typer(*args):
!         file = _builtin_open(*args)
!         filename = args[0]
!         mode = 'r'
!         if args[1:]:
!                 mode = args[1]
!         if mode[0] == 'w':
!                 from ic import error, settypecreator
!                 try:
!                         settypecreator(filename)
!                 except error:
!                         pass
!         return file
  
  __builtin__.open = _open_with_typer
--- 43,58 ----
  
  def _open_with_typer(*args):
!     file = _builtin_open(*args)
!     filename = args[0]
!     mode = 'r'
!     if args[1:]:
!         mode = args[1]
!     if mode[0] == 'w':
!         from ic import error, settypecreator
!         try:
!             settypecreator(filename)
!         except error:
!             pass
!     return file
  
  __builtin__.open = _open_with_typer

Index: macfs.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/macfs.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** macfs.py	9 Apr 2003 13:25:43 -0000	1.10
--- macfs.py	18 Jul 2004 06:14:45 -0000	1.11
***************
*** 10,14 ****
  warnings.warn("macfs is deprecated, use Carbon.File, Carbon.Folder or EasyDialogs",
                DeprecationWarning, stacklevel=2)
!               
  # First step: ensure we also emulate the MACFS module, which contained
  # all the constants
--- 10,14 ----
  warnings.warn("macfs is deprecated, use Carbon.File, Carbon.Folder or EasyDialogs",
                DeprecationWarning, stacklevel=2)
! 
  # First step: ensure we also emulate the MACFS module, which contained
  # all the constants
***************
*** 39,43 ****
          return (0, int(t), 0)
  else:
!     def _utc2time(utc): 
          t = utc[1]
          if t < 0:
--- 39,43 ----
          return (0, int(t), 0)
  else:
!     def _utc2time(utc):
          t = utc[1]
          if t < 0:
***************
*** 59,70 ****
      def as_fsref(self):
          return FSRef(self)
!         
      def NewAlias(self, src=None):
          return Alias(Carbon.File.NewAlias(src, self))
!         
      def GetCreatorType(self):
          finfo = self.FSpGetFInfo()
          return finfo.Creator, finfo.Type
!         
      def SetCreatorType(self, ctor, tp):
          finfo = self.FSpGetFInfo()
--- 59,70 ----
      def as_fsref(self):
          return FSRef(self)
! 
      def NewAlias(self, src=None):
          return Alias(Carbon.File.NewAlias(src, self))
! 
      def GetCreatorType(self):
          finfo = self.FSpGetFInfo()
          return finfo.Creator, finfo.Type
! 
      def SetCreatorType(self, ctor, tp):
          finfo = self.FSpGetFInfo()
***************
*** 72,82 ****
          finfo.Type = tp
          self.FSpSetFInfo(finfo)
!         
      def GetFInfo(self):
          return self.FSpGetFInfo()
!         
      def SetFInfo(self, info):
          return self.FSpSetFInfo(info)
!         
      def GetDates(self):
          catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate
--- 72,82 ----
          finfo.Type = tp
          self.FSpSetFInfo(finfo)
! 
      def GetFInfo(self):
          return self.FSpGetFInfo()
! 
      def SetFInfo(self, info):
          return self.FSpSetFInfo(info)
! 
      def GetDates(self):
          catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate
***************
*** 86,90 ****
          bdate = catinfo.backupDate
          return _utc2time(cdate), _utc2time(mdate), _utc2time(bdate)
!     
      def SetDates(self, cdate, mdate, bdate):
          catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate
--- 86,90 ----
          bdate = catinfo.backupDate
          return _utc2time(cdate), _utc2time(mdate), _utc2time(bdate)
! 
      def SetDates(self, cdate, mdate, bdate):
          catInfoFlags = kFSCatInfoCreateDate|kFSCatInfoContentMod|kFSCatInfoBackupDate
***************
*** 94,114 ****
              backupDate = _time2utc(bdate))
          FSRef(self).FSSetCatalogInfo(catInfoFlags, catinfo)
!     
  class FSRef(Carbon.File.FSRef):
      def as_fsspec(self):
          return FSSpec(self)
!     
  class Alias(Carbon.File.Alias):
  
      def GetInfo(self, index):
          return self.GetAliasInfo(index)
!         
      def Update(self, *args):
          pass # print "Alias.Update not yet implemented"
!         
      def Resolve(self, src=None):
          fss, changed = self.ResolveAlias(src)
          return FSSpec(fss), changed
!         
  from Carbon.File import FInfo
  
--- 94,114 ----
              backupDate = _time2utc(bdate))
          FSRef(self).FSSetCatalogInfo(catInfoFlags, catinfo)
! 
  class FSRef(Carbon.File.FSRef):
      def as_fsspec(self):
          return FSSpec(self)
! 
  class Alias(Carbon.File.Alias):
  
      def GetInfo(self, index):
          return self.GetAliasInfo(index)
! 
      def Update(self, *args):
          pass # print "Alias.Update not yet implemented"
! 
      def Resolve(self, src=None):
          fss, changed = self.ResolveAlias(src)
          return FSSpec(fss), changed
! 
  from Carbon.File import FInfo
  
***************
*** 123,139 ****
      fss, isdir, isalias = Carbon.File.ResolveAliasFile(fss, chain)
      return FSSpec(fss), isdir, isalias
!     
  def RawFSSpec(data):
      return FSSpec(rawdata=data)
!     
  def RawAlias(data):
      return Alias(rawdata=data)
!     
  def FindApplication(*args):
      raise NotImplementedError, "FindApplication no longer implemented"
!     
  def NewAliasMinimalFromFullPath(path):
      return Alias(Carbon.File.NewAliasMinimalFromFullPath(path, '', ''))
!     
  # Another global function:
  from Carbon.Folder import FindFolder
--- 123,139 ----
      fss, isdir, isalias = Carbon.File.ResolveAliasFile(fss, chain)
      return FSSpec(fss), isdir, isalias
! 
  def RawFSSpec(data):
      return FSSpec(rawdata=data)
! 
  def RawAlias(data):
      return Alias(rawdata=data)
! 
  def FindApplication(*args):
      raise NotImplementedError, "FindApplication no longer implemented"
! 
  def NewAliasMinimalFromFullPath(path):
      return Alias(Carbon.File.NewAliasMinimalFromFullPath(path, '', ''))
! 
  # Another global function:
  from Carbon.Folder import FindFolder
***************
*** 149,153 ****
      allowable"""
      return PromptGetFile('', *typelist)
!     
  def PromptGetFile(prompt, *typelist):
      """Ask for an input file giving the user a prompt message. Optionally you can
--- 149,153 ----
      allowable"""
      return PromptGetFile('', *typelist)
! 
  def PromptGetFile(prompt, *typelist):
      """Ask for an input file giving the user a prompt message. Optionally you can
***************
*** 158,162 ****
      if not typelist:
          typelist = None
!     fss = EasyDialogs.AskFileForOpen(message=prompt, wanted=FSSpec, 
          typeList=typelist, defaultLocation=_handleSetFolder())
      return fss, not fss is None
--- 158,162 ----
      if not typelist:
          typelist = None
!     fss = EasyDialogs.AskFileForOpen(message=prompt, wanted=FSSpec,
          typeList=typelist, defaultLocation=_handleSetFolder())
      return fss, not fss is None
***************
*** 168,175 ****
      warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen",
                DeprecationWarning, stacklevel=2)
!     fss = EasyDialogs.AskFileForSave(wanted=FSSpec, message=prompt, 
      savedFileName=default, defaultLocation=_handleSetFolder())
      return fss, not fss is None
!     
  def SetFolder(folder):
      global _curfolder
--- 168,175 ----
      warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen",
                DeprecationWarning, stacklevel=2)
!     fss = EasyDialogs.AskFileForSave(wanted=FSSpec, message=prompt,
      savedFileName=default, defaultLocation=_handleSetFolder())
      return fss, not fss is None
! 
  def SetFolder(folder):
      global _curfolder
***************
*** 182,186 ****
      _curfolder = folder
      return rv
!     
  def _handleSetFolder():
      global _curfolder
--- 182,186 ----
      _curfolder = folder
      return rv
! 
  def _handleSetFolder():
      global _curfolder
***************
*** 188,192 ****
      _curfolder = None
      return rv
!     
  def GetDirectory(prompt=None):
      """Ask the user to select a folder. Optionally you can give a prompt."""
--- 188,192 ----
      _curfolder = None
      return rv
! 
  def GetDirectory(prompt=None):
      """Ask the user to select a folder. Optionally you can give a prompt."""
***************
*** 194,198 ****
      warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen",
                DeprecationWarning, stacklevel=2)
!     fss = EasyDialogs.AskFolder(message=prompt, wanted=FSSpec, 
          defaultLocation=_handleSetFolder())
      return fss, not fss is None
--- 194,198 ----
      warnings.warn("macfs.StandardGetFile and friends are deprecated, use EasyDialogs.AskFileForOpen",
                DeprecationWarning, stacklevel=2)
!     fss = EasyDialogs.AskFolder(message=prompt, wanted=FSSpec,
          defaultLocation=_handleSetFolder())
      return fss, not fss is None

Index: macostools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/macostools.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** macostools.py	7 Mar 2003 15:36:49 -0000	1.3
--- macostools.py	18 Jul 2004 06:14:45 -0000	1.4
***************
*** 42,47 ****
      else:
          alias = srcfsr.FSNewAliasMinimal()
!     
!     dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname), 
          File.FSGetResourceForkName())
      h = Res.FSOpenResourceFile(dstfsr, File.FSGetResourceForkName(), 3)
--- 42,47 ----
      else:
          alias = srcfsr.FSNewAliasMinimal()
! 
!     dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname),
          File.FSGetResourceForkName())
      h = Res.FSOpenResourceFile(dstfsr, File.FSGetResourceForkName(), 3)
***************
*** 49,57 ****
      resource.AddResource('alis', 0, '')
      Res.CloseResFile(h)
!     
      dstfinfo = dstfss.FSpGetFInfo()
      dstfinfo.Flags = dstfinfo.Flags|0x8000    # Alias flag
      dstfss.FSpSetFInfo(dstfinfo)
!     
  def mkdirs(dst):
      """Make directories leading to 'dst' if they don't exist yet"""
--- 49,57 ----
      resource.AddResource('alis', 0, '')
      Res.CloseResFile(h)
! 
      dstfinfo = dstfss.FSpGetFInfo()
      dstfinfo.Flags = dstfinfo.Flags|0x8000    # Alias flag
      dstfss.FSpSetFInfo(dstfinfo)
! 
  def mkdirs(dst):
      """Make directories leading to 'dst' if they don't exist yet"""
***************
*** 63,67 ****
      mkdirs(head)
      os.mkdir(dst, 0777)
!     
  def touched(dst):
      """Tell the finder a file has changed. No-op on MacOSX."""
--- 63,67 ----
      mkdirs(head)
      os.mkdir(dst, 0777)
! 
  def touched(dst):
      """Tell the finder a file has changed. No-op on MacOSX."""
***************
*** 81,85 ****
      except macfs.error:
          pass
!     
  def touched_ae(dst):
      """Tell the finder a file has changed"""
--- 81,85 ----
      except macfs.error:
          pass
! 
  def touched_ae(dst):
      """Tell the finder a file has changed"""
***************
*** 90,94 ****
      f = Finder.Finder()
      f.update(File.FSRef(pardir))
!     
  def copy(src, dst, createpath=0, copydates=1, forcetype=None):
      """Copy a file, including finder info, resource fork, etc"""
--- 90,94 ----
      f = Finder.Finder()
      f.update(File.FSRef(pardir))
! 
  def copy(src, dst, createpath=0, copydates=1, forcetype=None):
      """Copy a file, including finder info, resource fork, etc"""
***************
*** 97,101 ****
      if createpath:
          mkdirs(os.path.split(dst)[0])
!     
      ifp = open(src, 'rb')
      ofp = open(dst, 'wb')
--- 97,101 ----
      if createpath:
          mkdirs(os.path.split(dst)[0])
! 
      ifp = open(src, 'rb')
      ofp = open(dst, 'wb')
***************
*** 106,110 ****
      ifp.close()
      ofp.close()
!     
      ifp = openrf(src, '*rb')
      ofp = openrf(dst, '*wb')
--- 106,110 ----
      ifp.close()
      ofp.close()
! 
      ifp = openrf(src, '*rb')
      ofp = openrf(dst, '*wb')
***************
*** 115,119 ****
      ifp.close()
      ofp.close()
!     
      srcfss = File.FSSpec(src)
      dstfss = File.FSSpec(dst)
--- 115,119 ----
      ifp.close()
      ofp.close()
! 
      srcfss = File.FSSpec(src)
      dstfss = File.FSSpec(dst)
***************
*** 131,135 ****
          dstfsr.FSSetCatalogInfo(Files.kFSCatInfoAllDates, catinfo)
      touched(dstfss)
!     
  def copytree(src, dst, copydates=1):
      """Copy a complete file tree to a new destination"""
--- 131,135 ----
          dstfsr.FSSetCatalogInfo(Files.kFSCatInfoAllDates, catinfo)
      touched(dstfss)
! 
  def copytree(src, dst, copydates=1):
      """Copy a complete file tree to a new destination"""

Index: macresource.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/macresource.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** macresource.py	9 Apr 2003 13:25:43 -0000	1.5
--- macresource.py	18 Jul 2004 06:14:45 -0000	1.6
***************
*** 16,25 ****
      (default: modname with .rsrc appended) either in the same folder as
      where modname was loaded from, or otherwise across sys.path.
!     
      Returns the refno of the resource file opened (or None)"""
  
      if modname is None and filename is None:
          raise ArgumentError, "Either filename or modname argument (or both) must be given"
!     
      if type(resid) is type(1):
          try:
--- 16,25 ----
      (default: modname with .rsrc appended) either in the same folder as
      where modname was loaded from, or otherwise across sys.path.
! 
      Returns the refno of the resource file opened (or None)"""
  
      if modname is None and filename is None:
          raise ArgumentError, "Either filename or modname argument (or both) must be given"
! 
      if type(resid) is type(1):
          try:
***************
*** 36,40 ****
          else:
              return None
!             
      # Construct a filename if we don't have one
      if not filename:
--- 36,40 ----
          else:
              return None
! 
      # Construct a filename if we don't have one
      if not filename:
***************
*** 43,47 ****
          else:
              filename = modname + '.rsrc'
!     
      # Now create a list of folders to search
      searchdirs = []
--- 43,47 ----
          else:
              filename = modname + '.rsrc'
! 
      # Now create a list of folders to search
      searchdirs = []
***************
*** 54,58 ****
              searchdirs = [os.path.dirname(mod.__file__)]
      searchdirs.extend(sys.path)
!     
      # And look for the file
      for dir in searchdirs:
--- 54,58 ----
              searchdirs = [os.path.dirname(mod.__file__)]
      searchdirs.extend(sys.path)
! 
      # And look for the file
      for dir in searchdirs:
***************
*** 62,68 ****
      else:
          raise ResourceFileNotFoundError, filename
!     
      refno = open_pathname(pathname)
!     
      # And check that the resource exists now
      if type(resid) is type(1):
--- 62,68 ----
      else:
          raise ResourceFileNotFoundError, filename
! 
      refno = open_pathname(pathname)
! 
      # And check that the resource exists now
      if type(resid) is type(1):
***************
*** 71,75 ****
          h = Res.GetNamedResource(restype, resid)
      return refno
!     
  def open_pathname(pathname, verbose=0):
      """Open a resource file given by pathname, possibly decoding an
--- 71,75 ----
          h = Res.GetNamedResource(restype, resid)
      return refno
! 
  def open_pathname(pathname, verbose=0):
      """Open a resource file given by pathname, possibly decoding an
***************
*** 96,100 ****
              raise
      return refno
!     
  def resource_pathname(pathname, verbose=0):
      """Return the pathname for a resource file (either DF or RF based).
--- 96,100 ----
              raise
      return refno
! 
  def resource_pathname(pathname, verbose=0):
      """Return the pathname for a resource file (either DF or RF based).
***************
*** 122,131 ****
              raise
      return pathname
!     
  def open_error_resource():
      """Open the resource file containing the error code to error message
      mapping."""
      need('Estr', 1, filename="errors.rsrc", modname=__name__)
!     
  def _decode(pathname, verbose=0):
      # Decode an AppleSingle resource file, return the new pathname.
--- 122,131 ----
              raise
      return pathname
! 
  def open_error_resource():
      """Open the resource file containing the error code to error message
      mapping."""
      need('Estr', 1, filename="errors.rsrc", modname=__name__)
! 
  def _decode(pathname, verbose=0):
      # Decode an AppleSingle resource file, return the new pathname.

Index: pimp.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/pimp.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** pimp.py	13 Mar 2004 23:50:48 -0000	1.34
--- pimp.py	18 Jul 2004 06:14:45 -0000	1.35
***************
*** 1,5 ****
  """Package Install Manager for Python.
  
! This is currently a MacOSX-only strawman implementation. 
  Despite other rumours the name stands for "Packman IMPlementation".
  
--- 1,5 ----
  """Package Install Manager for Python.
  
! This is currently a MacOSX-only strawman implementation.
  Despite other rumours the name stands for "Packman IMPlementation".
[...1188 lines suppressed...]
              sys.stderr.write(msg + '\r')
              return 1
! 
      try:
          opts, args = getopt.getopt(sys.argv[1:], "slifvdD:Vu:")
***************
*** 1134,1140 ****
          else:
              from pimp_update import *
!     
  if __name__ == '__main__':
      main()
-     
-     
--- 1134,1138 ----
          else:
              from pimp_update import *
! 
  if __name__ == '__main__':
      main()

Index: videoreader.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/videoreader.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** videoreader.py	9 Apr 2003 13:25:43 -0000	1.3
--- videoreader.py	18 Jul 2004 06:14:45 -0000	1.4
***************
*** 35,51 ****
          self.__height = height
          self.__format = format
!         
      def getname(self):
          return self.__name
!         
      def getdescr(self):
          return self.__descr
!         
      def getsize(self):
          return self.__width, self.__height
!         
      def getformat(self):
          return self.__format
!         
  class _Reader:
      def __init__(self, path):
--- 35,51 ----
          self.__height = height
          self.__format = format
! 
      def getname(self):
          return self.__name
! 
      def getdescr(self):
          return self.__descr
! 
      def getsize(self):
          return self.__width, self.__height
! 
      def getformat(self):
          return self.__format
! 
  class _Reader:
      def __init__(self, path):
***************
*** 67,72 ****
              self.audiotimescale = self.audiomedia.GetMediaTimeScale()
              del handle
!     
!         try:    
              self.videotrack = self.movie.GetMovieIndTrackType(1,
                  QuickTime.VisualMediaCharacteristic, QuickTime.movieTrackCharacteristic)
--- 67,72 ----
              self.audiotimescale = self.audiomedia.GetMediaTimeScale()
              del handle
! 
!         try:
              self.videotrack = self.movie.GetMovieIndTrackType(1,
                  QuickTime.VisualMediaCharacteristic, QuickTime.movieTrackCharacteristic)
***************
*** 82,86 ****
          self.audiocurtime = None
  
!         
      def __del__(self):
          self.audiomedia = None
--- 82,86 ----
          self.audiocurtime = None
  
! 
      def __del__(self):
          self.audiomedia = None
***************
*** 89,93 ****
          self.videotrack = None
          self.movie = None
!         
      def _initgworld(self):
          old_port, old_dev = Qdoffs.GetGWorld()
--- 89,93 ----
          self.videotrack = None
          self.movie = None
! 
      def _initgworld(self):
          old_port, old_dev = Qdoffs.GetGWorld()
***************
*** 109,140 ****
          finally:
              Qdoffs.SetGWorld(old_port, old_dev)
!         
      def _gettrackduration_ms(self, track):
          tracktime = track.GetTrackDuration()
          return self._movietime_to_ms(tracktime)
!         
      def _movietime_to_ms(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.movietimescale, None), 1000)
          return value
!         
      def _videotime_to_ms(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None), 1000)
          return value
!         
      def _audiotime_to_ms(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.audiotimescale, None), 1000)
          return value
!         
      def _videotime_to_movietime(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None),
                  self.movietimescale)
          return value
!         
      def HasAudio(self):
          return not self.audiotrack is None
!         
      def HasVideo(self):
          return not self.videotrack is None
!         
      def GetAudioDuration(self):
          if not self.audiotrack:
--- 109,140 ----
          finally:
              Qdoffs.SetGWorld(old_port, old_dev)
! 
      def _gettrackduration_ms(self, track):
          tracktime = track.GetTrackDuration()
          return self._movietime_to_ms(tracktime)
! 
      def _movietime_to_ms(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.movietimescale, None), 1000)
          return value
! 
      def _videotime_to_ms(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None), 1000)
          return value
! 
      def _audiotime_to_ms(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.audiotimescale, None), 1000)
          return value
! 
      def _videotime_to_movietime(self, time):
          value, d1, d2 = Qt.ConvertTimeScale((time, self.videotimescale, None),
                  self.movietimescale)
          return value
! 
      def HasAudio(self):
          return not self.audiotrack is None
! 
      def HasVideo(self):
          return not self.videotrack is None
! 
      def GetAudioDuration(self):
          if not self.audiotrack:
***************
*** 146,150 ****
              return 0
          return self._gettrackduration_ms(self.videotrack)
!         
      def GetAudioFormat(self):
          if not self.audiodescr:
--- 146,150 ----
              return 0
          return self._gettrackduration_ms(self.videotrack)
! 
      def GetAudioFormat(self):
          if not self.audiodescr:
***************
*** 173,190 ****
          else:
              encoding = 'quicktime-coding-%s'%self.audiodescr['dataFormat']
! ##      return audio.format.AudioFormatLinear('quicktime_audio', 'QuickTime Audio Format', 
  ##          channels, encoding, blocksize=blocksize, fpb=fpb, bps=bps)
          return channels, encoding, blocksize, fpb, bps
!             
      def GetAudioFrameRate(self):
          if not self.audiodescr:
              return None
          return int(self.audiodescr['sampleRate'])
!         
      def GetVideoFormat(self):
          width = self.videodescr['width']
          height = self.videodescr['height']
          return VideoFormat('dummy_format', 'Dummy Video Format', width, height, macrgb)
!         
      def GetVideoFrameRate(self):
          tv = self.videocurtime
--- 173,190 ----
          else:
              encoding = 'quicktime-coding-%s'%self.audiodescr['dataFormat']
! ##      return audio.format.AudioFormatLinear('quicktime_audio', 'QuickTime Audio Format',
  ##          channels, encoding, blocksize=blocksize, fpb=fpb, bps=bps)
          return channels, encoding, blocksize, fpb, bps
! 
      def GetAudioFrameRate(self):
          if not self.audiodescr:
              return None
          return int(self.audiodescr['sampleRate'])
! 
      def GetVideoFormat(self):
          width = self.videodescr['width']
          height = self.videodescr['height']
          return VideoFormat('dummy_format', 'Dummy Video Format', width, height, macrgb)
! 
      def GetVideoFrameRate(self):
          tv = self.videocurtime
***************
*** 195,199 ****
          dur = self._videotime_to_ms(dur)
          return int((1000.0/dur)+0.5)
!         
      def ReadAudio(self, nframes, time=None):
          if not time is None:
--- 195,199 ----
          dur = self._videotime_to_ms(dur)
          return int((1000.0/dur)+0.5)
! 
      def ReadAudio(self, nframes, time=None):
          if not time is None:
***************
*** 211,215 ****
          self.audiocurtime = actualtime + actualcount*sampleduration
          return self._audiotime_to_ms(actualtime), h.data
!         
      def ReadVideo(self, time=None):
          if not time is None:
--- 211,215 ----
          self.audiocurtime = actualtime + actualcount*sampleduration
          return self._audiotime_to_ms(actualtime), h.data
! 
      def ReadVideo(self, time=None):
          if not time is None:
***************
*** 227,231 ****
          self.movie.MoviesTask(0)
          return self._videotime_to_ms(self.videocurtime), self._getpixmapcontent()
!         
      def _getpixmapcontent(self):
          """Shuffle the offscreen PixMap data, because it may have funny stride values"""
--- 227,231 ----
          self.movie.MoviesTask(0)
          return self._videotime_to_ms(self.videocurtime), self._getpixmapcontent()
! 
      def _getpixmapcontent(self):
          """Shuffle the offscreen PixMap data, because it may have funny stride values"""
***************
*** 282,292 ****
              timestamp, data = rdr.ReadVideo()
              MacOS.SetCreatorAndType(pname, 'ogle', 'JPEG')
!             if num > 20: 
                  print 'stopping at 20 frames so your disk does not fill up:-)'
                  break
      print 'Total frames:', num
!         
  if __name__ == '__main__':
      _test()
      sys.exit(1)
-         
--- 282,291 ----
              timestamp, data = rdr.ReadVideo()
              MacOS.SetCreatorAndType(pname, 'ogle', 'JPEG')
!             if num > 20:
                  print 'stopping at 20 frames so your disk does not fill up:-)'
                  break
      print 'Total frames:', num
! 
  if __name__ == '__main__':
      _test()
      sys.exit(1)



More information about the Python-checkins mailing list