Exemplo n.º 1
0
"""
structure and contents of a default TiddlyWebWiki instance
"""

from tiddlywebplugins.instancer.util import get_tiddler_locations

from tiddlywebplugins.console.instance import (store_contents,
    store_structure as console_store_structure)


instance_config = {
    'system_plugins': ['tiddlywebwiki'],
    'twanager_plugins': ['tiddlywebwiki']
}

store_contents = get_tiddler_locations(store_contents,
    'tiddlywebplugins.console')
store_contents['system'] = [
    'https://github.com/tiddlyweb/tiddlywebwikiclient/raw/master/index.recipe'
]

store_structure = {
    'bags': {
        'system': {
            'desc': 'TiddlyWebWiki client plugins',
            'policy': {
                'read': [],
                'write': ['R:ADMIN'],
                'create': ['R:ADMIN'],
                'delete': ['R:ADMIN'],
                'manage': ['R:ADMIN'],
                'accept': ['R:ADMIN'],
Exemplo n.º 2
0
def init(config):
    """
    Establish required plugins and HTTP routes.
    """
    import tiddlywebwiki
    import tiddlywebplugins.logout
    import tiddlywebplugins.virtualhosting  # calling init not required
    import tiddlywebplugins.magicuser
    import tiddlywebplugins.socialusers
    import tiddlywebplugins.mselect
    import tiddlywebplugins.oom
    import tiddlywebplugins.cookiedomain
    import tiddlywebplugins.tiddlyspace.validator
    import tiddlywebplugins.prettyerror
    import tiddlywebplugins.pathinfohack
    import tiddlywebplugins.hashmaker
    import tiddlywebplugins.form
    import tiddlywebplugins.reflector
    import tiddlywebplugins.privateer
    import tiddlywebplugins.relativetime
    import tiddlywebplugins.jsonp

    # Only load and run dispatcher if we are specifically configured
    # to use it.
    if config.get('use_dispatcher', False):
        import tiddlywebplugins.dispatcher
        import tiddlywebplugins.dispatcher.listener

    @make_command()
    def addmember(args):
        """Add a member to a space: <space name> <user name>"""
        store = get_store(config)
        space_name, username = args
        change_space_member(store, space_name, add=username)
        return True

    @make_command()
    def delmember(args):
        """Delete a member from a space: <space name> <user name>"""
        store = get_store(config)
        space_name, username = args
        change_space_member(store, space_name, remove=username)
        return True

    @make_command()
    def deltiddler(args):
        """Delete a tiddler from a bag: <bag> <title>"""
        from tiddlyweb.model.tiddler import Tiddler
        from tiddlyweb.store import NoTiddlerError
        from tiddlyweb.util import std_error_message
        bag, title = args
        prompt = 'deleting tiddler %s from bag %s - enter "yes" to confirm' % (
            title, bag)
        if raw_input('%s\n' % prompt) == 'yes':
            store = get_store(config)
            tiddler = Tiddler(title, bag)
            try:
                store.delete(tiddler)
            except NoTiddlerError:
                std_error_message('error deleting tiddler %s from bag %s: %s' %
                                  (title, bag, 'no such tiddler'))
            return True
        else:
            std_error_message('aborted')
            return False

    merge_config(config, space_config)

    tiddlywebwiki.init(config)
    tiddlywebplugins.logout.init(config)
    tiddlywebplugins.magicuser.init(config)
    tiddlywebplugins.socialusers.init(config)
    tiddlywebplugins.mselect.init(config)
    tiddlywebplugins.oom.init(config)
    tiddlywebplugins.cookiedomain.init(config)
    tiddlywebplugins.prettyerror.init(config)
    tiddlywebplugins.pathinfohack.init(config)
    tiddlywebplugins.hashmaker.init(config)
    tiddlywebplugins.form.init(config)
    tiddlywebplugins.reflector.init(config)
    tiddlywebplugins.privateer.init(config)
    tiddlywebplugins.jsonp.init(config)

    if config.get('use_dispatcher', False):
        tiddlywebplugins.dispatcher.init(config)
        tiddlywebplugins.dispatcher.listener.init(config)

    # XXX: The following is required to work around issues with twp.instancer.
    # Without this, config settings from tiddlywebwiki take precedence.
    config['serializers']['text/x-tiddlywiki'] = space_config['serializers'][
        'text/x-tiddlywiki']
    # This only fixes 'twanager update', instance creation still does not have
    # the right information, thus requiring a twanager update after instance
    # creation. Presumably the instance script needs to do something similar.
    config['instance_tiddlers'] = get_tiddler_locations(
        store_contents, 'tiddlywebplugins.tiddlyspace')

    # inject lazy serialization information
    config['extension_types'].update({'lwiki': 'text/x-ltiddlywiki'})
    config['serializers'].update({
        'text/x-ltiddlywiki': [
            'tiddlywebplugins.tiddlyspace.betalazyserialization',
            'text/html; charset=UTF-8'
        ]
    })

    if 'selector' in config:  # system plugin
        replace_handler(config['selector'], '/', dict(GET=home))
        config['selector'].add('/_safe', GET=safe_mode, POST=safe_mode)
        add_spaces_routes(config['selector'])
        add_profile_routes(config['selector'])
        config['selector'].add('/{tiddler_name:segment}', GET=friendly_uri)
        config['selector'].add('/users/{username}/identities',
                               GET=get_identities)

        if ControlView not in config['server_request_filters']:
            config['server_request_filters'].insert(
                config['server_request_filters'].index(UserExtract) + 1,
                ControlView)

        if DropPrivs not in config['server_request_filters']:
            config['server_request_filters'].insert(
                config['server_request_filters'].index(ControlView) + 1,
                DropPrivs)

        if CSRFProtector not in config['server_request_filters']:
            config['server_request_filters'].append(CSRFProtector)

        if AllowOrigin not in config['server_response_filters']:
            config['server_response_filters'].insert(
                config['server_response_filters'].index(PrettyHTTPExceptor) +
                1, AllowOrigin)

        new_serializer = [
            'tiddlywebplugins.tiddlyspace.htmlserialization',
            'text/html; charset=UTF-8'
        ]
        config['serializers']['text/html'] = new_serializer
        config['serializers']['default'] = new_serializer
Exemplo n.º 3
0
def init(config):
    """
    Establish required plugins and HTTP routes.
    """
    import tiddlywebwiki
    import tiddlywebplugins.logout
    import tiddlywebplugins.virtualhosting  # calling init not required
    import tiddlywebplugins.magicuser
    import tiddlywebplugins.socialusers
    import tiddlywebplugins.mselect
    import tiddlywebplugins.oom
    import tiddlywebplugins.cookiedomain
    import tiddlywebplugins.tiddlyspace.validator
    import tiddlywebplugins.prettyerror
    import tiddlywebplugins.pathinfohack
    import tiddlywebplugins.hashmaker
    import tiddlywebplugins.form
    import tiddlywebplugins.reflector
    import tiddlywebplugins.privateer
    import tiddlywebplugins.relativetime
    import tiddlywebplugins.jsonp

    # Only load and run dispatcher if we are specifically configured
    # to use it.
    if config.get('use_dispatcher', False):
        import tiddlywebplugins.dispatcher
        import tiddlywebplugins.dispatcher.listener

    establish_commands(config)

    merge_config(config, space_config)

    tiddlywebwiki.init(config)
    tiddlywebplugins.logout.init(config)
    tiddlywebplugins.magicuser.init(config)
    tiddlywebplugins.socialusers.init(config)
    tiddlywebplugins.mselect.init(config)
    tiddlywebplugins.oom.init(config)
    tiddlywebplugins.cookiedomain.init(config)
    tiddlywebplugins.prettyerror.init(config)
    tiddlywebplugins.pathinfohack.init(config)
    tiddlywebplugins.hashmaker.init(config)
    tiddlywebplugins.form.init(config)
    tiddlywebplugins.reflector.init(config)
    tiddlywebplugins.privateer.init(config)
    tiddlywebplugins.jsonp.init(config)

    if config.get('use_dispatcher', False):
        tiddlywebplugins.dispatcher.init(config)
        tiddlywebplugins.dispatcher.listener.init(config)

    # XXX: The following is required to work around issues with twp.instancer.
    # Without this, config settings from tiddlywebwiki take precedence.
    config['serializers']['text/x-tiddlywiki'] = space_config[
            'serializers']['text/x-tiddlywiki']
    # This only fixes 'twanager update', instance creation still does not have
    # the right information, thus requiring a twanager update after instance
    # creation. Presumably the instance script needs to do something similar.
    config['instance_tiddlers'] = get_tiddler_locations(store_contents,
            'tiddlywebplugins.tiddlyspace')

    # inject lazy serialization information
    config['extension_types'].update({'lwiki': 'text/x-ltiddlywiki'})
    config['serializers'].update({'text/x-ltiddlywiki':
        ['tiddlywebplugins.tiddlyspace.betalazyserialization',
            'text/html; charset=UTF-8']})

    if 'selector' in config:  # system plugin
        establish_www(config)

    # update html serialization
    new_serializer = ['tiddlywebplugins.tiddlyspace.htmlserialization',
            'text/html; charset=UTF-8']
    config['serializers']['text/html'] = new_serializer
    config['serializers']['default'] = new_serializer
Exemplo n.º 4
0
from copy import deepcopy

from tiddlywebplugins.instancer.util import get_tiddler_locations

from tiddlywebwiki.instance import (instance_config, store_contents,
                                    store_structure)

from tiddlywebplugins.prettyerror.instance import (store_contents as
                                                   prettyerror_store_contents,
                                                   store_structure as
                                                   prettyerror_store_structure)

from tiddlywebplugins.tiddlyspace.space import Space

store_contents.update(
    get_tiddler_locations(prettyerror_store_contents,
                          'tiddlywebplugins.prettyerror'))
store_structure['bags'].update(prettyerror_store_structure['bags'])
store_structure['recipes'].update(prettyerror_store_structure['recipes'])
store_contents['_errors'] = ['src/errors/index.recipe']

instance_config['system_plugins'] = ['tiddlywebplugins.tiddlyspace']
instance_config['twanager_plugins'] = ['tiddlywebplugins.tiddlyspace']

store_contents['common'] = ['src/common.recipe']
store_contents['tiddlyspace'] = ['src/tiddlyspace.recipe']
store_contents['system-info_public'] = ['src/system-info/index.recipe']
store_contents['system-plugins_public'] = ['src/system-plugins/index.recipe']
store_contents['system-theme_public'] = ['src/system-theme/index.recipe']
store_contents['system-images_public'] = ['src/system-images/index.recipe']
store_contents['frontpage_public'] = ['src/frontpage/index.recipe']
Exemplo n.º 5
0
from tiddlywebplugins.instancer.util import get_tiddler_locations

from tiddlywebplugins.tiddlyspace.instance import store_contents


PACKAGE_NAME = 'tiddlywebplugins.tiddlyspace'


config = {
    'instance_tiddlers': get_tiddler_locations(store_contents, PACKAGE_NAME),
}
Exemplo n.º 6
0
from copy import deepcopy

from tiddlywebplugins.instancer.util import get_tiddler_locations

from tiddlywebwiki.instance import (instance_config, store_contents,
    store_structure)

from tiddlywebplugins.prettyerror.instance import (
         store_contents as prettyerror_store_contents,
         store_structure as prettyerror_store_structure)

from tiddlywebplugins.tiddlyspace.space import Space


store_contents.update(get_tiddler_locations(
    prettyerror_store_contents, 'tiddlywebplugins.prettyerror'))
store_structure['bags'].update(prettyerror_store_structure['bags'])
store_structure['recipes'].update(prettyerror_store_structure['recipes'])
store_contents['_errors'] = ['src/errors/index.recipe']

instance_config['system_plugins'] = ['tiddlywebplugins.tiddlyspace']
instance_config['twanager_plugins'] = ['tiddlywebplugins.tiddlyspace']

store_contents['common'] = ['src/common.recipe']
store_contents['tiddlyspace'] = ['src/tiddlyspace.recipe']
store_contents['system-info_public'] = ['src/system-info/index.recipe']
store_contents['system-plugins_public'] = ['src/system-plugins/index.recipe']
store_contents['system-theme_public'] = ['src/system-theme/index.recipe']
store_contents['system-images_public'] = ['src/system-images/index.recipe']
store_contents['frontpage_public'] = ['src/frontpage/index.recipe']
Exemplo n.º 7
0
def init(config):
    """
    Establish required plugins and HTTP routes.
    """
    import tiddlywebwiki
    import tiddlywebplugins.logout
    import tiddlywebplugins.virtualhosting  # calling init not required
    import tiddlywebplugins.magicuser
    import tiddlywebplugins.socialusers
    import tiddlywebplugins.mselect
    import tiddlywebplugins.oom
    import tiddlywebplugins.cookiedomain
    import tiddlywebplugins.tiddlyspace.validator
    import tiddlywebplugins.prettyerror
    import tiddlywebplugins.pathinfohack
    import tiddlywebplugins.hashmaker
    import tiddlywebplugins.form
    import tiddlywebplugins.reflector
    import tiddlywebplugins.lazy
    import tiddlywebplugins.privateer
    import tiddlywebplugins.relativetime
    import tiddlywebplugins.jsonp

    @make_command()
    def addmember(args):
        """Add a member to a space: <space name> <user name>"""
        store = get_store(config)
        space_name, username = args
        change_space_member(store, space_name, add=username)
        return True

    @make_command()
    def delmember(args):
        """Delete a member from a space: <space name> <user name>"""
        store = get_store(config)
        space_name, username = args
        change_space_member(store, space_name, remove=username)
        return True

    @make_command()
    def deltiddler(args):
        """Delete a tiddler from a bag: <bag> <title>"""
        from tiddlyweb.model.tiddler import Tiddler
        from tiddlyweb.store import NoTiddlerError
        from tiddlyweb.util import std_error_message
        bag, title = args
        prompt = 'deleting tiddler %s from bag %s - enter "yes" to confirm' % (
                title, bag)
        if raw_input('%s\n' % prompt) == 'yes':
            store = get_store(config)
            tiddler = Tiddler(title, bag)
            try:
                store.delete(tiddler)
            except NoTiddlerError:
                std_error_message(
                        'error deleting tiddler %s from bag %s: %s' % (
                            title, bag, 'no such tiddler'))
            return True
        else:
            std_error_message('aborted')
            return False

    merge_config(config, space_config)

    tiddlywebwiki.init(config)
    tiddlywebplugins.logout.init(config)
    tiddlywebplugins.magicuser.init(config)
    tiddlywebplugins.socialusers.init(config)
    tiddlywebplugins.mselect.init(config)
    tiddlywebplugins.oom.init(config)
    tiddlywebplugins.cookiedomain.init(config)
    tiddlywebplugins.prettyerror.init(config)
    tiddlywebplugins.pathinfohack.init(config)
    tiddlywebplugins.hashmaker.init(config)
    tiddlywebplugins.form.init(config)
    tiddlywebplugins.reflector.init(config)
    tiddlywebplugins.lazy.init(config)
    tiddlywebplugins.privateer.init(config)
    tiddlywebplugins.jsonp.init(config)

    # XXX: The following is required to work around issues with twp.instancer.
    # Without this, config settings from tiddlywebwiki take precedence.
    config['serializers']['text/x-tiddlywiki'] = space_config[
            'serializers']['text/x-tiddlywiki']
    # This only fixes 'twanager update', instance creation still does not have
    # the right information, thus requiring a twanager update after instance
    # creation. Presumably the instance script needs to do something similar.
    config['instance_tiddlers'] = get_tiddler_locations(store_contents,
            'tiddlywebplugins.tiddlyspace')

    if 'selector' in config:  # system plugin
        replace_handler(config['selector'], '/', dict(GET=home))
        config['selector'].add('/_safe', GET=safe_mode, POST=safe_mode)
        add_spaces_routes(config['selector'])
        config['selector'].add('/{tiddler_name:segment}', GET=friendly_uri)
        config['selector'].add('/users/{username}/identities',
                GET=get_identities)

        if ControlView not in config['server_request_filters']:
            config['server_request_filters'].insert(
                    config['server_request_filters'].
                    index(UserExtract) + 1, ControlView)

        if DropPrivs not in config['server_request_filters']:
            config['server_request_filters'].insert(
                    config['server_request_filters'].
                    index(ControlView) + 1, DropPrivs)

        if CSRFProtector not in config['server_request_filters']:
            config['server_request_filters'].append(CSRFProtector)

        if AllowOrigin not in config['server_response_filters']:
            config['server_response_filters'].insert(
                    config['server_response_filters'].
                    index(PrettyHTTPExceptor) + 1, AllowOrigin)

        new_serializer = ['tiddlywebplugins.tiddlyspace.htmlserialization',
                'text/html; charset=UTF-8']
        config['serializers']['text/html'] = new_serializer
        config['serializers']['default'] = new_serializer
Exemplo n.º 8
0
            ('hoster', ''),
            ],
        }

store_structure['recipes']['help'] = {
        'desc': 'help wiki, with comments',
        'policy': {
            'read': [],
            'manage': ['R:ADMIN'],
            'owner': 'administrator',
            },
        'recipe': [
            ('system', ''),
            ('commentsystem', ''),
            ('help', ''),
            ('helpcomments', ''),
            ],
        }

instance_config = {
        'system_plugins': ['tiddlywebplugins.hoster'],
        'twanager_plugins': ['tiddlywebplugins.hoster'],
        'auth_systems': ['tiddlywebplugins.openid2'],
        'css_uri': '/bags/hoster/tiddlers/main.css',
        'register.start_href': '/home',
        'cookie_age': '2592000',
        }

instance_tiddlers = get_tiddler_locations(store_contents,
        'tiddlywebplugins.hoster')
Exemplo n.º 9
0
from tiddlywebplugins.tiddlyspace.instance import store_contents

try:
    from pkg_resources import resource_filename
except ImportError:
    from tiddlywebplugins.utils import resource_filename

PACKAGE_NAME = 'tiddlywebplugins.tiddlyspace'
TIDDLYWIKI_ALPHA = resource_filename(PACKAGE_NAME, 'resources/alpha.html')
TIDDLYWIKI_BETA = resource_filename(PACKAGE_NAME, 'resources/beta.html')
TIDDLYWIKI_EXTERNAL_ALPHA = resource_filename(PACKAGE_NAME,
                                              'resources/external_alpha.html')

config = {
    'instance_tiddlers':
    get_tiddler_locations(store_contents, PACKAGE_NAME),
    'atom.default_filter':
    'select=tag:!excludeLists;sort=-modified;limit=20',
    'atom.author_uri_map':
    '/profiles/%s',
    'atom.hub':
    'http://pubsubhubbub.appspot.com/',
    'auth_systems': [
        'tiddlywebplugins.tiddlyspace.cookie_form',
        'tiddlywebplugins.tiddlyspace.openid'
    ],
    'beanstalk.listeners': [
        'tiddlywebplugins.dispatcher.listener',
        'tiddlywebplugins.tiddlyspace.profiles'
    ],
    'bag_create_policy':
Exemplo n.º 10
0
            'create': [],
            'delete': [],
            'manage': ['R:ADMIN'],
            'accept': [],
            'owner': 'administrator',
            }
        }

store_structure['recipes']['tiddlydocs'] = {
        'desc': 'Sample tiddlydocs recipe',
        'recipe': [
            ('system', ''),
            ('tdocs', ''),
            ('documents', ''),
            ],
        }

instance_config = {
        'system_plugins': ['tiddlywebplugins.tiddlydocs', 'tiddlywebwiki'],
        'twanager_plugins': ['tiddlywebwiki'],
        'reserved_bag_names': ['tdocs', 'system'],
        'wikklytext.safe_mode': False,
        'tiddlyeditor_recipe':[
            ['tdocs',''],
            ['system','']
            ],
        }

instance_tiddlers = get_tiddler_locations(store_contents,
        'tiddlywebplugins.tiddlydocs')
Exemplo n.º 11
0
        'wiki': [
            'file:basecontent/FrontPage.tid',
        ]
}

store_structure = {
        "bags": {
                "wiki": {
                        "desc": "simplewiki contents",
                        # Use default open policy. This is old skool
                        # wiki.
                },
        },
        "recipes": {
                "wiki": {
                        "desc": "simplewiki",
                        "recipe": [
                                ("wiki", "")
                        ],
                }
        }
}


instance_config = {
        "system_plugins": ["tiddlywebplugins.simplewiki"],
}

instance_tiddlers = get_tiddler_locations(store_contents,
        'tiddlywebplugins.simplewiki')
Exemplo n.º 12
0
def init_plugin(config):
    import tiddlywebwiki
    import tiddlywebplugins.logout
    import tiddlywebplugins.virtualhosting  # calling init not required
    import tiddlywebplugins.magicuser
    import tiddlywebplugins.socialusers
    import tiddlywebplugins.mselect
    import tiddlywebplugins.oom
    import tiddlywebplugins.cookiedomain
    import tiddlywebplugins.tiddlyspace.validator
    import tiddlywebplugins.prettyerror
    import tiddlywebplugins.pathinfohack
    import tiddlywebplugins.hashmaker
    import tiddlywebplugins.form
    import tiddlywebplugins.reflector
    import tiddlywebplugins.privateer
    import tiddlywebplugins.relativetime
    import tiddlywebplugins.jsonp

    # Only load and run dispatcher if we are specifically configured
    # to use it.
    if config.get('use_dispatcher', False):
        import tiddlywebplugins.dispatcher
        import tiddlywebplugins.dispatcher.listener

    establish_commands(config)

    merge_config(config, space_config)

    if config.get('tiddlyspace.enable_profile', False):
        from werkzeug.contrib.profiler import ProfilerMiddleware
        config['server_request_filters'].insert(0, ProfilerMiddleware)

    tiddlywebwiki.init(config)
    tiddlywebplugins.logout.init(config)
    tiddlywebplugins.magicuser.init(config)
    tiddlywebplugins.socialusers.init(config)
    tiddlywebplugins.mselect.init(config)
    tiddlywebplugins.oom.init(config)
    tiddlywebplugins.cookiedomain.init(config)
    tiddlywebplugins.prettyerror.init(config)
    tiddlywebplugins.pathinfohack.init(config)
    tiddlywebplugins.hashmaker.init(config)
    tiddlywebplugins.form.init(config)
    tiddlywebplugins.reflector.init(config)
    tiddlywebplugins.privateer.init(config)
    tiddlywebplugins.jsonp.init(config)

    if config.get('use_dispatcher', False):
        tiddlywebplugins.dispatcher.init(config)
        tiddlywebplugins.dispatcher.listener.init(config)

    # XXX: The following is required to work around issues with twp.instancer.
    # Without this, config settings from tiddlywebwiki take precedence.
    config['serializers']['text/x-tiddlywiki'] = space_config[
            'serializers']['text/x-tiddlywiki']
    # This only fixes 'twanager update', instance creation still does not have
    # the right information, thus requiring a twanager update after instance
    # creation. Presumably the instance script needs to do something similar.
    config['instance_tiddlers'] = get_tiddler_locations(store_contents,
            'tiddlywebplugins.tiddlyspace')

    # When tiddlyspace.frontpage_installed is True, don't update
    # the frontpage_public bag, thus not overwriting what's there.
    if config.get('tiddlyspace.frontpage_installed', False):
        config['instance_tiddlers']['frontpage_public'] = []

    if 'selector' in config:  # system plugin
        establish_www(config)

    # update html serialization
    new_serializer = ['tiddlywebplugins.tiddlyspace.htmlserialization',
            'text/html; charset=UTF-8']
    config['serializers']['text/html'] = new_serializer
Exemplo n.º 13
0
def init_plugin(config):
    import tiddlywebwiki
    import tiddlywebplugins.logout
    import tiddlywebplugins.virtualhosting  # calling init not required
    import tiddlywebplugins.magicuser
    import tiddlywebplugins.socialusers
    import tiddlywebplugins.mselect
    import tiddlywebplugins.oom
    import tiddlywebplugins.cookiedomain
    import tiddlywebplugins.tiddlyspace.validator
    import tiddlywebplugins.prettyerror
    import tiddlywebplugins.pathinfohack
    import tiddlywebplugins.hashmaker
    import tiddlywebplugins.form
    import tiddlywebplugins.reflector
    import tiddlywebplugins.privateer
    import tiddlywebplugins.relativetime
    import tiddlywebplugins.jsonp

    # Only load and run dispatcher if we are specifically configured
    # to use it.
    if config.get('use_dispatcher', False):
        import tiddlywebplugins.dispatcher
        import tiddlywebplugins.dispatcher.listener

    establish_commands(config)

    merge_config(config, space_config)

    if config.get('tiddlyspace.enable_profile', False):
        from werkzeug.contrib.profiler import ProfilerMiddleware
        config['server_request_filters'].insert(0, ProfilerMiddleware)

    tiddlywebwiki.init(config)
    tiddlywebplugins.logout.init(config)
    tiddlywebplugins.magicuser.init(config)
    tiddlywebplugins.socialusers.init(config)
    tiddlywebplugins.mselect.init(config)
    tiddlywebplugins.oom.init(config)
    tiddlywebplugins.cookiedomain.init(config)
    tiddlywebplugins.prettyerror.init(config)
    tiddlywebplugins.pathinfohack.init(config)
    tiddlywebplugins.hashmaker.init(config)
    tiddlywebplugins.form.init(config)
    tiddlywebplugins.reflector.init(config)
    tiddlywebplugins.privateer.init(config)
    tiddlywebplugins.jsonp.init(config)

    if config.get('use_dispatcher', False):
        tiddlywebplugins.dispatcher.init(config)
        tiddlywebplugins.dispatcher.listener.init(config)

    # XXX: The following is required to work around issues with twp.instancer.
    # Without this, config settings from tiddlywebwiki take precedence.
    config['serializers']['text/x-tiddlywiki'] = space_config['serializers'][
        'text/x-tiddlywiki']
    # This only fixes 'twanager update', instance creation still does not have
    # the right information, thus requiring a twanager update after instance
    # creation. Presumably the instance script needs to do something similar.
    config['instance_tiddlers'] = get_tiddler_locations(
        store_contents, 'tiddlywebplugins.tiddlyspace')

    # inject lazy serialization information
    config['extension_types'].update({'lwiki': 'text/x-ltiddlywiki'})
    config['serializers'].update({
        'text/x-ltiddlywiki': [
            'tiddlywebplugins.tiddlyspace.betalazyserialization',
            'text/html; charset=UTF-8'
        ]
    })

    if 'selector' in config:  # system plugin
        establish_www(config)

    # update html serialization
    new_serializer = [
        'tiddlywebplugins.tiddlyspace.htmlserialization',
        'text/html; charset=UTF-8'
    ]
    config['serializers']['text/html'] = new_serializer
Exemplo n.º 14
0
"""
structure and contents of a default TiddlyWebWiki instance
"""

from tiddlywebplugins.instancer.util import get_tiddler_locations

from tiddlywebplugins.console.instance import (store_contents, store_structure
                                               as console_store_structure)

instance_config = {
    'system_plugins': ['tiddlywebwiki'],
    'twanager_plugins': ['tiddlywebwiki']
}

store_contents = get_tiddler_locations(store_contents,
                                       'tiddlywebplugins.console')
store_contents['system'] = [
    'https://github.com/tiddlyweb/tiddlywebwikiclient/raw/master/index.recipe'
]

store_structure = {
    'bags': {
        'system': {
            'desc': 'TiddlyWebWiki client plugins',
            'policy': {
                'read': [],
                'write': ['R:ADMIN'],
                'create': ['R:ADMIN'],
                'delete': ['R:ADMIN'],
                'manage': ['R:ADMIN'],
                'accept': ['R:ADMIN'],
Exemplo n.º 15
0
"""

from tiddlywebplugins.instancer.util import get_tiddler_locations

from tiddlywebwiki.instance import store_contents

try:
    from pkg_resources import resource_filename
except ImportError:
    from tiddlywebplugins.utils import resource_filename

PACKAGE_NAME = 'tiddlywebwiki'
BASE_TIDDLYWIKI = resource_filename(PACKAGE_NAME, 'resources/empty.html')

config = {
    'instance_tiddlers': get_tiddler_locations(store_contents, PACKAGE_NAME),
    'base_tiddlywiki': BASE_TIDDLYWIKI,
    'extension_types': {
        'wiki': 'text/x-tiddlywiki',
    },
    'serializers': {
        'text/x-tiddlywiki':
        ['tiddlywebwiki.serialization', 'text/html; charset=UTF-8'],
    },
    'wikitext.default_renderer': 'tiddlywebplugins.wikklytextrender',
    # XXX the following is, in most cases, redundant
    'wikitext.type_render_map': {
        'text/x-tiddlywiki': 'tiddlywebplugins.wikklytextrender',
    }
}
Exemplo n.º 16
0
from tiddlywebplugins.instancer.util import get_tiddler_locations
from tiddlywebwiki.instance import store_contents, store_structure

instance_config = {
        'system_plugins': ['tiddlywebwiki', 'tiddlywebplugins.xmobile'],
        'twanager_plugins': ['tiddlywebwiki', 'tiddlywebplugins.xmobile'],
        }

instance_tiddlers = get_tiddler_locations(store_contents,
        'tiddlywebplugins.xmobile')