kopia lustrzana https://github.com/collective/icalendar
remove whitespace
rodzic
0095c6f66e
commit
cff4a28735
|
@ -316,12 +316,12 @@ class Component(CaselessDict):
|
|||
# set the timezone as a parameter to the property
|
||||
tzid = value.tzinfo.zone
|
||||
self[name].params.update({'TZID': tzid})
|
||||
|
||||
|
||||
def _decode(self, name, value):
|
||||
# internal for decoding property values
|
||||
decoded = types_factory.from_ical(name, value)
|
||||
return decoded
|
||||
|
||||
|
||||
def decoded(self, name, default=_marker):
|
||||
"Returns decoded value of property"
|
||||
if name in self:
|
||||
|
|
|
@ -137,7 +137,7 @@ class vBinary:
|
|||
return ical.decode('base-64')
|
||||
except UnicodeError:
|
||||
raise ValueError, 'Not valid base 64 encoding.'
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -177,7 +177,7 @@ class vBoolean(int):
|
|||
return vBoolean.bool_map[ical]
|
||||
except:
|
||||
raise ValueError, "Expected 'TRUE' or 'FALSE'. Got %s" % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -213,7 +213,7 @@ class vCalAddress(str):
|
|||
return str(ical)
|
||||
except:
|
||||
raise ValueError, 'Expected vCalAddress, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -303,7 +303,7 @@ class vFloat(float):
|
|||
return float(ical)
|
||||
except:
|
||||
raise ValueError, 'Expected float value, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -335,7 +335,7 @@ class vInt(int):
|
|||
return int(ical)
|
||||
except:
|
||||
raise ValueError, 'Expected int, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -406,7 +406,7 @@ class vDDDLists:
|
|||
for ical_dt in ical_dates:
|
||||
out.append(vDDDTypes.from_ical(ical_dt))
|
||||
return out
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -471,7 +471,7 @@ class vDDDTypes:
|
|||
return vDatetime.from_ical(ical, timezone=timezone)
|
||||
except:
|
||||
return vDate.from_ical(ical)
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -511,7 +511,7 @@ class vDate:
|
|||
return date(*timetuple)
|
||||
except:
|
||||
raise ValueError, 'Wrong date format %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -609,7 +609,7 @@ class vDatetime:
|
|||
raise ValueError, ical
|
||||
except:
|
||||
raise ValueError, 'Wrong datetime format: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -710,7 +710,7 @@ class vDuration:
|
|||
return value
|
||||
except:
|
||||
raise ValueError('Invalid iCalendar duration: %s' % ical)
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -825,7 +825,7 @@ class vPeriod:
|
|||
return (start, end_or_duration)
|
||||
except:
|
||||
raise ValueError, 'Expected period format, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -899,7 +899,7 @@ class vWeekday(str):
|
|||
return vWeekday(ical.upper())
|
||||
except:
|
||||
raise ValueError, 'Expected weekday abbrevation, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -942,7 +942,7 @@ class vFrequency(str):
|
|||
return vFrequency(ical.upper())
|
||||
except:
|
||||
raise ValueError, 'Expected weekday abbrevation, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -989,9 +989,9 @@ class vRecur(CaselessDict):
|
|||
>>> r = vRecur.from_ical(p)
|
||||
>>> r
|
||||
... # doctest: +NORMALIZE_WHITESPACE
|
||||
{'BYHOUR': [8, 9], 'BYDAY': ['-SU'], 'BYMINUTE': [30], 'BYMONTH': [1],
|
||||
{'BYHOUR': [8, 9], 'BYDAY': ['-SU'], 'BYMINUTE': [30], 'BYMONTH': [1],
|
||||
'FREQ': ['YEARLY'], 'INTERVAL': [2]}
|
||||
|
||||
|
||||
>>> vRecur(r).to_ical()
|
||||
'FREQ=YEARLY;INTERVAL=2;BYMINUTE=30;BYHOUR=8,9;BYDAY=-SU;BYMONTH=1'
|
||||
|
||||
|
@ -1070,7 +1070,7 @@ class vRecur(CaselessDict):
|
|||
return dict(recur)
|
||||
except:
|
||||
raise ValueError, 'Error in recurrence rule: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -1114,7 +1114,7 @@ class vText(unicode):
|
|||
Notice how accented E character, encoded with latin-1, got replaced
|
||||
with the official U+FFFD REPLACEMENT CHARACTER.
|
||||
"""
|
||||
|
||||
|
||||
encoding = DEFAULT_ENCODING
|
||||
|
||||
def __new__(cls, value, encoding=DEFAULT_ENCODING):
|
||||
|
@ -1155,7 +1155,7 @@ class vText(unicode):
|
|||
return ical.decode(vText.encoding, 'replace')
|
||||
except:
|
||||
raise ValueError, 'Expected ical text, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -1192,7 +1192,7 @@ class vTime(time):
|
|||
return time(*timetuple)
|
||||
except:
|
||||
raise ValueError, 'Expected time, got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -1220,7 +1220,7 @@ class vUri(str):
|
|||
return str(ical)
|
||||
except:
|
||||
raise ValueError, 'Expected , got: %s' % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -1266,7 +1266,7 @@ class vGeo:
|
|||
return (float(latitude), float(longitude))
|
||||
except:
|
||||
raise ValueError, "Expected 'float;float' , got: %s" % ical
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -1366,7 +1366,7 @@ class vUTCOffset:
|
|||
if sign == '-':
|
||||
return -offset
|
||||
return offset
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
@ -1396,7 +1396,7 @@ class vInline(str):
|
|||
|
||||
def from_ical(ical):
|
||||
return str(ical)
|
||||
|
||||
|
||||
from_ical = staticmethod(from_ical)
|
||||
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ Some properties are required to be compliant::
|
|||
>>> cal.add('version', '2.0')
|
||||
|
||||
We need at least one subcomponent for a calendar to be compliant::
|
||||
|
||||
|
||||
>>> import pytz
|
||||
>>> event = Event()
|
||||
>>> event.add('summary', 'Python meeting about calendaring')
|
||||
|
|
|
@ -18,4 +18,4 @@ Testing recurrence.
|
|||
|
||||
>>> first_event['exdate'].dts[2].dt
|
||||
datetime.datetime(1996, 4, 4, 1, 0, tzinfo=<UTC>)
|
||||
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ METHOD:Request
|
|||
PRODID:-//My product//mxm.dk/
|
||||
VERSION:2.0
|
||||
BEGIN:VEVENT
|
||||
DESCRIPTION:This is a very long description that will be folded This is a
|
||||
very long description that will be folded This is a very long description
|
||||
DESCRIPTION:This is a very long description that will be folded This is a
|
||||
very long description that will be folded This is a very long description
|
||||
that will be folded This is a very long description that will be folded Th
|
||||
is is a very long description that will be folded This is a very long desc
|
||||
ription that will be folded This is a very long description that will be f
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -6,7 +6,7 @@ deps =
|
|||
unittest2
|
||||
coverage
|
||||
interlude
|
||||
commands =
|
||||
commands =
|
||||
coverage erase
|
||||
coverage run --source=icalendar --omit=*tests* {envbindir}/unit2 discover icalendar []
|
||||
coverage report --omit=*tests*
|
||||
|
|
Ładowanie…
Reference in New Issue