Commit e1ac9ed1 authored by Ivan Tyagov's avatar Ivan Tyagov

Move to an abstract class as these constants are usefull for other sub classes.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37104 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 800e7a09
...@@ -65,11 +65,18 @@ VALID_ORDER_KEY_LIST = ('user_login', 'content', 'file_name', 'input') ...@@ -65,11 +65,18 @@ VALID_ORDER_KEY_LIST = ('user_login', 'content', 'file_name', 'input')
# these property ids are unchangable # these property ids are unchangable
FIXED_PROPERTY_IDS = ('id', 'uid', 'rid', 'sid') FIXED_PROPERTY_IDS = ('id', 'uid', 'rid', 'sid')
# XXX: move to an easier to configure place (System Preference ?)
VALID_TEXT_FORMAT_LIST = ('text', 'txt', 'html', 'base_html', VALID_TEXT_FORMAT_LIST = ('text', 'txt', 'html', 'base_html',
'stripped-html') 'stripped-html')
VALID_IMAGE_FORMAT_LIST = ('jpg', 'jpeg', 'png', 'gif', 'pnm', 'ppm', 'tiff') VALID_IMAGE_FORMAT_LIST = ('jpg', 'jpeg', 'png', 'gif', 'pnm', 'ppm', 'tiff')
DEFAULT_DISPLAY_ID_LIST = ('nano', 'micro', 'thumbnail',
'xsmall', 'small', 'medium',
'large', 'large', 'xlarge',)
DEFAULT_QUALITY = 75
class SnapshotMixin: class SnapshotMixin:
""" """
This class provides a generic API to store in the ZODB This class provides a generic API to store in the ZODB
......
...@@ -44,7 +44,7 @@ from Products.ERP5Type import Permissions, PropertySheet ...@@ -44,7 +44,7 @@ from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.Utils import fill_args_from_request from Products.ERP5Type.Utils import fill_args_from_request
from Products.ERP5.Document.File import File from Products.ERP5.Document.File import File
from Products.ERP5.Document.Document import Document, ConversionError,\ from Products.ERP5.Document.Document import Document, ConversionError,\
VALID_TEXT_FORMAT_LIST VALID_TEXT_FORMAT_LIST, DEFAULT_DISPLAY_ID_LIST, DEFAULT_QUALITY, _MARKER
from os.path import splitext from os.path import splitext
from OFS.Image import Image as OFSImage from OFS.Image import Image as OFSImage
from OFS.Image import getImageInfo from OFS.Image import getImageInfo
...@@ -52,16 +52,8 @@ from zLOG import LOG, WARNING ...@@ -52,16 +52,8 @@ from zLOG import LOG, WARNING
# import mixin # import mixin
from Products.ERP5.mixin.text_convertable import TextConvertableMixin from Products.ERP5.mixin.text_convertable import TextConvertableMixin
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
DEFAULT_DISPLAY_ID_LIST = ('nano', 'micro', 'thumbnail',
'xsmall', 'small', 'medium',
'large', 'large', 'xlarge',)
DEFAULT_QUALITY = 75
_MARKER = []
class Image(TextConvertableMixin, File, OFSImage): class Image(TextConvertableMixin, File, OFSImage):
""" """
An Image is a File which contains image data. It supports An Image is a File which contains image data. It supports
......
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