File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 = []
Original file line number Diff line number Diff line change @@ -30,11 +30,14 @@ class PrincipalPropertySearch(BaseElement):
3030class PropertySearch (BaseElement ):
3131 tag : ClassVar [str ] = ns ("D" , "property-search" )
3232
33+
3334# Filters
3435
36+
3537class Match (BaseElement ):
3638 tag : ClassVar [str ] = ns ("D" , "match" )
3739
40+
3841# Conditions
3942class SyncToken (BaseElement ):
4043 tag : ClassVar [str ] = ns ("D" , "sync-token" )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments