reportlab/lib/abag.py
author rgbecker
Wed, 29 Nov 2000 16:16:33 +0000
changeset 517 dffd258916bc
child 548 223699ff68fc
permissions -rw-r--r--
Initial version split from paraparser.py
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
517
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     1
#copyright ReportLab Inc. 2000
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     2
#see license.txt for license details
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     3
#history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/lib/abag.py?cvsroot=reportlab
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     4
#$Header: /tmp/reportlab/reportlab/lib/abag.py,v 1.1 2000/11/29 16:16:33 rgbecker Exp $
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     5
class ABag:
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     6
	"""
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     7
	A trivial BAG class for holding attributes
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     8
	"""
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
     9
	def __init__(self,**attr):
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
    10
		for k,v in attr.items():
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
    11
			setattr(self,k,v)
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
    12
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
    13
	def clone(self,**attr):
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
    14
		n = apply(ABag,(),self.__dict__)
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
    15
		if attr != {}: apply(ABag.__init__,(n,),attr)
dffd258916bc Initial version split from paraparser.py
rgbecker
parents:
diff changeset
    16
		return n