Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
icalendar.prop.vGeo Class Reference

List of all members.

Public Member Functions

def __init__
def ical
def from_ical
def __str__

Public Attributes

 latitude
 longitude
 params

Static Public Attributes

tuple from_ical = staticmethod(from_ical)

Detailed Description

A special type that is only indirectly defined in the rfc.

>>> g = vGeo((1.2, 3.0))
>>> g.ical()
'1.2;3.0'

>>> g = vGeo.from_ical('37.386013;-122.082932')
>>> g
(37.386012999999998, -122.082932)

>>> vGeo(g).ical()
'37.386013;-122.082932'

>>> vGeo('g').ical()
Traceback (most recent call last):
    ...
ValueError: Input must be (float, float) for latitude and longitude

Definition at line 1089 of file prop.py.


Constructor & Destructor Documentation

def icalendar.prop.vGeo.__init__ (   self,
  geo 
)

Definition at line 1110 of file prop.py.

01110 
01111     def __init__(self, geo):
01112         try:
01113             latitude, longitude = geo
01114             latitude = float(latitude)
01115             longitude = float(longitude)
01116         except:
01117             raise ValueError('Input must be (float, float) for latitude and longitude')
01118         self.latitude = latitude
01119         self.longitude = longitude
01120         self.params = Parameters()


Member Function Documentation

Definition at line 1133 of file prop.py.

01133 
01134     def __str__(self):
01135         return self.ical()
01136 
01137 

Here is the call graph for this function:

Definition at line 1124 of file prop.py.

01124 
01125     def from_ical(ical):
01126         "Parses the data format from ical text format"
01127         try:
01128             latitude, longitude = ical.split(';')
01129             return (float(latitude), float(longitude))
01130         except:
            raise ValueError, "Expected 'float;float' , got: %s" % ical
def icalendar.prop.vGeo.ical (   self)

Definition at line 1121 of file prop.py.

01121 
01122     def ical(self):
01123         return '%s;%s' % (self.latitude, self.longitude)

Here is the caller graph for this function:


Member Data Documentation

tuple icalendar.prop.vGeo.from_ical = staticmethod(from_ical) [static]

Definition at line 1131 of file prop.py.

Definition at line 1117 of file prop.py.

Definition at line 1118 of file prop.py.

Definition at line 1119 of file prop.py.


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