6
Copyright (C) 1999 Christian Scholz (ruebe@aachen.heimat.de)
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Library General Public
10
License as published by the Free Software Foundation; either
11
version 2 of the License, or (at your option) any later version.
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Library General Public License for more details.
18
You should have received a copy of the GNU Library General Public
19
License along with this library; if not, write to the Free
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
from StringIO import StringIO
29
from status import STATUS_CODES
30
from utils import gen_estring, quote_uri, make_xmlresponse
31
from davcmd import deltree
35
def __init__(self,uri,dataclass):
36
self.__dataclass=dataclass
40
""" delete a collection """
43
result=dc.deltree(self.__uri)
45
if not len(result.items()):
46
return None # everything ok
48
# create the result element
49
return make_xmlresponse(result)
52
""" delete a resource """
55
result=dc.delone(self.__uri)
57
if not result: return None
58
if not len(result.items()):
59
return None # everything ok
61
# create the result element
62
return make_xmlresponse(result)