Commits

Artur Barseghyan committed b1aa377 Draft

change setup, docs

Comments (0)

Files changed (4)

 *.pyc
 .hgignore~
 setup.py~
+src/eximagination.egg*
+===============
+eximagination
+===============
+
+Description
+-----------------
+A Django template tag library which allows downloading of external images right from the template and save it into a
+desired context variable along with `width` and `height` of the image fetched. Caches the fetched images locally.
+
+License
+-----------------
+GPL 2.0/LGPL 2.1
+
+Installation
+-----------------
+* Latest stable version on PyPI:
+    $ pip install eximagination
+* Latest development version:
+    $ pip install -e hg+http://bitbucket.org/barseghyanartur/eximagination#egg=eximagination
+* Add 'eximagination' to `INSTALLED_APPS` of settings.py:
+    >>> INSTALLED_APPS = (
+    >>> # ...
+    >>> 'eximagination',
+    >>> # ...
+    >>> )
+* Make sure to have the right path to media root defined in eximagination specific constants either in defaults.py:
+    >>> # Example settings.py
+    >>> import os
+    >>> PROJECT_DIR = lambda s: os.path.abspath(os.path.join(os.path.dirname(__file__), s).replace('\\','/'))
+    >>> EXIMAGINATION_MEDIA_ROOT = PROJECT_DIR('media/external_images/')
+    >>> EXIMAGINATION_MEDIA_URL = '/media/external_images'
+    >>> EXIMAGINATION_MEDIA_RELATIVE_ROOT = 'external_images/'
+    >>> EXIMAGINATION_DEBUG = True
+* ...or or settings.py:
+    >>> # Example defaults.py
+    >>> import os
+    >>> PROJECT_DIR = lambda s: os.path.abspath(os.path.join(os.path.dirname(__file__), s).replace('\\','/'))
+    >>> DEBUG = False
+    >>> MEDIA_ROOT = PROJECT_DIR('media/external_images')
+    >>> MEDIA_URL = '/media/external_images/'
+    >>> MEDIA_RELATIVE_ROOT = 'external_images/'
+
+Usage example (in a Django template)
+-------------------------------------
+    >>> {% load eximaginate thumbnail %}
+    >>> {% eximaginate 'http://www.google.com/intl/en/images/logo.gif' %}
+
+    or
+
+    >>> {% load eximaginate thumbnail %}
+    >>> {% eximaginate 'http://www.google.com/intl/en/images/logo.gif' as original %}
+    >>> {% thumbnail original 100x100 %}
+
+    In both cases there are two additional context variables added:
+        `ei_width` - Width of the image
+        `ei_height` - Height of the image
+
+Author
+-----------------
+Artur Barseghyan <artur.barseghyan@gmail.com>

readme.txt

-AUTHOR
-    Artur Barseghyan (artur.barseghyan@gmail.com)
-
-DESCRIPTION
-    The idea is to generate thumbnails of external URLs. SORL does brilliant generation of thumbnails, but it does not 
-    work with external URLs. So we need to have a template tag, which will download an image and return its' relative 
-    URL in the system.
-
-REQUIREMENTS
-    * Image filename shall be an md5 of its' absolute URL.
-    * Before downloading the image given - check first if it does not exist in the system yet and not new (we can 
-    check file local time and if it is for example 1 month old we can download it again).
-    * When needs to be downloaded, download and save locally in a separate folder.
-    * We need to have certain application settings in settings.py
-
-INSTALLATION
-    You may install eximagination with pip install
-        pip install eximagination
-
-    Alternatively, you may copy the eximagination directory to your project directory or install it in your virtual
-    environment.
-
-    Make sure to have the right path to media root defined in eximagination specific constants (either in defaults.py
-    or settings.py).
-
-    Add 'eximagination' to INSTALLED_APPS of settings.py.
-
-    Example settings.py
-        # extimagination options
-        EXIMAGINATION_MEDIA_ROOT = PROJECT_DIR('media/external_images/')
-        EXIMAGINATION_MEDIA_URL = '/media/external_images'
-        EXIMAGINATION_MEDIA_RELATIVE_ROOT = 'external_images/'
-        EXIMAGINATION_DEBUG = True
-
-    Example defaults.py
-        DEBUG = False
-        MEDIA_ROOT = PROJECT_DIR('media/external_images')
-        MEDIA_URL = '/media/external_images/'
-        MEDIA_RELATIVE_ROOT = 'external_images/'
-
-    USAGE
-        {% eximaginate 'http://www.google.com/intl/en/images/logo.gif' %}
-
-        or
-
-        {% eximaginate 'http://www.google.com/intl/en/images/logo.gif' as original %}
-
-    In both cases there are two additional context variables added:
-        ei_width - Width of the image
-        ei_height - Height of the image
 import os
 from setuptools import setup, find_packages
 
-readme = open(os.path.join(os.path.dirname(__file__), 'readme.txt')).read()
+readme = open(os.path.join(os.path.dirname(__file__), 'readme.rst')).read()
 
 version = '0.2'