# -*- coding: latin-1 -*-
""" 
   Copyright (C) 2003 PimenTech SARL (http://www.pimentech.net)

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  
"""

__version__='$Revision: 1.25 $'[11:-2]

from Products.PimenTechLibCommon.zlog import *

class Object(ZLog):
	"the top class object"

	meta_type = 'Object'
	__super_init = ZLog.__init__
	
	def __init__(self, id, title=''):
		"Object init"
		self.__super_init(id, title)
		
	def __repr__(self):
		return "<%s id='%s' title='%s'/>" % (self.meta_type, self.getId(), self.title)

	def __str__(self):
		"do not overload, should be equivalent to self.getId()"
		return self.getId()

	def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):
		"""__call__() -> string. pour <dtml-var>"""
		return self.getId()
	
	def __cmp__(self, object):
		return cmp(str(self),str(object))

	def __nonzero__(self):
		return 1
	
	def __hash__(self):
		return hash(self.getId())

