Skip to content
Thibault Clérice edited this page Jun 23, 2017 · 5 revisions

Welcome to the leipzig_cts wiki!

Force Refresh of corpora

Login to cts.dh.uni-leipzig.de

# We need to cut the server just in case
/etc/init.d/gunicorn stop
# We go to the capitains APP server
cd /local/www-data/capitains-app
# We flush the database
sudo venvs/bin/python manager.py flush_both
# We parse the inventory
sudo venvs/bin/python manager.py parse
# We can parse the references as well, to speed up the first accesses
sudo venvs/bin/python manager.py process_reffs
# We make sure REDIS saved everything
sudo redis-cli SAVE
# We restart the server
sudo /etc/init.d/gunicorn restart

Update the UI

Add a corpus

  1. Go to https://github.com/OpenGreekAndLatin/leipzig_cts/blob/master/data/common.yaml
  2. In this file, find
capitains::repos: 
  - name: 'canonical-latinLit'
  cibase: 'PerseusDL/canonical-latinLit'
  1. Add a new line with the following scheme (repositoryName and repositoryOwner refer to github infos)
capitains::repos: 
  - name: 'repositoryName'
  cibase: 'repositoryOwner/repositoryName'
  1. If this new corpus includes a new namespace, see New namespace

New CTS Namespace

  1. Open https://github.com/OpenGreekAndLatin/leipzig_cts/blob/master/modules/capitains/templates/app.py.erb . This file is a python script that will be completed for some variable by puppet with Ruby.

If your namespace fits an existing collection

  1. Find the dispatcher function that has the decorator for your collection. If you are dealing with latin litterature, this would be @dispatcher.inventory("urn:perseus:latinLit")
@dispatcher.inventory("urn:perseus:latinLit")
def dispatchLatinLit(collection, path=None, **kwargs):
    if collection.id.startswith("urn:cts:latinLit:"):
        return True
    return False
  1. Simply had a statement that will return True. The collection object is a MyCapytain collection object

If your namespace needs a new collection

  1. Create a new Prototype text inventory following by adding this line at the top of the file but after
tic = TextInventoryCollection()

following the example

fro = PrototypeTextInventory("urn:perseus:froLit", parent=tic)
fro.set_label("Ancient French", "eng")
fro.set_label("Ancien Francais", "fre")
  1. Create a new Dispatcher filter sending to this PrototypeTextInventory
@dispatcher.inventory("urn:perseus:froLit")
def dispatchFroLit(collection, path=None, **kwargs):
    if collection.id.startswith("urn:cts:froLit:"):
        return True
    return False

Upgrade Packages

cd /local/www-data/capitains-app
# Example : MyCapytain
sudo venvs/bin/pip install --upgrade MyCapytain
#Restart the server
sudo /etc/init.d/gunicorn restart