[Erp5-report] r40748 hugo.maia - /erp5/trunk/utils/cloudooo/cloudooo/manager.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Nov 26 00:33:30 CET 2010
Author: hugo.maia
Date: Fri Nov 26 00:33:30 2010
New Revision: 40748
URL: http://svn.erp5.org?rev=40748&view=rev
Log:
Refactor granulateFile
Modified:
erp5/trunk/utils/cloudooo/cloudooo/manager.py
Modified: erp5/trunk/utils/cloudooo/cloudooo/manager.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/manager.py?rev=40748&r1=40747&r2=40748&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/manager.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/manager.py [utf8] Fri Nov 26 00:33:30 2010
@@ -74,16 +74,19 @@ class Manager(object):
zip -- Boolean Attribute. If true, returns the grains in the form of a
zip archive
"""
- raise NotImplemented
+ raise NotImplementedError
GRANULATABLE_FORMAT_LIST = ("odt",)
if source_format not in GRANULATABLE_FORMAT_LIST:
file = self.convertFile(file, source_format, GRANULATABLE_FORMAT_LIST[0], zip=False)
from granulate.oogranulate import OOGranulate
document = OOGranulate(decodestring(file),
source_format)
- grains = document.granulate(zip)
+ grain = document.granulate(zip)
- return encodestring(grains)
+ if zip:
+ return encodestring(grain)
+
+ return map(encodestring, grain)
def updateFileMetadata(self, file, source_format, metadata_dict):
"""Receives the string of document and a dict with metadatas. The metadata
More information about the Erp5-report
mailing list