[Python-checkins] CVS: python/dist/src/Lib/dos-8x3 simpleht.py,1.7,1.8 sre_pars.py,1.5,1.6 test_mma.py,1.3,1.4 test_pop.py,1.2,1.3 webbrows.py,1.1,1.2

Guido van Rossum python-dev@python.org
Mon, 4 Sep 2000 21:49:52 -0700


Update of /cvsroot/python/python/dist/src/Lib/dos-8x3
In directory slayer.i.sourceforge.net:/tmp/cvs-serv4333

Modified Files:
	simpleht.py sre_pars.py test_mma.py test_pop.py webbrows.py 
Log Message:
The usual.

Index: simpleht.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/simpleht.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** simpleht.py	2000/09/01 19:25:51	1.7
--- simpleht.py	2000/09/05 04:49:50	1.8
***************
*** 7,11 ****
  
  
! __version__ = "0.4"
  
  
--- 7,11 ----
  
  
! __version__ = "0.5"
  
  
***************
*** 100,103 ****
--- 100,104 ----
          list.sort(lambda a, b: cmp(a.lower(), b.lower()))
          f = StringIO()
+         f.write("<title>Directory listing for %s</title>\n" % self.path)
          f.write("<h2>Directory listing for %s</h2>\n" % self.path)
          f.write("<hr>\n<ul>\n")
***************
*** 108,112 ****
              if os.path.isdir(fullname):
                  displayname = name + "/"
!                 linkname = name + os.sep
              if os.path.islink(fullname):
                  displayname = name + "@"
--- 109,113 ----
              if os.path.isdir(fullname):
                  displayname = name + "/"
!                 linkname = name + "/"
              if os.path.islink(fullname):
                  displayname = name + "@"

Index: sre_pars.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/sre_pars.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** sre_pars.py	2000/09/01 19:25:51	1.5
--- sre_pars.py	2000/09/05 04:49:50	1.6
***************
*** 16,22 ****
  
  SPECIAL_CHARS = ".\\[{()*+?^$|"
! REPEAT_CHARS  = "*+?{"
  
! DIGITS = tuple("012345689")
  
  OCTDIGITS = tuple("01234567")
--- 16,22 ----
  
  SPECIAL_CHARS = ".\\[{()*+?^$|"
! REPEAT_CHARS = "*+?{"
  
! DIGITS = tuple("0123456789")
  
  OCTDIGITS = tuple("01234567")
***************
*** 260,270 ****
              while source.next in HEXDIGITS and len(escape) < 4:
                  escape = escape + source.get()
!             escape = escape[2:]
!             if len(escape) != 2:
!                 raise error, "bogus escape: %s" % repr("\\" + escape)
!             return LITERAL, int(escape, 16) & 0xff
          elif escape[1:2] == "0":
              # octal escape
!             while source.next in OCTDIGITS and len(escape) < 5:
                  escape = escape + source.get()
              return LITERAL, int(escape[1:], 8) & 0xff
--- 260,269 ----
              while source.next in HEXDIGITS and len(escape) < 4:
                  escape = escape + source.get()
!             if len(escape) != 4:
!                 raise ValueError
!             return LITERAL, int(escape[2:], 16) & 0xff
          elif escape[1:2] == "0":
              # octal escape
!             while source.next in OCTDIGITS and len(escape) < 4:
                  escape = escape + source.get()
              return LITERAL, int(escape[1:], 8) & 0xff
***************
*** 274,278 ****
              if source.next in DIGITS:
                  escape = escape + source.get()
!                 if escape[2] in OCTDIGITS and source.next in OCTDIGITS:
                      # got three octal digits; this is an octal escape
                      escape = escape + source.get()
--- 273,278 ----
              if source.next in DIGITS:
                  escape = escape + source.get()
!                 if (escape[1] in OCTDIGITS and escape[2] in OCTDIGITS and
!                     source.next in OCTDIGITS):
                      # got three octal digits; this is an octal escape
                      escape = escape + source.get()
***************
*** 282,286 ****
              if group:
                  return GROUPREF, group
!             raise error, "bogus escape: %s" % repr(escape)
          if len(escape) == 2:
              return LITERAL, ord(escape[1])
--- 282,286 ----
              if group:
                  return GROUPREF, group
!             raise ValueError
          if len(escape) == 2:
              return LITERAL, ord(escape[1])

Index: test_mma.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_mma.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_mma.py	2000/09/01 19:25:51	1.3
--- test_mma.py	2000/09/05 04:49:50	1.4
***************
*** 41,45 ****
      print '  Contents of first 3 bytes:', repr(m[0:3])
      assert m[0:3] == '3\0\0'
!     print '  Contents of second page:',  m[PAGESIZE-1 : PAGESIZE + 7]
      assert m[PAGESIZE-1 : PAGESIZE + 7] == '\0foobar\0'
      
--- 41,45 ----
      print '  Contents of first 3 bytes:', repr(m[0:3])
      assert m[0:3] == '3\0\0'
!     print '  Contents of second page:',  repr(m[PAGESIZE-1 : PAGESIZE + 7])
      assert m[PAGESIZE-1 : PAGESIZE + 7] == '\0foobar\0'
      
***************
*** 120,122 ****
  
  test_both()
- 
--- 120,121 ----

Index: test_pop.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_pop.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_pop.py	2000/09/01 19:25:51	1.2
--- test_pop.py	2000/09/05 04:49:50	1.3
***************
*** 29,42 ****
      import popen2
      cmd  = "cat"
!     teststr = "abc\n"
!     resultstr = teststr
      if os.name == "nt":
          cmd = "more"
!         resultstr = "\n" + resultstr
      print "testing popen2..."
      w, r = os.popen2(cmd)
      w.write(teststr)
      w.close()
!     assert r.read() == resultstr
      print "testing popen3..."
      try:
--- 29,46 ----
      import popen2
      cmd  = "cat"
!     teststr = "ab cd\n"
      if os.name == "nt":
          cmd = "more"
!     # "more" doesn't act the same way across Windows flavors,
!     # sometimes adding an extra newline at the start or the
!     # end.  So we strip whitespace off both ends for comparison.
!     expected = teststr.strip()
      print "testing popen2..."
      w, r = os.popen2(cmd)
      w.write(teststr)
      w.close()
!     got = r.read()
!     if got.strip() != expected:
!         raise ValueError("wrote %s read %s" % (`teststr`, `got`))
      print "testing popen3..."
      try:
***************
*** 46,54 ****
      w.write(teststr)
      w.close()
!     assert r.read() == resultstr
!     assert e.read() == ""
      for inst in popen2._active[:]:
          inst.wait()
!     assert not popen2._active
      print "All OK"
  
--- 50,63 ----
      w.write(teststr)
      w.close()
!     got = r.read()
!     if got.strip() != expected:
!         raise ValueError("wrote %s read %s" % (`teststr`, `got`))
!     got = e.read()
!     if got:
!         raise ValueError("unexected %s on stderr" % `got`)
      for inst in popen2._active[:]:
          inst.wait()
!     if popen2._active:
!         raise ValueError("_active not empty")
      print "All OK"
  

Index: webbrows.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/webbrows.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** webbrows.py	2000/09/01 19:27:34	1.1
--- webbrows.py	2000/09/05 04:49:50	1.2
***************
*** 184,190 ****
  class WindowsDefault:
      def open(self, url, new=0):
!         import win32api, win32con
!         win32api.ShellExecute(0, "open", url, None, ".",
!                               win32con.SW_SHOWNORMAL)
  
      def open_new(self, url):
--- 184,188 ----
  class WindowsDefault:
      def open(self, url, new=0):
!         self.junk = os.popen("start " + url)
  
      def open_new(self, url):