##############################################################################
#
# Copyright (c) 2002 Ingeniweb SARL
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################

"""
AttachmentField product
"""
from global_symbols import *

import AttachmentHandler

if sys.platform == "win32":
    program = "type"
else:
    program = "cat"



class TextAttachment(AttachmentHandler.AbstractHandler):
    """
    TextAttachment file abstraction
    """
    icon_file = "text.gif"
    small_icon_file = "text_small.gif"
    content_types = ('text/plain', )
    converter_type = "Text"

    index_path = program
    index_arguments = r"%s"
    index_encoding = None
    
    preview_path = program
    preview_arguments = r"%s"
    preview_encoding = None
    preview_format = "text"


AttachmentHandler.registerHandler(TextAttachment)
