Skip to content

Commit 9d528ec

Browse files
committed
breaking some long lines (should rewrite this to use icalendar rather than vobject)
1 parent 321b394 commit 9d528ec

5 files changed

Lines changed: 30 additions & 15 deletions

File tree

examples/basic_usage_examples.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,7 @@ def read_modify_event_demo(event):
181181
## Finally, let's verify that the correct data was saved
182182
calendar = event.parent
183183
same_event = calendar.event_by_uid(uid)
184-
assert (
185-
same_event.component["summary"]
186-
== "Norwegian national day celebrations"
187-
)
184+
assert same_event.component["summary"] == "Norwegian national day celebrations"
188185

189186

190187
def search_calendar_demo(calendar):

examples/scheduling_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## NOTE! This is currently NOT tested. It may and may not work.
22
## Please reach out if you need help with scheduling ... by https://xkcd.com/1179/
33
## or scheduling-help@plann.no
4-
54
import sys
65
import uuid
76
from datetime import datetime

examples/sync_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
## similar code in the tests/test_caldav.py file. Raise a github
44
## issue or reach out by email or write a pull request or send a patch
55
## if there are mistakes in this code) ...
6-
76
## USE CASE #1: we'll have a local copy of all calendar contents in a
87
## running python process, and later we'd like to synchronize the
98
## local contents. (In case of a reboot, all contents will be

tests/test_caldav.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,10 @@ def testCopyEvent(self):
14201420
## the copy in the other calendar as a distinct entity, even
14211421
## if the uid is the same.
14221422
assert e1.vobject_instance.vevent.summary.value == "Bastille Day Party"
1423-
assert c2.events()[0].vobject_instance.vevent.uid == e1.vobject_instance.vevent.uid
1423+
assert (
1424+
c2.events()[0].vobject_instance.vevent.uid
1425+
== e1.vobject_instance.vevent.uid
1426+
)
14241427

14251428
## Duplicate the event in the same calendar, with same uid -
14261429
## this makes no sense, there won't be any duplication
@@ -1602,17 +1605,26 @@ def testSearchEvent(self):
16021605
## Even sorting should work out
16031606
all_events = c.search(sort_keys=("summary", "dtstamp"))
16041607
assert len(all_events) == 3
1605-
assert all_events[0].vobject_instance.vevent.summary.value == "Bastille Day Jitsi Party"
1608+
assert (
1609+
all_events[0].vobject_instance.vevent.summary.value
1610+
== "Bastille Day Jitsi Party"
1611+
)
16061612

16071613
## Sorting by upper case should also wor
16081614
all_events = c.search(sort_keys=("SUMMARY", "DTSTAMP"))
16091615
assert len(all_events) == 3
1610-
assert all_events[0].vobject_instance.vevent.summary.value == "Bastille Day Jitsi Party"
1616+
assert (
1617+
all_events[0].vobject_instance.vevent.summary.value
1618+
== "Bastille Day Jitsi Party"
1619+
)
16111620

16121621
## Sorting in reverse order should work also
16131622
all_events = c.search(sort_keys=("SUMMARY", "DTSTAMP"), sort_reverse=True)
16141623
assert len(all_events) == 3
1615-
assert all_events[0].vobject_instance.vevent.summary.value == "Our Blissful Anniversary"
1624+
assert (
1625+
all_events[0].vobject_instance.vevent.summary.value
1626+
== "Our Blissful Anniversary"
1627+
)
16161628

16171629
## A more robust check for the sort key
16181630
all_events = c.search(sort_keys=("DTSTART",))
@@ -2372,9 +2384,13 @@ def testTodoCompletion(self):
23722384
assert len(todos) == 3
23732385
if not self.check_compatibility_flag("object_by_uid_is_broken"):
23742386
t3_ = c.todo_by_uid(t3.id)
2375-
assert t3_.vobject_instance.vtodo.summary == t3.vobject_instance.vtodo.summary
2387+
assert (
2388+
t3_.vobject_instance.vtodo.summary == t3.vobject_instance.vtodo.summary
2389+
)
23762390
assert t3_.vobject_instance.vtodo.uid == t3.vobject_instance.vtodo.uid
2377-
assert t3_.vobject_instance.vtodo.dtstart == t3.vobject_instance.vtodo.dtstart
2391+
assert (
2392+
t3_.vobject_instance.vtodo.dtstart == t3.vobject_instance.vtodo.dtstart
2393+
)
23782394

23792395
t2.delete()
23802396

@@ -2674,11 +2690,15 @@ def testCreateOverwriteDeleteEvent(self):
26742690
t2 = c.save_todo(todo, no_create=no_create)
26752691

26762692
## this should also work.
2677-
e2.vobject_instance.vevent.summary.value = e2.vobject_instance.vevent.summary.value + "!"
2693+
e2.vobject_instance.vevent.summary.value = (
2694+
e2.vobject_instance.vevent.summary.value + "!"
2695+
)
26782696
e2.save(no_create=no_create)
26792697

26802698
if todo_ok:
2681-
t2.vobject_instance.vtodo.summary.value = t2.vobject_instance.vtodo.summary.value + "!"
2699+
t2.vobject_instance.vtodo.summary.value = (
2700+
t2.vobject_instance.vtodo.summary.value + "!"
2701+
)
26822702
t2.save(no_create=no_create)
26832703

26842704
if not self.check_compatibility_flag("event_by_url_is_broken"):

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ def test_get_events_example(self):
2929

3030
def test_basic_usage_examples(self):
3131
from examples import basic_usage_examples
32-
basic_usage_examples.run_examples()
3332

33+
basic_usage_examples.run_examples()

0 commit comments

Comments
 (0)