Skip to content

Commit 7c57a6c

Browse files
committed
I always forget to run the style checl
1 parent 856269b commit 7c57a6c

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

caldav/davclient.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,22 @@ def principals(self, name=None):
563563
## TODO: allow server side filtering. We need a <D:property-search><D:prop><D:displayname/></D:prop><D:match>{name}</D:match></D:property-search> inside the PrincipalPropertySearch
564564

565565
if name:
566-
name_filter = [ dav.PropertySearch() + [dav.Prop() + [dav.DisplayName()]] + dav.Match(value=name)]
567-
import pdb; pdb.set_trace()
566+
name_filter = [
567+
dav.PropertySearch()
568+
+ [dav.Prop() + [dav.DisplayName()]]
569+
+ dav.Match(value=name)
570+
]
571+
import pdb
572+
573+
pdb.set_trace()
568574
else:
569575
name_filter = []
570576

571-
query = dav.PrincipalPropertySearch() + name_filter + [
572-
dav.Prop() + cdav.CalendarHomeSet() + dav.DisplayName()
573-
]
577+
query = (
578+
dav.PrincipalPropertySearch()
579+
+ name_filter
580+
+ [dav.Prop() + cdav.CalendarHomeSet() + dav.DisplayName()]
581+
)
574582
response = self.report(self.url, etree.tostring(query.xmlelement()))
575583
principal_dict = response.find_objects_and_props()
576584
ret = []

caldav/elements/dav.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ class PrincipalPropertySearch(BaseElement):
3030
class PropertySearch(BaseElement):
3131
tag: ClassVar[str] = ns("D", "property-search")
3232

33+
3334
# Filters
3435

36+
3537
class Match(BaseElement):
3638
tag: ClassVar[str] = ns("D", "match")
3739

40+
3841
# Conditions
3942
class SyncToken(BaseElement):
4043
tag: ClassVar[str] = ns("D", "sync-token")

tests/test_vcal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def normalize(s, ignore_uid):
4949
## ref https://github.com/python-caldav/caldav/issues/380
5050
for i in range(0, len(s)):
5151
## We cut the value itself, just asserting the attribute is present
52-
if s[i].startswith(b'DTSTAMP'):
52+
if s[i].startswith(b"DTSTAMP"):
5353
s[i] = s[i][:9]
5454
return b"\n".join(s)
5555

0 commit comments

Comments
 (0)