Commit b3882e3b authored by Jean-Paul Smets's avatar Jean-Paul Smets

Changed unpackData to a function.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13953 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9693a7f7
......@@ -42,6 +42,19 @@ from DateTime import DateTime
mimetypes.init()
def _unpackData(data):
"""
Unpack Pdata into string
"""
if isinstance(data, str):
return data
else:
data_list = []
while data is not None:
data_list.append(data.data)
data = data.next
return ''.join(data_list)
class File(Document, CMFFile, ConversionCacheMixin):
"""
A File can contain raw data which can be uploaded and downloaded.
......@@ -149,20 +162,6 @@ class File(Document, CMFFile, ConversionCacheMixin):
"""
return self.hasData()
security.declarePrivate('_unpackData')
def _unpackData(self, data):
"""
Unpack Pdata into string
"""
if isinstance(data, str):
return data
else:
data_list = []
while data is not None:
data_list.append(data.data)
data = data.next
return ''.join(data_list)
security.declareProtected(Permissions.ModifyPortalContent, 'guessMimeType')
def guessMimeType(self, fname=''):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment