[Python-modules-commits] [python-odf] 11/118: Drop the variable icon

Wolfgang Borgert debacle at moszumanska.debian.org
Fri Oct 3 21:27:16 UTC 2014


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to reference refs/remotes/upstream/master
in repository python-odf.

commit 9b64af43613bd140174aa3eea19661f9783ca04d
Author: Søren Roug <soren.roug at eea.europa.eu>
Date:   Thu Nov 20 20:43:59 2008 +0000

    Drop the variable icon
---
 contrib/ODFFile/ODFFile.py       | 18 +++++++++---------
 contrib/ODFFile/__init__.py      |  5 ++++-
 contrib/ODFFile/help/ODFFile.stx |  5 +++++
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/contrib/ODFFile/ODFFile.py b/contrib/ODFFile/ODFFile.py
index 97e529a..de18060 100644
--- a/contrib/ODFFile/ODFFile.py
+++ b/contrib/ODFFile/ODFFile.py
@@ -90,7 +90,7 @@ class ODFFile(File):
     """ ODFFile class """
 
     meta_type = "OpenDocument File"
-#   icon = 'misc_/ODFFile/file'
+#   icon = 'misc_/ODFFile/presentation'
 
 #   manage_options = (
 #       (File.manage_options[5],
@@ -156,10 +156,6 @@ class ODFFile(File):
         data, size = self._read_data(file)
         content_type = self._get_content_type(file, data, self.__name__, 'undefined')
         self.update_data(data, content_type, size)
-        suffix = odmimetypes.get(content_type)
-        if suffix:
-            self.suffix = suffix
-        self.update_xhtml()
         self._p_changed = 1
 
     security.declareProtected(view, 'download')
@@ -167,7 +163,7 @@ class ODFFile(File):
         """ set for download asociated file """
         self.REQUEST.RESPONSE.setHeader('Content-Type', self.content_type)
         self.REQUEST.RESPONSE.setHeader('Content-Length', self.size)
-        self.REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment;filename="' + self.id() + "." + self.suffix + '"')
+        self.REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment;filename="' + self.id() + self.suffix + '"')
         return ODFFile.inheritedAttribute('index_html')(self, REQUEST, RESPONSE)
 
     security.declareProtected(view, 'download')
@@ -215,8 +211,12 @@ class ODFFile(File):
         self.xhtml = odhandler.odf2xhtml(fd).encode('us-ascii','xmlcharrefreplace')
         self.title = odhandler.title
 
-#   update_data__roles__=()
-#   def update_data(self, data, content_type=None, size=None):
-#       File.__dict__['update_data'](self, data, content_type, size)
+    update_data__roles__=()
+    def update_data(self, data, content_type=None, size=None):
+        File.__dict__['update_data'](self, data, content_type, size)
+        suffix = odmimetypes.get(content_type)
+        if suffix:
+            self.suffix = suffix
+        self.update_xhtml()
 
 InitializeClass(ODFFile)
diff --git a/contrib/ODFFile/__init__.py b/contrib/ODFFile/__init__.py
index 1a46204..e5219d7 100644
--- a/contrib/ODFFile/__init__.py
+++ b/contrib/ODFFile/__init__.py
@@ -21,6 +21,7 @@
 #Zope imports
 from ODFFile import ODFFile, manage_addODFFileForm, manage_addODFFile
 from AccessControl.Permissions import add_documents_images_and_files
+#from App.ImageFile import ImageFile
 
 
 def initialize(context):
@@ -38,5 +39,7 @@ def initialize(context):
     context.registerHelpTitle('ODFFile')
 
 #misc_ = {
-#   'help.gif':ImageFile('images/help.gif', globals())
+#  'text':ImageFile('images/openofficeorg-oasis-text.gif', globals()),
+#  'presentation':ImageFile('images/openofficeorg-oasis-presentation.gif', globals()),
+#  'spreadsheet':ImageFile('images/openofficeorg-oasis-spreadsheet.gif', globals())
 #    }
diff --git a/contrib/ODFFile/help/ODFFile.stx b/contrib/ODFFile/help/ODFFile.stx
new file mode 100644
index 0000000..ff62729
--- /dev/null
+++ b/contrib/ODFFile/help/ODFFile.stx
@@ -0,0 +1,5 @@
+OpenDocument File: Use OpenDocument as web content management
+
+  OpenDocument File will accept an ODF file and show it as HTML incl.
+  images. It can optionally put the standard_html_header and
+  standard_html_footer around the content.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-odf.git



More information about the Python-modules-commits mailing list