Changeset 148
- Timestamp:
- 04/26/08 14:05:08 (7 months ago)
- Files:
-
- trunk/MANIFEST.in (added)
- trunk/README.txt (modified) (1 diff)
- trunk/development.ini (added)
- trunk/docs (added)
- trunk/docs/index.txt (added)
- trunk/setup.cfg (added)
- trunk/setup.py (modified) (1 diff)
- trunk/shakespeare.egg-info (added)
- trunk/shakespeare.egg-info/paste_deploy_config.ini_tmpl (added)
- trunk/shakespeare.egg-info/paster_plugins.txt (added)
- trunk/shakespeare/__init__.py (modified) (1 diff)
- trunk/shakespeare/config (added)
- trunk/shakespeare/config/__init__.py (added)
- trunk/shakespeare/config/environment.py (added)
- trunk/shakespeare/config/middleware.py (added)
- trunk/shakespeare/config/routing.py (added)
- trunk/shakespeare/controllers (added)
- trunk/shakespeare/controllers/__init__.py (added)
- trunk/shakespeare/controllers/error.py (added)
- trunk/shakespeare/controllers/template.py (added)
- trunk/shakespeare/lib (added)
- trunk/shakespeare/lib/__init__.py (added)
- trunk/shakespeare/lib/app_globals.py (added)
- trunk/shakespeare/lib/base.py (added)
- trunk/shakespeare/lib/helpers.py (added)
- trunk/shakespeare/model (added)
- trunk/shakespeare/model/__init__.py (added)
- trunk/shakespeare/public (added)
- trunk/shakespeare/templates (added)
- trunk/shakespeare/tests (added)
- trunk/shakespeare/tests/__init__.py (added)
- trunk/shakespeare/tests/functional (added)
- trunk/shakespeare/tests/functional/__init__.py (added)
- trunk/shakespeare/tests/test_models.py (added)
- trunk/shakespeare/websetup.py (added)
- trunk/test.ini (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/README.txt
Revision 115 Revision 148 1 Introduction 1 Introduction 2 ************ 2 ************ 3 3 4 The Open Shakespeare package provides a full open set of shakespeare's works 4 The Open Shakespeare package provides a full open set of shakespeare's works 5 (often in multiple versions) along with ancillary material, a variety of tools 5 (often in multiple versions) along with ancillary material, a variety of tools 6 and a python API. 6 and a python API. 7 7 8 Specifically in addition to the works themselves (often in multiple versions) 8 Specifically in addition to the works themselves (often in multiple versions) 9 there is an introduction, a chronology, explanatory notes, a concordance and 9 there is an introduction, a chronology, explanatory notes, a concordance and 10 search facilities. 10 search facilities. 11 11 12 All material is open source/open knowledge so that anyone can use, redistribute 12 All material is open source/open knowledge so that anyone can use, redistribute 13 and reuse these materials freely. For exact details of the license under which 13 and reuse these materials freely. For exact details of the license under which 14 this package is made available please see COPYING.txt. 14 this package is made available please see COPYING.txt. 15 15 16 Open Shakespeare has been developed under the aegis of the Open Knowledge 16 Open Shakespeare has been developed under the aegis of the Open Knowledge 17 Foundation (http://www.okfn.org/). 17 Foundation (http://www.okfn.org/). 18 18 19 Contact the Project 19 Contact the Project 20 ******************* 20 ******************* 21 21 22 Please mail info@okfn.org or join the okfn-discuss mailing list: 22 Please mail info@okfn.org or join the okfn-discuss mailing list: 23 23 24 http://lists.okfn.org/listinfo/okfn-discuss 24 http://lists.okfn.org/listinfo/okfn-discuss 25 25 26 26 27 Installation 27 Installation and Setup 28 ************ 28 ********************** 29 29 30 1. Install the code 30 1. Install the code 31 =================== 31 =================== 32 32 33 1.1: (EITHER) Install using setup.py (preferred) 33 1.1: (EITHER) Install using setup.py (preferred) 34 ------------------------------------------------ 34 ------------------------------------------------ 35 35 36 1. Install setuptools:36 Install ``shakespeare`` using easy_install:: 37 37 38 <http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions>38 easy_install shakespeare 39 39 40 (Just download http://peak.telecommunity.com/dist/ez_setup.py and run it). 40 NB: If you don't have easy_install you can get from here: 41 41 42 2. Then do: 42 <http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions> 43 43 44 $ python setup.py install 44 Make a config file as follows:: 45 46 paster make-config shakespeare config.ini 47 48 Tweak the config file as appropriate and then setup the application:: 49 50 paster setup-app config.ini 45 51 46 1.2 (OR) Get the code straight from subversion 52 1.2 (OR) Get the code straight from subversion 47 ------------------------------------------------ 53 ------------------------------------------------ 48 54 49 1. Check out the subversion trunk 55 1. Check out the subversion trunk:: 50 2. Add the path/to/src to your PYTHONPATH 56 51 3. Make sure you have all required dependencies (see install_requires in 57 svn co https://knowledgeforge.net/shakespeare/svn/trunk 52 setup.py) 58 59 2. Do:: 60 61 sudo python setup.py develop 62 53 63 54 2. Cache Directory 64 2. Cache Directory 55 ================== 65 ================== 56 66 57 Create a cache directory where texts and other material can be stored 67 Create a cache directory where texts and other material can be stored 58 68 59 This directory needs to be semi-permanent so do *not* put under a location such 69 This directory needs to be semi-permanent so do *not* put under a location such 60 as /tmp. 70 as /tmp. 61 71 62 4. Create a configuration file 72 73 3. Create a configuration file 63 ============================== 74 ============================== 64 75 65 1. copy the template at etc/shakespeare.conf.new to a suitable new location 76 1. copy the template at etc/shakespeare.conf.new to a suitable new location 66 (suggestion: etc/shakespeare.conf) 77 (suggestion: etc/shakespeare.conf) 67 78 68 2. edit to reflect your setup (see comments in file) 79 2. edit to reflect your setup (see comments in file) 69 80 70 3. make sure the config file can be found: 81 3. make sure the config file can be found: 71 1. EITHER: it must be located at etc/shakespeare.conf relative to the 82 1. EITHER: it must be located at etc/shakespeare.conf relative to the 72 directory from which you run scripts 83 directory from which you run scripts 73 84 74 2. OR: set the SHAKESPEARECONF environment variable to contain the path to 85 2. OR: set the SHAKESPEARECONF environment variable to contain the path to 75 the configuration file 86 the configuration file 76 87 77 4. Initialize the system 88 89 5. Initialize the system 78 ======================== 90 ======================== 79 91 80 Run: $ bin/shakespeare-admin init 92 Run: $ bin/shakespeare-admin init 81 93 82 This may take some time to run so be patient 94 This may take some time to run so be patient 83 95 84 TIP: using sqlite building the concordance really **does** seem to run forever 96 TIP: using sqlite building the concordance really **does** seem to run forever 85 so recommend using postgresql or mysql if you are going to build the 97 so recommend using postgresql or mysql if you are going to build the 86 concordance. 98 concordance. 87 99 88 100 89 Getting Started 101 Getting Started 90 *************** 102 *************** 91 103 92 As a user: 104 As a user: 93 ========== 105 ========== 94 106 95 Start up the web interface by running the webserver: 107 Start up the web interface by running the webserver: 96 108 97 $ bin/shakespeare-admin runserver 109 $ bin/shakespeare-admin runserver 98 110 99 Then visit http://localhost:8080/ using your favourite web browser. 111 Then visit http://localhost:8080/ using your favourite web browser. 100 112 101 As a developer: 113 As a developer: 102 =============== 114 =============== 103 115 104 1. Check out the administrative commands: $ bin/shakespeare-admin help. 116 1. Check out the administrative commands: $ bin/shakespeare-admin help. 105 117 106 2. Run the tests: $ py.test 118 2. Run the tests: $ py.test 107 119 108 Note that: 120 Note that: 109 121 110 * The tests use [py.test] so you will need to have installed this 122 * The tests use [py.test] so you will need to have installed this 111 123 112 * To run the website tests (site_test etc) you will need to install [twill] 124 * To run the website tests (site_test etc) you will need to install [twill] 113 and have the webserver running 125 and have the webserver running 114 126 115 [py.test]: http://codespeak.net/py/current/doc/getting-started.html 127 [py.test]: http://codespeak.net/py/current/doc/getting-started.html 116 [twill]: http://twill.idyll.org/ 128 [twill]: http://twill.idyll.org/ 117 129 trunk/setup.py
Revision 146 Revision 148 1 from setuptools import setup, find_packages 1 try: 2 from setuptools import setup, find_packages 3 except ImportError: 4 from ez_setup import use_setuptools 5 use_setuptools() 6 from setuptools import setup, find_packages 2 7 3 import sys 8 import sys 4 sys.path.insert(0, '. /src')9 sys.path.insert(0, '.') 5 from shakespeare import __version__, __application_name__ 10 from shakespeare import __version__, __application_name__ 6 11 7 setup( 12 setup( 8 name = __application_name__, 13 name = __application_name__, 9 version = __version__, 14 version = __version__, 10 packages = find_packages(),15 packages=find_packages(exclude=['ez_setup']), 11 scripts = ['bin/shakespeare-admin'], 16 scripts = ['bin/shakespeare-admin'], 12 include_package_data =True,17 include_package_data=True, 13 18 14 install_requires = ['SQLObject>=0.6', 19 install_requires=[ 15 'Paste>=0.1', 'Genshi>=0.3', 'annotater>=0.1', 20 'Pylons>=0.9.6.1', 21 'SQLObject>=0.6', 22 'Genshi>=0.3', 23 'annotater>=0.1', 16 ], 24 ], 25 test_suite='nose.collector', 26 package_data={'shakespeare': ['i18n/*/LC_MESSAGES/*.mo']}, 27 #message_extractors = {'shakespeare': [ 28 # ('**.py', 'python', None), 29 # ('public/**', 'ignore', None)]}, 30 entry_points=''' 31 [paste.app_factory] 32 main = shakespeare.config.middleware:make_app 33 34 [paste.app_install] 35 main = pylons.util:PylonsInstaller 36 ''', 17 37 18 # metadata for upload to PyPI 38 # metadata for upload to PyPI 19 author = "Rufus Pollock (Open Knowledge Foundation)", 39 author = "Rufus Pollock (Open Knowledge Foundation)", 20 author_email = "rufus.pollock@okfn.org", 40 author_email = "rufus.pollock@okfn.org", 21 description = \ 41 description = \ 22 "A full open set of Shakespeare's works along with anciallary material, a variety of tools and a python api", 42 "A full open set of Shakespeare's works along with anciallary material, a variety of tools and a python api", 23 long_description = \ 43 long_description = \ 24 """ 44 """ 25 The Open Shakespeare package provides a full open set of shakespeare's works 45 The Open Shakespeare package provides a full open set of shakespeare's works 26 (often in multiple versions) along with ancillary material, a variety of tools 46 (often in multiple versions) along with ancillary material, a variety of tools 27 and a python API. 47 and a python API. 28 48 29 Specifically in addition to the works themselves (often in multiple versions) 49 Specifically in addition to the works themselves (often in multiple versions) 30 there is an introduction, a chronology, explanatory notes, a concordance and 50 there is an introduction, a chronology, explanatory notes, a concordance and 31 search facilities. 51 search facilities. 32 52 33 All material is open source/open knowledge so that anyone can use, redistribute 53 All material is open source/open knowledge so that anyone can use, redistribute 34 and reuse these materials freely. For exact details of the license under which 54 and reuse these materials freely. For exact details of the license under which 35 this package is made available please see COPYING.txt. 55 this package is made available please see COPYING.txt. 36 56 37 Open Shakespeare has been developed under the aegis of the Open Knowledge 57 Open Shakespeare has been developed under the aegis of the Open Knowledge 38 Foundation (http://www.okfn.org/). 58 Foundation (http://www.okfn.org/). 39 """, 59 """, 40 license = "MIT", 60 license = "MIT", 41 keywords = "open shakespeare search view", 61 keywords = "open shakespeare search view", 42 url = "http://www.openshakespeare.org/", 62 url = "http://www.openshakespeare.org/", 43 download_url = "http://www.openshakespeare.org/code/", 63 download_url = "http://www.openshakespeare.org/code/", 44 classifiers = [ 64 classifiers = [ 45 'Development Status :: 4 - Beta', 65 'Development Status :: 4 - Beta', 46 'Environment :: Console', 66 'Environment :: Console', 47 'Environment :: Web Environment', 67 'Environment :: Web Environment', 48 'Intended Audience :: Developers', 68 'Intended Audience :: Developers', 49 'License :: OSI Approved :: MIT License', 69 'License :: OSI Approved :: MIT License', 50 'Operating System :: OS Independent', 70 'Operating System :: OS Independent', 51 'Programming Language :: Python', 71 'Programming Language :: Python', 52 'Topic :: Software Development :: Libraries :: Python Modules'], 72 'Topic :: Software Development :: Libraries :: Python Modules'], 53 ) 73 ) trunk/shakespeare/__init__.py
Revision 129 Revision 148 1 __version__ = '0.5dev' 1 __version__ = '0.5dev' 2 __application_name__ = 'shakespeare' 2 __application_name__ = 'shakespeare' 3 3 4 def conf(): 4 def conf(): 5 import os 5 import os 6 defaultPath = os.path.abspath('./etc/%s.conf' % __application_name__) 6 defaultPath = os.path.abspath('./etc/%s.conf' % __application_name__) 7 envVarName = __application_name__.upper() + 'CONF' 7 envVarName = __application_name__.upper() + 'CONF' 8 confPath = os.environ.get(envVarName, defaultPath) 8 confPath = os.environ.get(envVarName, defaultPath) 9 if not os.path.exists(confPath): 9 if not os.path.exists(confPath): 10 raise ValueError('No Configuration file exists at: %s' % confPath) 10 raise ValueError('No Configuration file exists at: %s' % confPath) 11 import ConfigParser 11 import ConfigParser 12 conf = ConfigParser.SafeConfigParser() 12 conf = ConfigParser.SafeConfigParser() 13 conf.read(confPath) 13 conf.read(confPath) 14 return conf 14 return conf 15 15 16
