Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
xmlrpc.client.DateTime Class Reference

List of all members.

Public Member Functions

def __init__
def make_comparable
def __lt__
def __le__
def __gt__
def __ge__
def __eq__
def __ne__
def timetuple
def __str__
 Get date/time value.
def __repr__
def decode
def encode

Public Attributes

 value

Detailed Description

DateTime wrapper for an ISO 8601 string or time tuple or
localtime integer value to generate 'dateTime.iso8601' XML-RPC
value.

Definition at line 286 of file client.py.


Constructor & Destructor Documentation

def xmlrpc.client.DateTime.__init__ (   self,
  value = 0 
)

Definition at line 292 of file client.py.

00292 
00293     def __init__(self, value=0):
00294         if isinstance(value, str):
00295             self.value = value
00296         else:
00297             self.value = _strftime(value)

Here is the caller graph for this function:


Member Function Documentation

def xmlrpc.client.DateTime.__eq__ (   self,
  other 
)

Definition at line 335 of file client.py.

00335 
00336     def __eq__(self, other):
00337         s, o = self.make_comparable(other)
00338         return s == o

Here is the call graph for this function:

def xmlrpc.client.DateTime.__ge__ (   self,
  other 
)

Definition at line 331 of file client.py.

00331 
00332     def __ge__(self, other):
00333         s, o = self.make_comparable(other)
00334         return s >= o

Here is the call graph for this function:

def xmlrpc.client.DateTime.__gt__ (   self,
  other 
)

Definition at line 327 of file client.py.

00327 
00328     def __gt__(self, other):
00329         s, o = self.make_comparable(other)
00330         return s > o

Here is the call graph for this function:

def xmlrpc.client.DateTime.__le__ (   self,
  other 
)

Definition at line 323 of file client.py.

00323 
00324     def __le__(self, other):
00325         s, o = self.make_comparable(other)
00326         return s <= o

Here is the call graph for this function:

def xmlrpc.client.DateTime.__lt__ (   self,
  other 
)

Definition at line 319 of file client.py.

00319 
00320     def __lt__(self, other):
00321         s, o = self.make_comparable(other)
00322         return s < o

Here is the call graph for this function:

def xmlrpc.client.DateTime.__ne__ (   self,
  other 
)

Definition at line 339 of file client.py.

00339 
00340     def __ne__(self, other):
00341         s, o = self.make_comparable(other)
00342         return s != o

Here is the call graph for this function:

Definition at line 354 of file client.py.

00354 
00355     def __repr__(self):
00356         return "<DateTime %s at %x>" % (repr(self.value), id(self))

Get date/time value.

Returns:
Date/time value, as an ISO 8601 string.

Definition at line 351 of file client.py.

00351 
00352     def __str__(self):
00353         return self.value

def xmlrpc.client.DateTime.decode (   self,
  data 
)

Definition at line 357 of file client.py.

00357 
00358     def decode(self, data):
00359         self.value = str(data).strip()

def xmlrpc.client.DateTime.encode (   self,
  out 
)

Definition at line 360 of file client.py.

00360 
00361     def encode(self, out):
00362         out.write("<value><dateTime.iso8601>")
00363         out.write(self.value)
00364         out.write("</dateTime.iso8601></value>\n")

Here is the caller graph for this function:

def xmlrpc.client.DateTime.make_comparable (   self,
  other 
)

Definition at line 298 of file client.py.

00298 
00299     def make_comparable(self, other):
00300         if isinstance(other, DateTime):
00301             s = self.value
00302             o = other.value
00303         elif datetime and isinstance(other, datetime.datetime):
00304             s = self.value
00305             o = other.strftime("%Y%m%dT%H:%M:%S")
00306         elif isinstance(other, (str, unicode)):
00307             s = self.value
00308             o = other
00309         elif hasattr(other, "timetuple"):
00310             s = self.timetuple()
00311             o = other.timetuple()
00312         else:
00313             otype = (hasattr(other, "__class__")
00314                      and other.__class__.__name__
00315                      or type(other))
00316             raise TypeError("Can't compare %s and %s" %
00317                             (self.__class__.__name__, otype))
00318         return s, o

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 343 of file client.py.

00343 
00344     def timetuple(self):
00345         return time.strptime(self.value, "%Y%m%dT%H:%M:%S")

Here is the caller graph for this function:


Member Data Documentation

Definition at line 294 of file client.py.


The documentation for this class was generated from the following file: