Ignore:
Timestamp:
13 Nov 2014, 14:40:27 (10 years ago)
Author:
Henrik Bettermann
Message:

Change of name.

Location:
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/image/browser/__init__.py

    r7811 r11949  
    11# The public API part
    22# Contains the widgets defined for image files.
    3 from waeup.kofa.image.browser.widget import (
     3from waeup.ikoba.image.browser.widget import (
    44    EncodingImageFileWidget, ThumbnailWidget,
    55    )
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/image/browser/tests/image.txt

    r7819 r11949  
    1212
    1313  >>> import os
    14   >>> from waeup.kofa.image import KofaImageFile
     14  >>> from waeup.ikoba.image import IkobaImageFile
    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 = IkobaImageFile('foo.jpg', open(testimage, 'rb').read())
    1818  >>> some_file.filename
    1919  'foo.jpg'
     
    2626  >>> from hurry.file.browser import DownloadWidget
    2727  >>> from hurry.file.schema import File
    28   >>> from waeup.kofa.image.schema import ImageFile
     28  >>> from waeup.ikoba.image.schema import ImageFile
    2929  >>> from zope.publisher.browser import TestRequest
    3030  >>> field = ImageFile(__name__='foo', title=u'Foo')
     
    5151Instead of downloading, we can also use a thumbnail widget:
    5252
    53   >>> from waeup.kofa.image.browser import ThumbnailWidget
     53  >>> from waeup.ikoba.image.browser import ThumbnailWidget
    5454  >>> request = TestRequest(form={'field.foo': FileUpload(some_file)})
    5555  >>> widget = ThumbnailWidget(field, request)
     
    6161data already available, and no data in request:
    6262
    63   >>> from waeup.kofa.image.browser import EncodingImageFileWidget
     63  >>> from waeup.ikoba.image.browser import EncodingImageFileWidget
    6464  >>> field = ImageFile(__name__='foo', title=u'Foo', required=False)
    6565  >>> field = field.bind(None)
     
    166166prepare some new file:
    167167
    168   >>> another_file = KofaImageFile('bar.txt', 'bar contents')
     168  >>> another_file = IkobaImageFile('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.ikoba.image.IkobaImageFile` 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 = IkobaImageFile(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 IkobaImageFile object with that
    263263file_id stored:
    264264
    265   >>> from waeup.kofa.image import createKofaImageFile
    266   >>> image = createKofaImageFile(
     265  >>> from waeup.ikoba.image import createIkobaImageFile
     266  >>> image = createIkobaImageFile(
    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 createIkobaImageFile looks
    277277up IFileRetrieval utilities and uses them:
    278278
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/image/browser/tests/test_views.py

    r7811 r11949  
    3030from hurry.file.file import IdFileRetrieval
    3131from hurry.file.interfaces import IFileRetrieval
    32 from waeup.kofa.image.browser.views import HurryFileView
     32from waeup.ikoba.image.browser.views import HurryFileView
    3333from zope.component import getMultiAdapter, provideUtility
    3434from zope.publisher.browser import TestRequest
     
    4141class ImageBrowserViewsLayer(object):
    4242    """A layer that registers all components in
    43        `waeup.kofa.image.browser.views` module.
     43       `waeup.ikoba.image.browser.views` module.
    4444    """
    4545    @classmethod
    4646    def setUp(cls):
    47         grok.testing.grok('waeup.kofa.image.browser.views')
     47        grok.testing.grok('waeup.ikoba.image.browser.views')
    4848
    4949    @classmethod
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/image/browser/widget.py

    r7819 r11949  
    1919"""
    2020import os
    21 from waeup.kofa.image import KofaImageFile
     21from waeup.ikoba.image import IkobaImageFile
    2222from hurry.file.browser.widget import (
    2323    EncodingFileWidget, DownloadWidget, FakeFieldStorage)
     
    6262                seek(0)
    6363                return retrieval.createFile(input.filename, input)
    64             return KofaImageFile(input.filename, data)
     64            return IkobaImageFile(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 KofaImageFile(filename, filedata)
     145        return IkobaImageFile(filename, filedata)
    146146
    147147class ThumbnailWidget(DownloadWidget):
Note: See TracChangeset for help on using the changeset viewer.