changelog shortlog tags changeset files revisions annotate raw

shakespeare/__init__.py

changeset 286: 797037e7952e
parent:18fa45de345d
author: rgrp
date: Sat Mar 06 23:50:03 2010 +0100 (7 days ago)
permissions: -rw-r--r--
description: [model,templates,work][s]: add notes_snippet method and use it when displaying notes on work index page (replacing existing hacky approach).
1'''
2Introduction
3************
4
5The Open Shakespeare package provides a full open set of shakespeare's works
6(often in multiple versions) along with ancillary material, a variety of tools,
7a python API and a web interface that provides access to many (but not all) of
8these facilities from the comfort of your web browser (see
9http://www.openshakespeare.org/).
10
11All material is open source/open knowledge so that anyone can use, redistribute
12and reuse these materials freely. For exact details of the license under which
13this package is made available please see COPYING.txt.
14
15Open Shakespeare has been developed under the aegis of the Open Knowledge
16Foundation (http://www.okfn.org/).
17
18Contact the Project
19*******************
20
21Please mail open-shakespeare@okfn.org or join the open-literature mailing list:
22
23 http://lists.okfn.org/listinfo/open-literature
24
25
26Installation and Setup
27**********************
28
291. Install the code
30===================
31
321.1: (EITHER) Install using setup.py (preferred)
33------------------------------------------------
34
35Install ``shakespeare`` using easy_install (or pip)::
36
37 easy_install shakespeare
38 # or
39 pip install shakespeare
40
41NB: If you don't have easy_install you can get from here:
42
43<http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions>
44
45
461.2 (OR) Get the code straight from the repository
47--------------------------------------------------
48
491. Check out the mercurial repo::
50
51 hg clone https://knowledgeforge.net/shakespeare/hg
52
532. Do::
54
55 python setup.py develop
56
57
58Getting Started
59***************
60
61As a user:
62==========
63
641. Basic setup
65--------------
66
67To access most of the main features of Open Shakespeare you need a database.
68For this an other bits and bobs of configuration you will need a configuration
69file.
70
71You can make a config file as follows::
72
73 paster make-config shakespeare {your-config.ini}
74
75You should also symlink who.ini into same directory as your config file.
76
77Tweak the config file as appropriate and then setup the application::
78
79 paster setup-app config.ini
80
81[TODO: this should be part of setup-app]
82
83Run::
84
85 $ shakespeare-admin db init
86
87
882. Web Interface
89----------------
90
91The graphical user interface is a web interface.
92
93You can start a web server to provide a easy-to-use web interface to the
94shakespeare material and facilities by doing::
95
96 $ paster serve {your-config.ini}
97
98NB: {your-config.ini} should be replaced with the name of the config file you
99created earlier.
100
101
1023. Commands and Command Line Interface
103--------------------------------------
104
105Main command line interface is via shakespeare-admin. Check it out by doing::
106
107 shakespeare-admin help
108
109In addition to shakespeare-admin commands there are also some paster commands.
110To see what is available::
111
112 paster -h
113
114
1154. Extras
116---------
117
1181. To load the data packages, make sure you have downloaded and installed the
119 relevant data package (e.g. shksprdata or miltondata) and then do::
120
121 shakespeare-admin --config {your-ini-file} db init_shksprdata
122
1232. Search index. To run the search index you will need xapian and the python
124 xapian bindings installed. (On Debian/Ubuntu this is xapian and python-xapian).
125 Then take a look at::
126
127 shakespeare-admin search
128
1293. Word of the day. Enable this in your config file and then run
130word_of_the_day command to pull the data.
131
132
133As a developer:
134===============
135
1360. Setup
137--------
138
139Follow the basic steps above but with an ini file named: development.ini
140
141NB: you'll probably want to change log levels to debug.
142
1431. Check out the administrative commands
144----------------------------------------
145
146 $ bin/shakespeare-admin help.
147
1482. Run the tests using either py.test of nosetests::
149----------------------------------------------------
150
151 $ nosetests shakespeare
152'''
153__version__ = '0.7a'
154__application_name__ = 'shakespeare'
155
156def register_config(config_path):
157 import os
158 # TODO: remove? 2008-08-24 not mentioned in docs any more
159 # envVarName = __application_name__.upper() + 'CONF'
160 # config_path = os.environ.get(envVarName, '')
161 config_path = os.path.abspath(config_path)
162 import paste.deploy
163 pasteconf = paste.deploy.appconfig('config:' + config_path)
164 import shakespeare.config.environment
165 shakespeare.config.environment.load_environment(pasteconf.global_conf,
166 pasteconf.local_conf)
167
168
169# TODO: rename to get_config()
170def conf():
171 from pylons import config
172 conf = config
173 return conf
174
175def get_config():
176 return conf()
177