Skip to content

Commit

Permalink
Spelling and grammar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scop authored and tobixen committed Oct 3, 2023
1 parent 373e86d commit 7686694
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Seems like I've been using the wrong procedure all the time for doing pypi-relea

## [1.3.3] - 2023-07-19

Summary: Some few workarounds to support yet more differenct calendar servers and cloud providers, some few minor enhancements needed by various contributors, and some minor bugfixes.
Summary: Some few workarounds to support yet more different calendar servers and cloud providers, some few minor enhancements needed by various contributors, and some minor bugfixes.

### Added
* Support for very big events, credits to github user @aaujon in https://github.com/python-caldav/caldav/pull/301
Expand Down
2 changes: 1 addition & 1 deletion caldav/davclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def principal(self, *largs, **kwargs):
def calendar(self, **kwargs):
"""Returns a calendar object.
Typically, an URL should be given as a named parameter (url)
Typically, a URL should be given as a named parameter (url)
No network traffic will be initiated by this method.
Expand Down
4 changes: 2 additions & 2 deletions caldav/lib/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class URL:
This class is for wrapping URLs into objects. It's used
internally in the library, end users should not need to know
anything about this class. All methods that accept URLs can be
fed either with an URL object, a string or an urlparse.ParsedURL
fed either with a URL object, a string or a urlparse.ParsedURL
object.
Addresses may be one out of three:
Expand Down Expand Up @@ -70,7 +70,7 @@ def __eq__(self, other):
def __hash__(self):
return hash(str(self))

# TODO: better naming? Will return url if url is already an URL
# TODO: better naming? Will return url if url is already a URL
# object, else will instantiate a new URL object
@classmethod
def objectify(self, url):
Expand Down
4 changes: 2 additions & 2 deletions caldav/lib/vcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## Global counter. We don't want to be too verbose on the users, ref https://github.com/home-assistant/core/issues/86938
fixup_error_loggings = 0

## Fixups to the icalendar data to work around compatbility issues.
## Fixups to the icalendar data to work around compatibility issues.

## TODO:

Expand Down Expand Up @@ -76,7 +76,7 @@ def fix(event):
## 3 fix duplicated DTSTAMP ... and ...
## 5 prepare to remove DURATION or DTEND/DUE if both DURATION and
## DTEND/DUE is set.
## OPTIMIZATION TODO: use list and join rather than concatination
## OPTIMIZATION TODO: use list and join rather than concatenation
## remove duplication of DTSTAMP
fixed2 = ""
for line in fixed.strip().split("\n"):
Expand Down
36 changes: 18 additions & 18 deletions caldav/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def __init__(self, client=None, url=None):
Returns a Principal.
Parameters:
* client: a DAVClient() oject
* client: a DAVClient() object
* url: Deprecated - for backwards compatibility purposes only.
If url is not given, deduct principal path as well as calendar home set
Expand Down Expand Up @@ -545,7 +545,7 @@ def calendar_home_set(self):
calendar_home_set_url = self.get_property(cdav.CalendarHomeSet())
## owncloud returns /remote.php/dav/calendars/tobixen@e.email/
## in that case the @ should be quoted. Perhaps other
## implentations returns already quoted URLs. Hacky workaround:
## implementations return already quoted URLs. Hacky workaround:
if (
calendar_home_set_url is not None
and "@" in calendar_home_set_url
Expand Down Expand Up @@ -881,7 +881,7 @@ def date_search(
"""Deprecated. Use self.search() instead.
Search events by date in the calendar. Recurring events are
expanded if they are occuring during the specified time frame
expanded if they are occurring during the specified time frame
and if an end timestamp is given.
Parameters:
Expand Down Expand Up @@ -1097,8 +1097,8 @@ def search(
component = o.icalendar_component
if component is None:
continue
recurrance_properties = ["exdate", "exrule", "rdate", "rrule"]
if any(key in component for key in recurrance_properties):
recurrence_properties = ["exdate", "exrule", "rdate", "rrule"]
if any(key in component for key in recurrence_properties):
o.expand_rrule(start, end)
if split_expanded:
objects_ = objects
Expand Down Expand Up @@ -1787,24 +1787,24 @@ def expand_rrule(self, start, end):
recurrings = recurring_ical_events.of(
self.icalendar_instance, components=["VJOURNAL", "VTODO", "VEVENT"]
).between(start, end)
recurrance_properties = ["exdate", "exrule", "rdate", "rrule"]
recurrence_properties = ["exdate", "exrule", "rdate", "rrule"]
# FIXME too much copying
stripped_event = self.copy(keep_uid=True)
# remove all recurrance properties
# remove all recurrence properties
for component in stripped_event.vobject_instance.components():
if component.name in ("VEVENT", "VTODO"):
for key in recurrance_properties:
for key in recurrence_properties:
try:
del component.contents[key]
except KeyError:
pass

calendar = self.icalendar_instance
calendar.subcomponents = []
for occurance in recurrings:
occurance.add("RECURRENCE-ID", occurance.get("DTSTART"))
calendar.add_component(occurance)
# add other components (except for the VEVENT itself and VTIMEZONE which is not allowed on occurance events)
for occurrence in recurrings:
occurrence.add("RECURRENCE-ID", occurrence.get("DTSTART"))
calendar.add_component(occurrence)
# add other components (except for the VEVENT itself and VTIMEZONE which is not allowed on occurrence events)
for component in stripped_event.icalendar_instance.subcomponents:
if component.name not in ("VEVENT", "VTODO", "VTIMEZONE"):
calendar.add_component(component)
Expand Down Expand Up @@ -2098,7 +2098,7 @@ def load(self, only_if_unloaded=False):
## TODO: self.id should either always be available or never
def _find_id_path(self, id=None, path=None):
"""
With CalDAV, every object has an URL. With icalendar, every object
With CalDAV, every object has a URL. With icalendar, every object
should have a UID. This UID may or may not be copied into self.id.
This method will:
Expand Down Expand Up @@ -2308,7 +2308,7 @@ def __str__(self):
## and any modification to those instances should apply
def _set_data(self, data):
## The __init__ takes a data attribute, and it should be allowable to
## set it to an vobject object or an icalendar object, hence we should
## set it to a vobject object or an icalendar object, hence we should
## do type checking on the data (TODO: but should probably use
## isinstance rather than this kind of logic
if type(data).__module__.startswith("vobject"):
Expand Down Expand Up @@ -2473,7 +2473,7 @@ class FreeBusy(CalendarObjectResource):
will probably throw errors (perhaps the class hierarchy should be
rethought, to prevent the FreeBusy from inheritating moot methods)
Update: With RFC6638 a freebusy object can have an URL and an ID.
Update: With RFC6638 a freebusy object can have a URL and an ID.
"""

def __init__(self, parent, data, url=None, id=None):
Expand All @@ -2497,7 +2497,7 @@ def _next(self, ts=None, i=None, dtstart=None, rrule=None, by=None, no_count=Tru
If any BY*-parameters are present, assume the task should have
fixed deadlines and preserve information from the previous
dtstart. If no BY*-parametes are present, assume the
dtstart. If no BY*-parameters are present, assume the
frequency is meant to be the interval between the tasks.
Examples:
Expand Down Expand Up @@ -2526,7 +2526,7 @@ def _next(self, ts=None, i=None, dtstart=None, rrule=None, by=None, no_count=Tru
but an algorithm cannot do guesswork on weather it's silly or
not. If DTSTART would be set to the earliest possible time
one could start thinking on this task (like, Monday evening),
then we would get TUe the 14th of November, which does make
then we would get Tue the 14th of November, which does make
sense. Unfortunately the icalendar standard does not specify
what should be used for DTSTART and DURATION/DUE.
Expand Down Expand Up @@ -2734,7 +2734,7 @@ def complete(
* handle_rrule - if set to True, the library will try to be smart if
the task is recurring. The default is False, for backward
compatibility. I may consider making this one mandatory.
* rrule_mode - The RFC leaves a lot of room for intepretation on how
* rrule_mode - The RFC leaves a lot of room for interpretation on how
to handle recurring tasks, and what works on one server may break at
another. The following modes are accepted:
* this_and_future - see doc for _complete_recurring_thisandfuture for details
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_usage_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def calendar_by_url_demo(client, url):
event_url = events[0].url

## there is no similar method for fetching an event through
## an URL. One may construct the object like this though:
## a URL. One may construct the object like this though:
same_event = caldav.Event(client=client, parent=calendar, url=event_url)

## That was also done without any network traffic. To get the same_event
Expand Down
2 changes: 1 addition & 1 deletion examples/scheduling_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
except:
rfc6638_users = None

## Some inital setup. We'll need three caldav client objects, with
## Some initial setup. We'll need three caldav client objects, with
## corresponding principal objects and calendars.
class TestUser:
def __init__(self, i):
Expand Down
4 changes: 2 additions & 2 deletions tests/compatibility_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## * Consider how to get this into the documentation
incompatibility_description = {
'no_expand':
"""Server may throw errors when asked to do a expanded date search (this is ignored by the tests now, as we're doing client-side expansion)""",
"""Server may throw errors when asked to do an expanded date search (this is ignored by the tests now, as we're doing client-side expansion)""",

'no_recurring':
"""Server is having issues with recurring events and/or todos. """
Expand Down Expand Up @@ -191,7 +191,7 @@
"""The is-not-defined in a calendar-query not working as it should - see https://gitlab.com/davical-project/davical/-/issues/281""",

'search_needs_comptype':
"""The server may not always come up with anything useful when searching for objects and ommitting to specify weather one wants to see tasks or events""",
"""The server may not always come up with anything useful when searching for objects and omitting to specify weather one wants to see tasks or events""",
}

xandikos = [
Expand Down
2 changes: 1 addition & 1 deletion tests/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from caldav.davclient import DAVClient

# from .compability_issues import bedework, xandikos
# from .compatibility_issues import bedework, xandikos

####################################
# Import personal test server config
Expand Down
2 changes: 1 addition & 1 deletion tests/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def close(self):
pass

if os.fork() != 0:
# allow the child pid to instanciate the server
# allow the child pid to instantiate the server
# class
sleep(1)
sys.exit(0)
Expand Down
24 changes: 12 additions & 12 deletions tests/test_caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ class RepeatedFunctionalTestsBaseClass(object):
"""This is a class with functional tests (tests that goes through
basic functionality and actively communicates with third parties)
that we want to repeat for all configured caldav_servers.
(what a truely ugly name for this class - any better ideas?)
(what a truly ugly name for this class - any better ideas?)
NOTE: this tests relies heavily on the assumption that we can create
calendars on the remote caldav server, but the RFC says ...
Support for MKCALENDAR on the server is only RECOMMENDED and not
Expand Down Expand Up @@ -843,7 +843,7 @@ def testCalendarByFullURL(self):
mycal = self._fixCalendar()
samecal = self.caldav.principal().calendar(cal_id=str(mycal.url))
assert mycal.url.canonical() == samecal.url.canonical()
## passing cal_id as an URL object should also work.
## passing cal_id as a URL object should also work.
samecal = self.caldav.principal().calendar(cal_id=mycal.url)
assert mycal.url.canonical() == samecal.url.canonical()

Expand Down Expand Up @@ -1270,7 +1270,7 @@ def testSearchEvent(self):
assert len(some_events) == 0

## This is not a very useful search, and it's sort of a client side bug that we allow it at all.
## It will not match if categories field is set to "PERSONAL,ANNIVERSARY,SPECIAL OCCATION"
## It will not match if categories field is set to "PERSONAL,ANNIVERSARY,SPECIAL OCCASION"
## It may not match since the above is to be considered equivalent to the raw data entered.
some_events = c.search(
comp_class=Event, category="ANNIVERSARY,PERSONAL,SPECIAL OCCASION"
Expand Down Expand Up @@ -1390,7 +1390,7 @@ def testSearchTodos(self):
assert len(some_todos) == 0

## This is not a very useful search, and it's sort of a client side bug that we allow it at all.
## It will not match if categories field is set to "PERSONAL,ANNIVERSARY,SPECIAL OCCATION"
## It will not match if categories field is set to "PERSONAL,ANNIVERSARY,SPECIAL OCCASION"
## It may not match since the above is to be considered equivalent to the raw data entered.
some_todos = c.search(comp_class=Todo, category="FAMILY,FINANCE")
if not self.check_compatibility_flag("text_search_not_working"):
Expand Down Expand Up @@ -1562,7 +1562,7 @@ def testSetDue(self):
## updated ... until we reload it
some_todo.load()

## This should work out (set the childs due to some time before the parents due)
## This should work out (set the children due to some time before the parents due)
some_todo.set_due(
datetime(2022, 12, 26, 20, 30, tzinfo=utc),
move_dtstart=True,
Expand All @@ -1575,7 +1575,7 @@ def testSetDue(self):
2022, 12, 26, 19, 35, tzinfo=utc
)

## This should not work out (set the childs due to some time before the parents due)
## This should not work out (set the children due to some time before the parents due)
with pytest.raises(error.ConsistencyError):
some_todo.set_due(
datetime(2022, 12, 26, 21, 30, tzinfo=utc),
Expand All @@ -1591,7 +1591,7 @@ def testSetDue(self):
parent=[some_todo.id],
)

## This should still work out (set the childs due to some time before the parents due)
## This should still work out (set the children due to some time before the parents due)
## (The fact that we now have a child does not affect it anyhow)
some_todo.set_due(
datetime(2022, 12, 26, 20, 31, tzinfo=utc),
Expand Down Expand Up @@ -1651,7 +1651,7 @@ def testCreateTaskListAndTodo(self):
# Zimbra has separate calendars and task lists, and it's not
# allowed to put TODO-tasks into the calendar. We need to
# tell Zimbra that the new "calendar" is a task list. This
# is done though the supported_calendar_compontent_set
# is done though the supported_calendar_component_set
# property - hence the extra parameter here:
logging.info("Creating calendar Yep for tasks")
c = self._fixCalendar(supported_calendar_component_set=["VTODO"])
Expand All @@ -1673,7 +1673,7 @@ def testCreateTaskListAndTodo(self):
)
assert len(c.todos()) == 2

# adding a todo without an UID, it should also work (library will add the missing UID)
# adding a todo without a UID, it should also work (library will add the missing UID)
t7 = c.save_todo(todo7)
assert len(c.todos()) == 3

Expand All @@ -1685,7 +1685,7 @@ def testCreateTaskListAndTodo(self):

def testTodos(self):
"""
This test will excercise the cal.todos() method,
This test will exercise the cal.todos() method,
and in particular the sort_keys attribute.
* It will list out all pending tasks, sorted by due date
* It will list out all pending tasks, sorted by priority
Expand Down Expand Up @@ -1867,7 +1867,7 @@ def testTodoDatesearch(self):
assert len([x for x in todos1 if "DTSTART:20270415T1330" in x.data]) == 0
assert len([x for x in todos2 if "DTSTART:20270415T1330" in x.data]) == 0

# TODO: prod the caldav server implementators about the RFC
# TODO: prod the caldav server implementers about the RFC
# breakages.

def testTodoCompletion(self):
Expand Down Expand Up @@ -2399,7 +2399,7 @@ def testRecurringDateSearch(self):

def testOffsetURL(self):
"""
pass an URL pointing to a calendar or a user to the DAVClient class,
pass a URL pointing to a calendar or a user to the DAVClient class,
and things should still work
"""
urls = [self.principal.url, self._fixCalendar().url]
Expand Down

0 comments on commit 7686694

Please sign in to comment.