@@ -150,11 +150,11 @@ class Discover:
150
150
_homeset_tag = None
151
151
_well_known_uri = None
152
152
_collection_xml = b"""
153
- <d: propfind xmlns:d ="DAV:">
154
- <d: prop>
155
- <d: resourcetype />
156
- </d: prop>
157
- </d: propfind>
153
+ <propfind xmlns="DAV:">
154
+ <prop>
155
+ <resourcetype />
156
+ </prop>
157
+ </propfind>
158
158
"""
159
159
160
160
def __init__ (self , session , kwargs ):
@@ -180,11 +180,11 @@ def _find_principal_impl(self, url):
180
180
headers = self .session .get_default_headers ()
181
181
headers ['Depth' ] = '0'
182
182
body = b"""
183
- <d: propfind xmlns:d ="DAV:">
184
- <d: prop>
185
- <d: current-user-principal />
186
- </d: prop>
187
- </d: propfind>
183
+ <propfind xmlns="DAV:">
184
+ <prop>
185
+ <current-user-principal />
186
+ </prop>
187
+ </propfind>
188
188
"""
189
189
190
190
response = self .session .request ('PROPFIND' , url , headers = headers ,
@@ -300,16 +300,16 @@ def create(self, collection):
300
300
301
301
def _create_collection_impl (self , url ):
302
302
data = '''<?xml version="1.0" encoding="utf-8" ?>
303
- <D: mkcol xmlns:D ="DAV:">
304
- <D: set>
305
- <D: prop>
306
- <D: resourcetype>
307
- <D: collection/>
303
+ <mkcol xmlns="DAV:">
304
+ <set>
305
+ <prop>
306
+ <resourcetype>
307
+ <collection/>
308
308
{}
309
- </D: resourcetype>
310
- </D: prop>
311
- </D: set>
312
- </D: mkcol>
309
+ </resourcetype>
310
+ </prop>
311
+ </set>
312
+ </mkcol>
313
313
''' .format (
314
314
etree .tostring (etree .Element (self ._resourcetype ),
315
315
encoding = 'unicode' )
@@ -328,11 +328,11 @@ class CalDiscover(Discover):
328
328
_namespace = 'urn:ietf:params:xml:ns:caldav'
329
329
_resourcetype = '{%s}calendar' % _namespace
330
330
_homeset_xml = b"""
331
- <d: propfind xmlns:d ="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
332
- <d: prop>
331
+ <propfind xmlns="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
332
+ <prop>
333
333
<c:calendar-home-set />
334
- </d: prop>
335
- </d: propfind>
334
+ </prop>
335
+ </propfind>
336
336
"""
337
337
_homeset_tag = '{%s}calendar-home-set' % _namespace
338
338
_well_known_uri = '/.well-known/caldav'
@@ -342,11 +342,11 @@ class CardDiscover(Discover):
342
342
_namespace = 'urn:ietf:params:xml:ns:carddav'
343
343
_resourcetype = '{%s}addressbook' % _namespace
344
344
_homeset_xml = b"""
345
- <d: propfind xmlns:d ="DAV:" xmlns:c="urn:ietf:params:xml:ns:carddav">
346
- <d: prop>
345
+ <propfind xmlns="DAV:" xmlns:c="urn:ietf:params:xml:ns:carddav">
346
+ <prop>
347
347
<c:addressbook-home-set />
348
- </d: prop>
349
- </d: propfind>
348
+ </prop>
349
+ </propfind>
350
350
"""
351
351
_homeset_tag = '{%s}addressbook-home-set' % _namespace
352
352
_well_known_uri = '/.well-known/carddav'
@@ -463,7 +463,7 @@ def get_multi(self, hrefs):
463
463
for href in hrefs :
464
464
if href != self ._normalize_href (href ):
465
465
raise exceptions .NotFoundError (href )
466
- href_xml .append (f'<D: href>{ href } </D: href>' )
466
+ href_xml .append (f'<href>{ href } </href>' )
467
467
if not href_xml :
468
468
return ()
469
469
@@ -620,13 +620,13 @@ def list(self):
620
620
headers ['Depth' ] = '1'
621
621
622
622
data = b'''<?xml version="1.0" encoding="utf-8" ?>
623
- <D: propfind xmlns:D ="DAV:">
624
- <D: prop>
625
- <D: resourcetype/>
626
- <D: getcontenttype/>
627
- <D: getetag/>
628
- </D: prop>
629
- </D: propfind>
623
+ <propfind xmlns="DAV:">
624
+ <prop>
625
+ <resourcetype/>
626
+ <getcontenttype/>
627
+ <getetag/>
628
+ </prop>
629
+ </propfind>
630
630
'''
631
631
632
632
# We use a PROPFIND request instead of addressbook-query due to issues
@@ -647,11 +647,11 @@ def get_meta(self, key):
647
647
648
648
xpath = f'{{{ namespace } }}{ tagname } '
649
649
data = '''<?xml version="1.0" encoding="utf-8" ?>
650
- <D: propfind xmlns:D ="DAV:">
651
- <D: prop>
650
+ <propfind xmlns="DAV:">
651
+ <prop>
652
652
{}
653
- </D: prop>
654
- </D: propfind>
653
+ </prop>
654
+ </propfind>
655
655
''' .format (
656
656
etree .tostring (etree .Element (xpath ), encoding = 'unicode' )
657
657
).encode ('utf-8' )
@@ -683,13 +683,13 @@ def set_meta(self, key, value):
683
683
element .text = normalize_meta_value (value )
684
684
685
685
data = '''<?xml version="1.0" encoding="utf-8" ?>
686
- <D: propertyupdate xmlns:D ="DAV:">
687
- <D: set>
688
- <D: prop>
686
+ <propertyupdate xmlns="DAV:">
687
+ <set>
688
+ <prop>
689
689
{}
690
- </D: prop>
691
- </D: set>
692
- </D: propertyupdate>
690
+ </prop>
691
+ </set>
692
+ </propertyupdate>
693
693
''' .format (etree .tostring (element , encoding = 'unicode' )).encode ('utf-8' )
694
694
695
695
self .session .request (
@@ -714,12 +714,12 @@ class CalDAVStorage(DAVStorage):
714
714
end_date = None
715
715
716
716
get_multi_template = '''<?xml version="1.0" encoding="utf-8" ?>
717
- <C:calendar-multiget xmlns:D ="DAV:"
717
+ <C:calendar-multiget xmlns="DAV:"
718
718
xmlns:C="urn:ietf:params:xml:ns:caldav">
719
- <D: prop>
720
- <D: getetag/>
719
+ <prop>
720
+ <getetag/>
721
721
<C:calendar-data/>
722
- </D: prop>
722
+ </prop>
723
723
{hrefs}
724
724
</C:calendar-multiget>'''
725
725
@@ -796,12 +796,12 @@ def list(self):
796
796
yield from DAVStorage .list (self )
797
797
798
798
data = '''<?xml version="1.0" encoding="utf-8" ?>
799
- <C:calendar-query xmlns:D ="DAV:"
799
+ <C:calendar-query xmlns="DAV:"
800
800
xmlns:C="urn:ietf:params:xml:ns:caldav">
801
- <D: prop>
802
- <D: getcontenttype/>
803
- <D: getetag/>
804
- </D: prop>
801
+ <prop>
802
+ <getcontenttype/>
803
+ <getetag/>
804
+ </prop>
805
805
<C:filter>
806
806
{caldavfilter}
807
807
</C:filter>
@@ -833,12 +833,12 @@ class CardDAVStorage(DAVStorage):
833
833
discovery_class = CardDiscover
834
834
835
835
get_multi_template = '''<?xml version="1.0" encoding="utf-8" ?>
836
- <C:addressbook-multiget xmlns:D ="DAV:"
836
+ <C:addressbook-multiget xmlns="DAV:"
837
837
xmlns:C="urn:ietf:params:xml:ns:carddav">
838
- <D: prop>
839
- <D: getetag/>
838
+ <prop>
839
+ <getetag/>
840
840
<C:address-data/>
841
- </D: prop>
841
+ </prop>
842
842
{hrefs}
843
843
</C:addressbook-multiget>'''
844
844
0 commit comments