Ignore:
Timestamp:
10 Dec 2011, 06:15:17 (13 years ago)
Author:
Henrik Bettermann
Message:

Replace the term 'WAeUP' by SIRP which is a WAeUP product.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/image
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/image/README.txt

    r6584 r7321  
    22========================================
    33
    4 The image file widget is built on top of the :class:`WAeUPImageFile` object::
    5 
    6   >>> from waeup.sirp.image import WAeUPImageFile
    7   >>> file = WAeUPImageFile('foo.jpg', 'mydata')
     4The image file widget is built on top of the :class:`SIRPImageFile` object::
     5
     6  >>> from waeup.sirp.image import SIRPImageFile
     7  >>> file = SIRPImageFile('foo.jpg', 'mydata')
    88  >>> file.filename
    99  'foo.jpg'
     
    1616  'mydata'
    1717
    18 We can also create WAeUPImageFile objects from file-like objects::
     18We can also create SIRPImageFile objects from file-like objects::
    1919
    2020  >>> from StringIO import StringIO
     
    3636----------------
    3737
    38 The WAeUPImageFile object normally stores the file data using ZODB
     38The SIRPImageFile object normally stores the file data using ZODB
    3939persistence. Files can however also be stored by tramline.  If
    4040tramline is installed in Apache, the Tramline takes care of generating
     
    7373just '1') will now be created::
    7474
    75   >>> file = WAeUPImageFile('foo.jpg', '1')
     75  >>> file = SIRPImageFile('foo.jpg', '1')
    7676
    7777The data is now '1', referring to the real file::
     
    102102We expect the same behavior as when tramline is not installed::
    103103
    104   >>> file = WAeUPImageFile('foo.jpg', 'data')
     104  >>> file = SIRPImageFile('foo.jpg', 'data')
    105105  >>> f = file.file
    106106  >>> f.read()
     
    141141  Traceback (most recent call last):
    142142  ...
    143   WrongType: ('asd', <class 'waeup.sirp.image.image.WAeUPImageFile'>, 'foo')
     143  WrongType: ('asd', <class 'waeup.sirp.image.image.SIRPImageFile'>, 'foo')
    144144
    145145which means: `ImageFile` fields should better contain
    146 :class:`WAeUPImageFile` instances.
    147 
    148 We can store normal :class:`WAeUPImageFile` instances:
    149 
    150   >>> field.validate(WAeUPImageFile('bar.jpg', 'data')) is None
     146:class:`SIRPImageFile` instances.
     147
     148We can store normal :class:`SIRPImageFile` instances:
     149
     150  >>> field.validate(SIRPImageFile('bar.jpg', 'data')) is None
    151151  True
    152152
     
    173173
    174174  >>> field.validate(
    175   ...     WAeUPImageFile('bar.jpg', '123456789012')) is None
    176   True
    177 
    178   >>> field.validate(
    179   ...     WAeUPImageFile('bar.jpg', '12345')) is None
     175  ...     SIRPImageFile('bar.jpg', '123456789012')) is None
     176  True
     177
     178  >>> field.validate(
     179  ...     SIRPImageFile('bar.jpg', '12345')) is None
    180180  True
    181181
     
    183183
    184184  >>> field.validate(
    185   ...     WAeUPImageFile('bar.jpg', '1234567890123'))
     185  ...     SIRPImageFile('bar.jpg', '1234567890123'))
    186186  Traceback (most recent call last):
    187187  ...
     
    189189
    190190  >>> field.validate(
    191   ...     WAeUPImageFile('bar.jpg', '1234'))
     191  ...     SIRPImageFile('bar.jpg', '1234'))
    192192  Traceback (most recent call last):
    193193  ...
     
    198198----------------------------
    199199
    200 WAeUPImageFile does not reproduce the broken unequal comparison from
     200SIRPImageFile does not reproduce the broken unequal comparison from
    201201its base:
    202202
    203   >>> f1 = WAeUPImageFile('bar.jpg', '123456789')
    204   >>> f2 = WAeUPImageFile('bar.jpg', '123456789')
    205   >>> f3 = WAeUPImageFile('baz.jpg', '1234')
     203  >>> f1 = SIRPImageFile('bar.jpg', '123456789')
     204  >>> f2 = SIRPImageFile('bar.jpg', '123456789')
     205  >>> f3 = SIRPImageFile('baz.jpg', '1234')
    206206  >>> f1 == f2
    207207  True
  • main/waeup.sirp/trunk/src/waeup/sirp/image/__init__.py

    r7137 r7321  
    33Includings schemas, widgets and the content components.
    44"""
    5 from waeup.sirp.image.image import WAeUPImageFile, createWAeUPImageFile
     5from waeup.sirp.image.image import SIRPImageFile, createSIRPImageFile
    66
    77__all__ = [
    8     "WAeUPImageFile",
    9     "createWAeUPImageFile",
     8    "SIRPImageFile",
     9    "createSIRPImageFile",
    1010    ]
  • main/waeup.sirp/trunk/src/waeup/sirp/image/browser/tests/image.txt

    r6537 r7321  
    1212
    1313  >>> import os
    14   >>> from waeup.sirp.image import WAeUPImageFile
     14  >>> from waeup.sirp.image import SIRPImageFile
    1515  >>> testimage = os.path.join(os.path.dirname(__file__), 'sample.jpg')
    1616  >>> testimage2 = os.path.join(os.path.dirname(__file__), 'sample2.jpg')
    17   >>> some_file = WAeUPImageFile('foo.jpg', open(testimage, 'rb').read())
     17  >>> some_file = SIRPImageFile('foo.jpg', open(testimage, 'rb').read())
    1818  >>> some_file.filename
    1919  'foo.jpg'
     
    166166prepare some new file:
    167167
    168   >>> another_file = WAeUPImageFile('bar.txt', 'bar contents')
     168  >>> another_file = SIRPImageFile('bar.txt', 'bar contents')
    169169
    170170We happen to know, due to the implementation of
     
    200200---------------------------
    201201
    202 As :class:`waeup.sirp.image.WAeUPImageFile` objects support storing
     202As :class:`waeup.sirp.image.SIRPImageFile` objects support storing
    203203image data by using external 'storages', also our widgets should do
    204204so.
     
    220220  ...         contents = f.read()
    221221  ...         id_string = hashlib.md5(contents).hexdigest()
    222   ...         result = WAeUPImageFile(filename, id_string)
     222  ...         result = SIRPImageFile(filename, id_string)
    223223  ...         self.storage[id_string] = contents
    224224  ...         return result
     
    260260We now want to simulate, that the field contains already data,
    261261identified by some `file_id`. To do so, we first store the data in our
    262 file retrieval and then create a WAeUPImageFile object with that
     262file retrieval and then create a SIRPImageFile object with that
    263263file_id stored:
    264264
    265   >>> from waeup.sirp.image import createWAeUPImageFile
    266   >>> image = createWAeUPImageFile(
     265  >>> from waeup.sirp.image import createSIRPImageFile
     266  >>> image = createSIRPImageFile(
    267267  ...     'sample.jpg', open(testimage, 'rb'))
    268268  >>> file_id = image.data
     
    274274  '9feac4265077922000aa8b88748e25be'
    275275
    276 The new file was stored by our utility, as createWAeUPImageFile looks
     276The new file was stored by our utility, as createSIRPImageFile looks
    277277up IFileRetrieval utilities and uses them:
    278278
  • main/waeup.sirp/trunk/src/waeup/sirp/image/browser/widget.py

    r7196 r7321  
    1919"""
    2020import os
    21 from waeup.sirp.image import WAeUPImageFile
     21from waeup.sirp.image import SIRPImageFile
    2222from hurry.file.browser.widget import (
    2323    EncodingFileWidget, DownloadWidget, FakeFieldStorage)
     
    6262                seek(0)
    6363                return retrieval.createFile(input.filename, input)
    64             return WAeUPImageFile(input.filename, data)
     64            return SIRPImageFile(input.filename, data)
    6565        else:
    6666            return self.context.missing_value
     
    143143        data = file_id.decode('base64')
    144144        filename, filedata = data.split('\n', 1)
    145         return WAeUPImageFile(filename, filedata)
     145        return SIRPImageFile(filename, filedata)
    146146
    147147class ThumbnailWidget(DownloadWidget):
  • main/waeup.sirp/trunk/src/waeup/sirp/image/image.py

    r7196 r7321  
    2323from zope.component import getUtility
    2424from zope.interface import implements
    25 from waeup.sirp.image.interfaces import IWAeUPImageFile
     25from waeup.sirp.image.interfaces import ISIRPImageFile
    2626
    27 class WAeUPImageFile(HurryFile):
     27class SIRPImageFile(HurryFile):
    2828    """A file prepared for storing image files.
    2929
     
    3232    regular hurry files.
    3333
    34     To create a :class:`WAeUPImageFile` you should use
    35     :func:`createWAeUPImageFile`.
     34    To create a :class:`SIRPImageFile` you should use
     35    :func:`createSIRPImageFile`.
    3636    """
    37     implements(IWAeUPImageFile)
     37    implements(ISIRPImageFile)
    3838
    3939    def __ne__(self, other):
     
    4545            return True
    4646
    47 def createWAeUPImageFile(filename, f):
     47def createSIRPImageFile(filename, f):
    4848    retrieval = getUtility(IFileRetrieval)
    4949    return retrieval.createFile(filename, f)
  • main/waeup.sirp/trunk/src/waeup/sirp/image/interfaces.py

    r7196 r7321  
    2424    """
    2525   
    26 class IWAeUPImageFile(IHurryFile):
     26class ISIRPImageFile(IHurryFile):
    2727    """Image file.
    2828    """
  • main/waeup.sirp/trunk/src/waeup/sirp/image/schema.py

    r7196 r7321  
    2323from hurry.file.schema import File
    2424from waeup.sirp.image.interfaces import IImageFile
    25 from waeup.sirp.image.image import WAeUPImageFile
     25from waeup.sirp.image.image import SIRPImageFile
    2626
    2727class MinMaxSize(object):
     
    8282    implements(IImageFile)
    8383
    84     _type = WAeUPImageFile
     84    _type = SIRPImageFile
Note: See TracChangeset for help on using the changeset viewer.