| 1 | ''' | 1 | ''' |
|---|
| 2 | Introduction | 2 | Introduction |
|---|
| 3 | ************ | 3 | ************ |
|---|
| 4 | | 4 | |
|---|
| 5 | The Open Shakespeare package provides a full open set of shakespeare's works | 5 | The 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 | 6 | (often in multiple versions) along with ancillary material, a variety of tools |
|---|
| 7 | and a python API. | 7 | and a python API. |
|---|
| 8 | | 8 | |
|---|
| 9 | Specifically in addition to the works themselves (often in multiple versions) | 9 | Specifically in addition to the works themselves (often in multiple versions) |
|---|
| 10 | there is an introduction, a chronology, explanatory notes, a concordance and | 10 | there is an introduction, a chronology, explanatory notes, a concordance and |
|---|
| 11 | search facilities. | 11 | search facilities. |
|---|
| 12 | | 12 | |
|---|
| 13 | All material is open source/open knowledge so that anyone can use, redistribute | 13 | All material is open source/open knowledge so that anyone can use, redistribute |
|---|
| 14 | and reuse these materials freely. For exact details of the license under which | 14 | and reuse these materials freely. For exact details of the license under which |
|---|
| 15 | this package is made available please see COPYING.txt. | 15 | this package is made available please see COPYING.txt. |
|---|
| 16 | | 16 | |
|---|
| 17 | Open Shakespeare has been developed under the aegis of the Open Knowledge | 17 | Open Shakespeare has been developed under the aegis of the Open Knowledge |
|---|
| 18 | Foundation (http://www.okfn.org/). | 18 | Foundation (http://www.okfn.org/). |
|---|
| 19 | | 19 | |
|---|
| 20 | Contact the Project | 20 | Contact the Project |
|---|
| 21 | ******************* | 21 | ******************* |
|---|
| 22 | | 22 | |
|---|
| 23 | Please mail info@okfn.org or join the okfn-discuss mailing list: | 23 | Please mail info@okfn.org or join the okfn-discuss mailing list: |
|---|
| 24 | | 24 | |
|---|
| 25 | http://lists.okfn.org/listinfo/okfn-discuss | 25 | http://lists.okfn.org/listinfo/okfn-discuss |
|---|
| 26 | | 26 | |
|---|
| 27 | | 27 | |
|---|
| 28 | Installation and Setup | 28 | Installation and Setup |
|---|
| 29 | ********************** | 29 | ********************** |
|---|
| 30 | | 30 | |
|---|
| 31 | 1. Install the code | 31 | 1. Install the code |
|---|
| 32 | =================== | 32 | =================== |
|---|
| 33 | | 33 | |
|---|
| 34 | 1.1: (EITHER) Install using setup.py (preferred) | 34 | 1.1: (EITHER) Install using setup.py (preferred) |
|---|
| 35 | ------------------------------------------------ | 35 | ------------------------------------------------ |
|---|
| 36 | | 36 | |
|---|
| 37 | Install ``shakespeare`` using easy_install:: | 37 | Install ``shakespeare`` using easy_install:: |
|---|
| 38 | | 38 | |
|---|
| 39 | easy_install shakespeare | 39 | easy_install shakespeare |
|---|
| 40 | | 40 | |
|---|
| 41 | NB: If you don't have easy_install you can get from here: | 41 | NB: If you don't have easy_install you can get from here: |
|---|
| 42 | | 42 | |
|---|
| 43 | <http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions> | 43 | <http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions> |
|---|
| 44 | | 44 | |
|---|
| 45 | | 45 | |
|---|
| 46 | 1.2 (OR) Get the code straight from subversion | 46 | 1.2 (OR) Get the code straight from subversion |
|---|
| 47 | ------------------------------------------------ | 47 | ------------------------------------------------ |
|---|
| 48 | | 48 | |
|---|
| 49 | 1. Check out the subversion trunk:: | 49 | 1. Check out the subversion trunk:: |
|---|
| 50 | | 50 | |
|---|
| 51 | svn co https://knowledgeforge.net/shakespeare/svn/trunk | 51 | svn co https://knowledgeforge.net/shakespeare/svn/trunk |
|---|
| 52 | | 52 | |
|---|
| 53 | 2. Do:: | 53 | 2. Do:: |
|---|
| 54 | | 54 | |
|---|
| 55 | sudo python setup.py develop | 55 | sudo python setup.py develop |
|---|
| 56 | | 56 | |
|---|
| 57 | | 57 | |
|---|
| 58 | Getting Started | 58 | Getting Started |
|---|
| 59 | *************** | 59 | *************** |
|---|
| 60 | | 60 | |
|---|
| 61 | As a user: | 61 | As a user: |
|---|
| 62 | ========== | 62 | ========== |
|---|
| 63 | | 63 | |
|---|
| 64 | 1. Basic setup | 64 | 1. Basic setup |
|---|
| 65 | -------------- | 65 | -------------- |
|---|
| 66 | | 66 | |
|---|
| 67 | To access most of the main features of Open Shakespeare you need a database. | 67 | To access most of the main features of Open Shakespeare you need a database. |
|---|
| 68 | For this an other bits and bobs of configuration you will need a configuration | 68 | For this an other bits and bobs of configuration you will need a configuration |
|---|
| 69 | file. | 69 | file. |
|---|
| 70 | | 70 | |
|---|
| 71 | You can make a config file as follows:: | 71 | You can make a config file as follows:: |
|---|
| 72 | | 72 | |
|---|
| 73 | paster make-config shakespeare {your-config.ini} | 73 | paster make-config shakespeare {your-config.ini} |
|---|
| 74 | | 74 | |
|---|
| 75 | Tweak the config file as appropriate and then setup the application:: | 75 | Tweak the config file as appropriate and then setup the application:: |
|---|
| 76 | | 76 | |
|---|
| 77 | paster setup-app config.ini | 77 | paster setup-app config.ini |
|---|
| 78 | | 78 | |
|---|
| 79 | [TODO: this should be part of setup-app] | 79 | [TODO: this should be part of setup-app] |
|---|
| 80 | | 80 | |
|---|
| 81 | Run:: | 81 | Run:: |
|---|
| 82 | | 82 | |
|---|
| 83 | $ shakespeare-admin db create | 83 | $ shakespeare-admin db create |
|---|
| 84 | $ shakespeare-admin db init | 84 | $ shakespeare-admin db init |
|---|
| 85 | | 85 | |
|---|
| 86 | 2. Extras | 86 | 2. Extras |
|---|
| 87 | --------- | 87 | --------- |
|---|
| 88 | | 88 | |
|---|
| 89 | 1. Search index. [TODO] | 89 | 1. Search index. [TODO] |
|---|
| 90 | | 90 | |
|---|
| 91 | 2. You can start a web server to provide a easy-to-use web interface to the | 91 | 2. You can start a web server to provide a easy-to-use web interface to the |
|---|
| 92 | shakespeare material and facilities by doing:: | 92 | shakespeare material and facilities by doing:: |
|---|
| 93 | | 93 | |
|---|
| 94 | $ paster serve {your-config.ini} | 94 | $ paster serve {your-config.ini} |
|---|
| 95 | | 95 | |
|---|
| 96 | NB: {your-config.ini} should be replaced with the name of the config file you | 96 | NB: {your-config.ini} should be replaced with the name of the config file you |
|---|
| 97 | created earlier. | 97 | created earlier. |
|---|
| 98 | | 98 | |
|---|
| 99 | | 99 | |
|---|
| 100 | As a developer: | 100 | As a developer: |
|---|
| 101 | =============== | 101 | =============== |
|---|
| 102 | | 102 | |
|---|
| 103 | 0. Setup | 103 | 0. Setup |
|---|
| 104 | -------- | 104 | -------- |
|---|
| 105 | | 105 | |
|---|
| 106 | Follow the basic steps above put with an ini file named: development.ini | 106 | Follow the basic steps above put with an ini file named: development.ini |
|---|
| 107 | | 107 | |
|---|
| 108 | NB: you'll probably want to change log levels to debug. | 108 | NB: you'll probably want to change log levels to debug. |
|---|
| 109 | | 109 | |
|---|
| 110 | 1. Check out the administrative commands | 110 | 1. Check out the administrative commands |
|---|
| 111 | ---------------------------------------- | 111 | ---------------------------------------- |
|---|
| 112 | | 112 | |
|---|
| 113 | $ bin/shakespeare-admin help. | 113 | $ bin/shakespeare-admin help. |
|---|
| 114 | | 114 | |
|---|
| 115 | 2. Run the tests using either py.test of nosetests:: | 115 | 2. Run the tests using either py.test of nosetests:: |
|---|
| 116 | ---------------------------------------------------- | 116 | ---------------------------------------------------- |
|---|
| 117 | | 117 | |
|---|
| 118 | $ nosetests shakespeare | 118 | $ nosetests shakespeare |
|---|
| 119 | ''' | 119 | ''' |
|---|
| 121 | __application_name__ = 'shakespeare' | 121 | __application_name__ = 'shakespeare' |
|---|
| 122 | | 122 | |
|---|
| 123 | def conf(): | 123 | def conf(): |
|---|
| 124 | import os | 124 | import os |
|---|
| 125 | defaultPath = os.path.abspath('./development.ini') | 125 | defaultPath = os.path.abspath('./development.ini') |
|---|
| 126 | envVarName = __application_name__.upper() + 'CONF' | 126 | envVarName = __application_name__.upper() + 'CONF' |
|---|
| 127 | confPath = os.environ.get(envVarName, defaultPath) | 127 | confPath = os.environ.get(envVarName, defaultPath) |
|---|
| 128 | if not os.path.exists(confPath): | 128 | if not os.path.exists(confPath): |
|---|
| 129 | raise ValueError('No Configuration file exists at: %s' % confPath) | 129 | raise ValueError('No Configuration file exists at: %s' % confPath) |
|---|
| 130 | | 130 | |
|---|
| 131 | # register the config | 131 | # register the config |
|---|
| 132 | import paste.deploy | 132 | import paste.deploy |
|---|
| 133 | import shakespeare.config.environment | 133 | import shakespeare.config.environment |
|---|
| 134 | pasteconf = paste.deploy.appconfig('config:' + confPath) | 134 | pasteconf = paste.deploy.appconfig('config:' + confPath) |
|---|
| 135 | | 135 | |
|---|
| 136 | shakespeare.config.environment.load_environment(pasteconf.global_conf, | 136 | shakespeare.config.environment.load_environment(pasteconf.global_conf, |
|---|
| 137 | pasteconf.local_conf) | 137 | pasteconf.local_conf) |
|---|
| 138 | from pylons import config | 138 | from pylons import config |
|---|
| 139 | conf = config | 139 | conf = config |
|---|
| 140 | | 140 | |
|---|
| 141 | # import ConfigParser | 141 | # import ConfigParser |
|---|
| 142 | # conf = ConfigParser.SafeConfigParser() | 142 | # conf = ConfigParser.SafeConfigParser() |
|---|
| 143 | # conf.read(confPath) | 143 | # conf.read(confPath) |
|---|
| 144 | | 144 | |
|---|
| 145 | return conf | 145 | return conf |
|---|
| 146 | | 146 | |
|---|