Ignore:
Timestamp:
8 Mar 2012, 22:28:46 (13 years ago)
Author:
Henrik Bettermann
Message:

KOFA -> Kofa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/image/browser/tests/image.txt

    r7811 r7819  
    1212
    1313  >>> import os
    14   >>> from waeup.kofa.image import KOFAImageFile
     14  >>> from waeup.kofa.image import KofaImageFile
    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 = KOFAImageFile('foo.jpg', open(testimage, 'rb').read())
     17  >>> some_file = KofaImageFile('foo.jpg', open(testimage, 'rb').read())
    1818  >>> some_file.filename
    1919  'foo.jpg'
     
    166166prepare some new file:
    167167
    168   >>> another_file = KOFAImageFile('bar.txt', 'bar contents')
     168  >>> another_file = KofaImageFile('bar.txt', 'bar contents')
    169169
    170170We happen to know, due to the implementation of
     
    200200---------------------------
    201201
    202 As :class:`waeup.kofa.image.KOFAImageFile` objects support storing
     202As :class:`waeup.kofa.image.KofaImageFile` 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 = KOFAImageFile(filename, id_string)
     222  ...         result = KofaImageFile(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 KOFAImageFile object with that
     262file retrieval and then create a KofaImageFile object with that
    263263file_id stored:
    264264
    265   >>> from waeup.kofa.image import createKOFAImageFile
    266   >>> image = createKOFAImageFile(
     265  >>> from waeup.kofa.image import createKofaImageFile
     266  >>> image = createKofaImageFile(
    267267  ...     'sample.jpg', open(testimage, 'rb'))
    268268  >>> file_id = image.data
     
    274274  '9feac4265077922000aa8b88748e25be'
    275275
    276 The new file was stored by our utility, as createKOFAImageFile looks
     276The new file was stored by our utility, as createKofaImageFile looks
    277277up IFileRetrieval utilities and uses them:
    278278
Note: See TracChangeset for help on using the changeset viewer.