[Python-checkins] CVS: python/dist/src/Lib dumbdbm.py,1.13,1.14 fileinput.py,1.7,1.8 site.py,1.36,1.37 socket.py,1.13,1.14 tempfile.py,1.30,1.31 whichdb.py,1.11,1.12

Guido van Rossum gvanrossum@users.sourceforge.net
Wed, 24 Oct 2001 13:33:36 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv17535

Modified Files:
	dumbdbm.py fileinput.py site.py socket.py tempfile.py 
	whichdb.py 
Log Message:
SF patch #474590 -- RISC OS support

Index: dumbdbm.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dumbdbm.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** dumbdbm.py	2001/09/04 19:14:13	1.13
--- dumbdbm.py	2001/10/24 20:33:34	1.14
***************
*** 34,44 ****
  
      def __init__(self, file):
!         if _os.sep == '.':
!             endsep = '/'
!         else:
!             endsep = '.'
!         self._dirfile = file + endsep + 'dir'
!         self._datfile = file + endsep + 'dat'
!         self._bakfile = file + endsep + 'bak'
          # Mod by Jack: create data file if needed
          try:
--- 34,40 ----
  
      def __init__(self, file):
!         self._dirfile = file + _os.extsep + 'dir'
!         self._datfile = file + _os.extsep + 'dat'
!         self._bakfile = file + _os.extsep + 'bak'
          # Mod by Jack: create data file if needed
          try:

Index: fileinput.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/fileinput.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** fileinput.py	2001/01/20 23:34:12	1.7
--- fileinput.py	2001/10/24 20:33:34	1.8
***************
*** 236,240 ****
                  if self._inplace:
                      self._backupfilename = (
!                         self._filename + (self._backup or ".bak"))
                      try: os.unlink(self._backupfilename)
                      except os.error: pass
--- 236,240 ----
                  if self._inplace:
                      self._backupfilename = (
!                         self._filename + (self._backup or os.extsep+"bak"))
                      try: os.unlink(self._backupfilename)
                      except os.error: pass

Index: site.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** site.py	2001/10/02 18:27:09	1.36
--- site.py	2001/10/24 20:33:34	1.37
***************
*** 60,69 ****
  import sys, os
  
- if os.sep==".":
-     endsep = "/"
- else:
-     endsep = "."
  
- 
  def makepath(*paths):
      dir = os.path.abspath(os.path.join(*paths))
--- 60,64 ----
***************
*** 130,134 ****
      names.sort()
      for name in names:
!         if name[-4:] == endsep + "pth":
              addpackage(sitedir, name)
      if reset:
--- 125,129 ----
      names.sort()
      for name in names:
!         if name[-4:] == os.extsep + "pth":
              addpackage(sitedir, name)
      if reset:

Index: socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** socket.py	2001/08/18 21:00:39	1.13
--- socket.py	2001/10/24 20:33:34	1.14
***************
*** 49,53 ****
  if (sys.platform.lower().startswith("win")
      or (hasattr(os, 'uname') and os.uname()[0] == "BeOS")
!     or (sys.platform=="RISCOS")):
  
      _realsocketcall = _socket.socket
--- 49,53 ----
  if (sys.platform.lower().startswith("win")
      or (hasattr(os, 'uname') and os.uname()[0] == "BeOS")
!     or (sys.platform=="riscos")):
  
      _realsocketcall = _socket.socket

Index: tempfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/tempfile.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** tempfile.py	2001/03/02 05:51:16	1.30
--- tempfile.py	2001/10/24 20:33:34	1.31
***************
*** 35,38 ****
--- 35,42 ----
          except macfs.error:
              pass
+     elif os.name == 'riscos':
+         scrapdir = os.getenv('Wimp$ScrapDir')
+         if scrapdir:
+             attempdirs.insert(0, scrapdir)
      for envname in 'TMPDIR', 'TEMP', 'TMP':
          if os.environ.has_key(envname):
***************
*** 88,92 ****
  elif os.name == "nt":
      template = '~' + `os.getpid()` + '-'
! elif os.name == 'mac':
      template = 'Python-Tmp-'
  else:
--- 92,96 ----
  elif os.name == "nt":
      template = '~' + `os.getpid()` + '-'
! elif os.name in ('mac', 'riscos'):
      template = 'Python-Tmp-'
  else:

Index: whichdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/whichdb.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** whichdb.py	2001/03/16 08:29:47	1.11
--- whichdb.py	2001/10/24 20:33:34	1.12
***************
*** 3,11 ****
  import os
  
- if os.sep==".":
-     endsep = "/"
- else:
-     endsep = "."
- 
  def whichdb(filename):
      """Guess which db package to use to open a db file.
--- 3,6 ----
***************
*** 25,31 ****
      # Check for dbm first -- this has a .pag and a .dir file
      try:
!         f = open(filename + endsep + "pag", "rb")
          f.close()
!         f = open(filename + endsep + "dir", "rb")
          f.close()
          return "dbm"
--- 20,26 ----
      # Check for dbm first -- this has a .pag and a .dir file
      try:
!         f = open(filename + os.extsep + "pag", "rb")
          f.close()
!         f = open(filename + os.extsep + "dir", "rb")
          f.close()
          return "dbm"
***************
*** 35,41 ****
      # Check for dumbdbm next -- this has a .dir and and a .dat file
      try:
!         f = open(filename + endsep + "dat", "rb")
          f.close()
!         f = open(filename + endsep + "dir", "rb")
          try:
              if f.read(1) in ["'", '"']:
--- 30,36 ----
      # Check for dumbdbm next -- this has a .dir and and a .dat file
      try:
!         f = open(filename + os.extsep + "dat", "rb")
          f.close()
!         f = open(filename + os.extsep + "dir", "rb")
          try:
              if f.read(1) in ["'", '"']: