Esempio n. 1
0
def setup():
    models.register_models()
    
    client.register_thing_class('/type/edition', Edition)
    client.register_thing_class('/type/author', Author)
    client.register_thing_class('/type/work', Work)

    client.register_thing_class('/type/subject', Subject)
    client.register_thing_class('/type/place', SubjectPlace)
    client.register_thing_class('/type/person', SubjectPerson)
    client.register_thing_class('/type/user', User)

    client.register_changeset_class(None, Changeset) # set the default class
    client.register_changeset_class('merge-authors', MergeAuthors)
    client.register_changeset_class('undo', Undo)

    client.register_changeset_class('add-book', AddBookChangeset)
Esempio n. 2
0
def setup():
    models.register_models()

    client.register_thing_class("/type/edition", Edition)
    client.register_thing_class("/type/author", Author)
    client.register_thing_class("/type/work", Work)

    client.register_thing_class("/type/subject", Subject)
    client.register_thing_class("/type/place", SubjectPlace)
    client.register_thing_class("/type/person", SubjectPerson)
    client.register_thing_class("/type/user", User)

    client.register_changeset_class(None, Changeset)  # set the default class
    client.register_changeset_class("merge-authors", MergeAuthors)
    client.register_changeset_class("undo", Undo)

    client.register_changeset_class("add-book", AddBookChangeset)
    client.register_changeset_class("lists", ListChangeset)
    client.register_changeset_class("new-account", NewAccountChangeset)
Esempio n. 3
0
# setup special connection with caching support
import connection
client._connection_types['ol'] = connection.OLConnection
infogami.config.infobase_parameters = dict(type="ol")

# set up infobase schema. required when running in standalone mode.
from openlibrary.core import schema
schema.register_schema()

if infogami.config.get('infobase_server') is None:
    # setup infobase hooks for OL
    from openlibrary.plugins import ol_infobase
    ol_infobase.init_plugin()

from openlibrary.core import models
models.register_models()
models.register_types()


# this adds /show-marc/xxx page to infogami
import showmarc

# Remove movefiles install hook. openlibrary manages its own files.
infogami._install_hooks = [h for h in infogami._install_hooks if h.__name__ != "movefiles"]

import lists
lists.setup()

class hooks(client.hook):
    def before_new_version(self, page):
        if page.key.startswith('/a/') or page.key.startswith('/authors/'):
Esempio n. 4
0
 def test_owner(self):
     models.register_models()
     self._test_list_owner("/people/anand")
     self._test_list_owner("/people/anand-test")
     self._test_list_owner("/people/anand_test")
Esempio n. 5
0
infogami.config.http_ext_header_uri = "http://openlibrary.org/dev/docs/api"

# setup special connection with caching support
from openlibrary.plugins.openlibrary import connection

client._connection_types['ol'] = connection.OLConnection
infogami.config.infobase_parameters = dict(type="ol")

# set up infobase schema. required when running in standalone mode.
from openlibrary.core import schema

schema.register_schema()

from openlibrary.core import models

models.register_models()
models.register_types()

# Remove movefiles install hook. openlibrary manages its own files.
infogami._install_hooks = [
    h for h in infogami._install_hooks if h.__name__ != "movefiles"
]

from openlibrary.plugins.openlibrary import lists

lists.setup()

logger = logging.getLogger("openlibrary")


class hooks(client.hook):
Esempio n. 6
0
 def test_owner(self):
     models.register_models()
     self._test_list_owner("/people/anand")
     self._test_list_owner("/people/anand-test")
     self._test_list_owner("/people/anand_test")