Overview

Installation
============

Just install `sape` package via easy_install, pip or from repository.

Repository URL: http://bitbucket.org/lorien/sape


Usage in django project
=======================

 * Create directory where local links database should be saved
 * Put 'sape.django' into settings.INSTALLED_APPS
 * Put 'sape.django.context_processors.sape'
   into settings.TEMPLATE_CONTEXT_PROCESSORS
 * Put path to local links database into settings.SAPE_DATABASE
 * Put sape.ru account ID to settings.SAPE_USER
 * Put site hostname to settings.SAPE_HOST
 * Setup cron to run periodically the command `manage.py sape_refresh`.
   That command download fresh version of links database.
   Sample cron entry: * * * * * cd /web/project; ./manage.py sape_refresh
 * Put `{{ sape.links|safeseq|join:", " }} in the template


Usage in arbitrary python project
=================================

 * Write script which calls sape.provider.refresh_local_database function and passes
   it correct arguments (path to local database, sape.ru account ID, site hostname)
 * Call that script periodically with cron or anything else
 * Use sape.client.Client instance to get links for the page.


Example of Client usage
=======================

    from sape.client import Client

    url = 'http://mydomain.com/cat/subcat/?foo=bar'
    client = Client('var/links.db', url)
    links = client.links()


Example of Provider usage
=========================

    from sape.provider import refresh_local_database

    refresh_local_database('var/links.db', 'sape.ru ID', 'mydomain.com')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.