[Erp5-report] r12183 - /erp5/trunk/products/ERP5/Document/File.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 22 11:37:31 CET 2007


Author: bartek
Date: Mon Jan 22 11:37:28 2007
New Revision: 12183

URL: http://svn.erp5.org?rev=12183&view=rev
Log:
 reformatted code; merged Romain's changes

Modified:
    erp5/trunk/products/ERP5/Document/File.py

Modified: erp5/trunk/products/ERP5/Document/File.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/File.py?rev=12183&r1=12182&r2=12183&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/File.py (original)
+++ erp5/trunk/products/ERP5/Document/File.py Mon Jan 22 11:37:28 2007
@@ -26,20 +26,19 @@
 #
 ##############################################################################
 
+import mimetypes
+import re
+
 from AccessControl import ClassSecurityInfo
-
 from Products.CMFCore.WorkflowCore import WorkflowMethod
 from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
 from Products.ERP5Type.Cache import CachingMethod
 from Products.ERP5.Document.Document import Document
 from Products.ERP5Type.Base import Base
-
 from Products.CMFDefault.File import File as CMFFile
-
 from zLOG import LOG
-
-import mimetypes, re
 from DateTime import DateTime
+
 mimetypes.init()
 
 rs=[]
@@ -47,10 +46,12 @@
 rs.append(re.compile('<!DOCTYPE[^>]*>'))
 rs.append(re.compile('<.?(HTML|BODY)[^>]*>',re.DOTALL|re.MULTILINE|re.IGNORECASE))
 
+
 def stripHtml(txt): # XXX-JPS to be moved to TextDocument
   for r in rs:
     txt=r.sub('',txt)
   return txt
+
 
 class File(Document, CMFFile):
   """
@@ -172,7 +173,7 @@
       data_list = []
       while data is not None:
         data_list.append(data.data)
-        data=data.next
+        data = data.next
       return ''.join(data_list)
 
   security.declareProtected(Permissions.ModifyPortalContent, 'guessMimeType')
@@ -191,8 +192,8 @@
   def PUT(self,REQUEST,RESPONSE):
     self.clearConversionCache()
     CMFFile.PUT(self,REQUEST,RESPONSE)
-    self.DMS_ingestFile(fname=self.getId()) # XXX-JPS we should call here Document_discoverMetadata
-                                            # with the filename as parameter
+    self.discoverMetadata(fname=self.getId())
+
 
   # DAV Support
   index_html = CMFFile.index_html # XXX-JPS - Here we have a security issue - ask seb what to do




More information about the Erp5-report mailing list