| 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 | 2. Setup Package | 58 | 2. Setup Package |
|---|
| 59 | ================ | 59 | ================ |
|---|
| 60 | | 60 | |
|---|
| 61 | Make a config file as follows:: | 61 | Make a config file as follows:: |
|---|
| 62 | | 62 | |
|---|
| 63 | paster make-config shakespeare config.ini | 63 | paster make-config shakespeare config.ini |
|---|
| 64 | | 64 | |
|---|
| 65 | Tweak the config file as appropriate and then setup the application:: | 65 | Tweak the config file as appropriate and then setup the application:: |
|---|
| 66 | | 66 | |
|---|
| 67 | paster setup-app config.ini | 67 | paster setup-app config.ini |
|---|
| 68 | | 68 | |
|---|
| 69 | | 69 | |
|---|
| 70 | 3. Initialize the system | 70 | 3. Initialize the system |
|---|
| 71 | ======================== | 71 | ======================== |
|---|
| 72 | | 72 | |
|---|
| 73 | Run:: | 73 | Run:: |
|---|
| 74 | | 74 | |
|---|
| 75 | $ shakespeare-admin db create | 75 | $ shakespeare-admin db create |
|---|
| 76 | $ shakespeare-admin db init | 76 | $ shakespeare-admin db init |
|---|
| 77 | | 77 | |
|---|
| 78 | If you want to build the concordance do:: | 78 | If you want to build the concordance do:: |
|---|
| 79 | | 79 | |
|---|
| 80 | $ shakespeare-admin concordance | 80 | $ shakespeare-admin concordance |
|---|
| 81 | | 81 | |
|---|
| 82 | NB: This may take some time to run so be patient. TIP: using sqlite building | 82 | NB: This may take some time to run so be patient. TIP: using sqlite building |
|---|
| 83 | the concordance really **does** seem to run forever so recommend using | 83 | the concordance really **does** seem to run forever so recommend using |
|---|
| 84 | postgresql or mysql if you are going to build the concordance. | 84 | postgresql or mysql if you are going to build the concordance. |
|---|
| 85 | | 85 | |
|---|
| 86 | | 86 | |
|---|
| 87 | Getting Started | 87 | Getting Started |
|---|
| 88 | *************** | 88 | *************** |
|---|
| 89 | | 89 | |
|---|
| 90 | As a user: | 90 | As a user: |
|---|
| 91 | ========== | 91 | ========== |
|---|
| 92 | | 92 | |
|---|
| 93 | Start up the web interface by running the webserver:: | 93 | Start up the web interface by running the webserver:: |
|---|
| 94 | | 94 | |
|---|
| 95 | $ paster serve {your-config.ini} | 95 | $ paster serve {your-config.ini} |
|---|
| 96 | | 96 | |
|---|
| 97 | NB: {your-config.ini} should be replaced with the name of the config file you | 97 | NB: {your-config.ini} should be replaced with the name of the config file you |
|---|
| 98 | created earlier. | 98 | created earlier. |
|---|
| 99 | | 99 | |
|---|
| 100 | | 100 | |
|---|
| 101 | As a developer: | 101 | As a developer: |
|---|
| 102 | =============== | 102 | =============== |
|---|
| 103 | | 103 | |
|---|
| 104 | 0. Copy development.ini.tmpl to development.ini and edit to your taste. | 104 | 0. Copy development.ini.tmpl to development.ini and edit to your taste. |
|---|
| 105 | | 105 | |
|---|
| 106 | 1. Check out the administrative commands: $ bin/shakespeare-admin help. | 106 | 1. Check out the administrative commands: $ bin/shakespeare-admin help. |
|---|
| 107 | | 107 | |
|---|
| 108 | 2. Run the tests using either py.test of nosetests:: | 108 | 2. Run the tests using either py.test of nosetests:: |
|---|
| 109 | | 109 | |
|---|
| 110 | $ nosetests shakespeare | 110 | $ nosetests shakespeare |
|---|
| 111 | ''' | 111 | ''' |
|---|
| 113 | __application_name__ = 'shakespeare' | 113 | __application_name__ = 'shakespeare' |
|---|
| 114 | | 114 | |
|---|
| 115 | def conf(): | 115 | def conf(): |
|---|
| 116 | import os | 116 | import os |
|---|
| 117 | defaultPath = os.path.abspath('./development.ini') | 117 | defaultPath = os.path.abspath('./development.ini') |
|---|
| 118 | envVarName = __application_name__.upper() + 'CONF' | 118 | envVarName = __application_name__.upper() + 'CONF' |
|---|
| 119 | confPath = os.environ.get(envVarName, defaultPath) | 119 | confPath = os.environ.get(envVarName, defaultPath) |
|---|
| 120 | if not os.path.exists(confPath): | 120 | if not os.path.exists(confPath): |
|---|
| 121 | raise ValueError('No Configuration file exists at: %s' % confPath) | 121 | raise ValueError('No Configuration file exists at: %s' % confPath) |
|---|
| 122 | | 122 | |
|---|
| 123 | # register the config | 123 | # register the config |
|---|
| 124 | import paste.deploy | 124 | import paste.deploy |
|---|
| 125 | import shakespeare.config.environment | 125 | import shakespeare.config.environment |
|---|
| 126 | pasteconf = paste.deploy.appconfig('config:' + confPath) | 126 | pasteconf = paste.deploy.appconfig('config:' + confPath) |
|---|
| 127 | | 127 | |
|---|
| 128 | shakespeare.config.environment.load_environment(pasteconf.global_conf, | 128 | shakespeare.config.environment.load_environment(pasteconf.global_conf, |
|---|
| 129 | pasteconf.local_conf) | 129 | pasteconf.local_conf) |
|---|
| 130 | from pylons import config | 130 | from pylons import config |
|---|
| 131 | conf = config | 131 | conf = config |
|---|
| 132 | | 132 | |
|---|
| 133 | # import ConfigParser | 133 | # import ConfigParser |
|---|
| 134 | # conf = ConfigParser.SafeConfigParser() | 134 | # conf = ConfigParser.SafeConfigParser() |
|---|
| 135 | # conf.read(confPath) | 135 | # conf.read(confPath) |
|---|
| 136 | | 136 | |
|---|
| 137 | return conf | 137 | return conf |
|---|
| 138 | | 138 | |
|---|