[Moin-devel] CVS: MoinMoin/py15 Cookie.py,1.2,1.3 __init__.py,1.1,1.2

J?rgen Hermann jhermann at users.sourceforge.net
Sun Mar 17 01:58:03 EST 2002


Update of /cvsroot/moin/MoinMoin/py15
In directory usw-pr-cvs1:/tmp/cvs-serv15738/MoinMoin/py15

Modified Files:
	Cookie.py __init__.py 
Log Message:
Added licensing info for copied modules; updated Cookie.py


Index: Cookie.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/py15/Cookie.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Cookie.py	31 May 2001 01:02:08 -0000	1.2
--- Cookie.py	17 Mar 2002 09:57:37 -0000	1.3
***************
*** 4,10 ****
  ####
  # Copyright 2000 by Timothy O'Malley <timo at alum.mit.edu>
! # 
  #                All Rights Reserved
! # 
  # Permission to use, copy, modify, and distribute this software
  # and its documentation for any purpose and without fee is hereby
--- 4,10 ----
  ####
  # Copyright 2000 by Timothy O'Malley <timo at alum.mit.edu>
! #
  #                All Rights Reserved
! #
  # Permission to use, copy, modify, and distribute this software
  # and its documentation for any purpose and without fee is hereby
***************
*** 14,19 ****
  # Timothy O'Malley  not be used in advertising or publicity
  # pertaining to distribution of the software without specific, written
! # prior permission. 
! # 
  # Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  # SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
--- 14,19 ----
  # Timothy O'Malley  not be used in advertising or publicity
  # pertaining to distribution of the software without specific, written
! # prior permission.
! #
  # Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  # SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
***************
*** 23,31 ****
  # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
! # PERFORMANCE OF THIS SOFTWARE. 
  #
  ####
! # 
! # Id: Cookie.py,v 2.29 2000/08/23 05:28:49 timo Exp 
  #   by Timothy O'Malley <timo at alum.mit.edu>
  #
--- 23,31 ----
  # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
! # PERFORMANCE OF THIS SOFTWARE.
  #
  ####
! #
! # Id: Cookie.py,v 2.29 2000/08/23 05:28:49 timo Exp
  #   by Timothy O'Malley <timo at alum.mit.edu>
  #
***************
*** 40,44 ****
  ####
  
! """
  Here's a sample session to show how to use this module.
  At the moment, this is the only documentation.
--- 40,44 ----
  ####
  
! r"""
  Here's a sample session to show how to use this module.
  At the moment, this is the only documentation.
***************
*** 114,121 ****
     >>> C["oreo"]["path"] = "/"
     >>> print C
!    Set-Cookie: oreo="doublestuff"; Path=/;
  
  Each dictionary element has a 'value' attribute, which gives you
! back the value associated with the key. 
  
     >>> C = Cookie.SmartCookie()
--- 114,121 ----
     >>> C["oreo"]["path"] = "/"
     >>> print C
!    Set-Cookie: oreo=doublestuff; Path=/;
  
  Each dictionary element has a 'value' attribute, which gives you
! back the value associated with the key.
  
     >>> C = Cookie.SmartCookie()
***************
*** 149,153 ****
     Set-Cookie: string=seven;
  
!  
  SerialCookie
  
--- 149,153 ----
     Set-Cookie: string=seven;
  
! 
  SerialCookie
  
***************
*** 204,209 ****
  
     >>> C = Cookie.Cookie()
!    >>> C.__class__
!    <class Cookie.SmartCookie at 99f88>
  
  
--- 204,209 ----
  
     >>> C = Cookie.Cookie()
!    >>> print C.__class__.__name__
!    SmartCookie
  
  
***************
*** 215,219 ****
  #
  # Import our required modules
! # 
  import string, sys
  from UserDict import UserDict
--- 215,219 ----
  #
  # Import our required modules
! #
  import string, sys
  from UserDict import UserDict
***************
*** 229,232 ****
--- 229,234 ----
      raise ImportError, "Cookie.py requires 're' from Python 1.5 or later"
  
+ __all__ = ["CookieError","BaseCookie","SimpleCookie","SerialCookie",
+            "SmartCookie","Cookie"]
  
  #
***************
*** 243,247 ****
  # three-digit octal equivalent of the character.  Any '\' or '"' is
  # quoted with a preceeding '\' slash.
! # 
  # These are taken from RFC2068 and RFC2109.
  #       _LegalChars       is the list of chars which don't require "'s
--- 245,249 ----
  # three-digit octal equivalent of the character.  Any '\' or '"' is
  # quoted with a preceeding '\' slash.
! #
  # These are taken from RFC2068 and RFC2109.
  #       _LegalChars       is the list of chars which don't require "'s
***************
*** 371,375 ****
  # The _getdate() routine is used to set the expiration time in
  # the cookie's HTTP header.      By default, _getdate() returns the
! # current time in the appropriate "expires" format for a 
  # Set-Cookie header.     The one optional argument is an offset from
  # now, in seconds.      For example, an offset of -3600 means "one hour ago".
--- 373,377 ----
  # The _getdate() routine is used to set the expiration time in
  # the cookie's HTTP header.      By default, _getdate() returns the
! # current time in the appropriate "expires" format for a
  # Set-Cookie header.     The one optional argument is an offset from
  # now, in seconds.      For example, an offset of -3600 means "one hour ago".
***************
*** 406,410 ****
      #   path       comment         domain
      #   max-age    secure      version
!     # 
      # For historical reasons, these attributes are also reserved:
      #   expires
--- 408,412 ----
      #   path       comment         domain
      #   max-age    secure      version
!     #
      # For historical reasons, these attributes are also reserved:
      #   expires
***************
*** 490,494 ****
  
          # Now add any defined attributes
!         if attrs == None:
              attrs = self._reserved_keys
          for K,V in self.items():
--- 492,496 ----
  
          # Now add any defined attributes
!         if attrs is None:
              attrs = self._reserved_keys
          for K,V in self.items():
***************
*** 506,510 ****
          # Return the result
          return string.join(result, " ")
! # end OutputString
  # end Morsel class
  
--- 508,512 ----
          # Return the result
          return string.join(result, " ")
!     # end OutputString
  # end Morsel class
  
***************
*** 520,528 ****
  #
  
! _LegalCharsPatt  = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{]"
  _CookiePattern = re.compile(
      r"(?x)"                       # This is a Verbose pattern
      r"(?P<key>"                   # Start of group 'key'
!     ""+ _LegalCharsPatt +"+"        # Any word of at least one letter
      r")"                          # End of group 'key'
      r"\s*=\s*"                    # Equal Sign
--- 522,530 ----
  #
  
! _LegalCharsPatt  = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]"
  _CookiePattern = re.compile(
      r"(?x)"                       # This is a Verbose pattern
      r"(?P<key>"                   # Start of group 'key'
!     ""+ _LegalCharsPatt +"+?"     # Any word of at least one letter, nongreedy
      r")"                          # End of group 'key'
      r"\s*=\s*"                    # Equal Sign
***************
*** 646,650 ****
                  self.__set(K, rval, cval)
                  M = self[K]
! # end __ParseString
  # end BaseCookie class
  
--- 648,652 ----
                  self.__set(K, rval, cval)
                  M = self[K]
!     # end __ParseString
  # end BaseCookie class
  
***************
*** 720,723 ****
--- 722,731 ----
  ###########################################################
  
+ def _test():
+     import doctest, Cookie
+     return doctest.testmod(Cookie)
+ 
+ if __name__ == "__main__":
+     _test()
  
  

Index: __init__.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/py15/__init__.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** __init__.py	21 Nov 2000 01:57:36 -0000	1.1
--- __init__.py	17 Mar 2002 09:57:38 -0000	1.2
***************
*** 5,8 ****
--- 5,11 ----
      All rights reserved, see COPYING for details.
  
+     Cookie.py is copied from Python 2.1; see LICENSE.Python for
+     licensing information applying to this module,
+ 
      $Id$
  """





More information about the Moin-devel mailing list