Commit 59b1daa3 authored by Bartek Górny's avatar Bartek Górny

naming convention (#17)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10325 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 13aaf0d5
...@@ -79,7 +79,7 @@ if ctype is None:\n ...@@ -79,7 +79,7 @@ if ctype is None:\n
# create content\n # create content\n
ob=context.document_module.newContent(portal_type=ctype,file=data)\n ob=context.document_module.newContent(portal_type=ctype,file=data)\n
ob.setSourceReference(fname)\n ob.setSourceReference(fname)\n
ob.setPropertiesFromFilename(fname)\n ob.setPropertyListFromFilename(fname)\n
ob.guessMimeType(fname)\n ob.guessMimeType(fname)\n
code,msg=ob.convert()\n code,msg=ob.convert()\n
if code>0:\n if code>0:\n
......
...@@ -76,7 +76,7 @@ ob.log(script.getId(),ob.getRelativeUrl())\n ...@@ -76,7 +76,7 @@ ob.log(script.getId(),ob.getRelativeUrl())\n
if f is not None and f:\n if f is not None and f:\n
# if file uploaded, then:\n # if file uploaded, then:\n
fname=f.filename\n fname=f.filename\n
ob.setPropertiesFromFilename(fname)\n ob.setPropertyListFromFilename(fname)\n
ob.setSourceReference(fname)\n ob.setSourceReference(fname)\n
if not ob.getTitle():\n if not ob.getTitle():\n
ob.setTitle(fname)\n ob.setTitle(fname)\n
......
...@@ -197,8 +197,8 @@ class DMSFile(XMLObject,File): ...@@ -197,8 +197,8 @@ class DMSFile(XMLObject,File):
self.content_type=content_type self.content_type=content_type
return content_type return content_type
security.declareProtected(Permissions.ModifyPortalContent, 'setPropertiesFromFilename') security.declareProtected(Permissions.ModifyPortalContent, 'setPropertyListFromFilename')
def setPropertiesFromFilename(self,fname): def setPropertyListFromFilename(self,fname):
rx_parse=re.compile(self.portal_preferences.getPreferredDmsFilenameRegexp()) rx_parse=re.compile(self.portal_preferences.getPreferredDmsFilenameRegexp())
if rx_parse is None: if rx_parse is None:
self.setReference(fname) self.setReference(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