Esempio n. 1
0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

"""Settings for the omero-parade app."""

import sys
import json
from omeroweb.settings import process_custom_settings, report_settings

# load settings
PARADE_SETTINGS_MAPPING = {

    "omero.web.parade.filters":
        ["PARADE_FILTERS",
         '["omero_parade", "omero_parade.annotation_filters", '
         '"omero_parade.table_filters"]',
         json.loads,
         ("Filters for filtering data. Each is a python module \
          that contains an omero_filter module"
          "that has a get_filters function")],
}

process_custom_settings(sys.modules[__name__], 'PARADE_SETTINGS_MAPPING')
report_settings(sys.modules[__name__])
Esempio n. 2
0
    ],
    "omero.web.api.max_limit": [
        "API_MAX_LIMIT",
        500,
        int,
        "Maximum number of items returned from json api.",
    ],
    "omero.web.api.absolute_url": [
        "API_ABSOLUTE_URL",
        None,
        str_slash,
        ("URL to use for generating urls within API json responses. "
         "By default this is None, and we use Django's "
         "request.build_absolute_uri() to generate absolute urls "
         "based on each request. If set to a string or empty string, "
         "this will be used as prefix to relative urls."),
    ],
}

process_custom_settings(sys.modules[__name__], "API_SETTINGS_MAPPING")
report_settings(sys.modules[__name__])

# For any given release of api, we may support
# one or more versions of the api.
# E.g. /api/v0/
# TODO - need to decide how this is configured, strategy for extending etc.
API_VERSIONS = ("0", )

# Current major.minor version number
API_VERSION = "0.2"
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""Settings for the OMERO.iviewer app."""

import sys
from omeroweb.settings import process_custom_settings, report_settings

# load settings
IVIEWER_SETTINGS_MAPPING = {

    "omero.web.iviewer.roi_page_size":
        ["ROI_PAGE_SIZE",
         500,
         int,
         "Page size for ROI pagination."],
}

process_custom_settings(sys.modules[__name__], 'IVIEWER_SETTINGS_MAPPING')
report_settings(sys.modules[__name__])
Esempio n. 4
0
# load settings
SIGNUP_SETTINGS_MAPPING = {
    'omero.web.signup.admin.user':
        ['SIGNUP_ADMIN_USERNAME', '', str_not_empty, None],
    'omero.web.signup.admin.password':
        ['SIGNUP_ADMIN_PASSWORD', '', str_not_empty, None],
    'omero.web.signup.group.name':
        ['SIGNUP_GROUP_NAME', '', str_not_empty, None],
    'omero.web.signup.group.templatetime':
        ['SIGNUP_GROUP_NAME_TEMPLATETIME', "false", parse_boolean, None],
    'omero.web.signup.group.perms':
        ['SIGNUP_GROUP_PERMS', 'rw----', str_not_empty, None],
    'omero.web.signup.email.enabled':
        ['SIGNUP_EMAIL_ENABLED', "false", parse_boolean, None],
    'omero.web.signup.email.subject':
        ['SIGNUP_EMAIL_SUBJECT', 'Your OMERO server login details',
         str_not_empty, None],
    'omero.web.signup.email.body':
        ['SIGNUP_EMAIL_BODY', (
            'Your login details for OMERO server are:\n\n'
            'username: {username}\n'
            'password: {password}\n'
        ), str_not_empty, None],
    'omero.web.signup.helpmessage':
        ['SIGNUP_HELP_MESSAGE', '', str, None],
}


process_custom_settings(sys.modules[__name__], 'SIGNUP_SETTINGS_MAPPING')
report_settings(sys.modules[__name__])
Esempio n. 5
0
        ("Logo image and link. e.g."
         " {'src':'url.png','href':'www.url', 'alt':'Image alt text'}"
         " href can be URL name for reverse(url_name). If href is omitted,"
         " it will default to 'webgallery_index'")
    ],
    "omero.web.gallery.footer_html": [
        "FOOTER_HTML", (''), str,
        ("HTML to go in the footer. If this is set to 'IDR' then"
         " we show the footer for the IDR site.")
    ],
    "omero.web.gallery.subheading_html": [
        "SUBHEADING_HTML", (''), str,
        ("HTML to show as a sub-heading, within a <p> tag.")
    ],
    "omero.web.gallery.favicon": ["FAVICON", (''), str, ("URL to favicon.")],
    "omero.web.gallery.study_short_name": [
        "STUDY_SHORT_NAME", ('[]'), json.loads,
        ("Gets a short name for Screen or Project to show above the"
         " study Image in the categories or search page, instead of"
         " the default 'Project: 123'. The list allows us"
         " to try multiple methods, using the first that works. Each object"
         " in the list has e.g. {'key': 'Name'}. The 'key' can be Name,"
         " Description or the key for a Key:Value pair on the object."
         " If a 'regex' and 'template' are specified, we try"
         " name.replace(regex, template).")
    ],
}

process_custom_settings(sys.modules[__name__], 'GALLERY_SETTINGS_MAPPING')
report_settings(sys.modules[__name__])
MAPR_SETTINGS_MAPPING = {
    "omero.web.mapr.config":
        ["MAPR_CONFIG", "[]", config_list_to_dict, None],
    "omero.web.mapr.favicon":
        ["MAPR_DEFAULT_FAVICON",
         os.path.join(os.path.dirname(__file__),
                      'static', 'mapr', 'image',
                      'favicon.png').replace('\\', '/'),
         str, None],
    "omero.web.mapr.favicon_webservice":
        ["MAPR_FAVICON_WEBSERVICE",
            "http://www.google.com/s2/favicons?domain=", str, None],
    }


process_custom_settings(sys.modules[__name__], 'MAPR_SETTINGS_MAPPING')
report_settings(sys.modules[__name__])


def prefix_setting(suffix, default):
    @property
    def func(self):
        return getattr(settings, 'MAPR_%s' % suffix, default)
    return func


class MaprSettings(object):

    CONFIG = prefix_setting('CONFIG', MAPR_CONFIG)  # noqa
    DEFAULT_FAVICON = prefix_setting('DEFAULT_FAVICON',
                                     MAPR_DEFAULT_FAVICON)  # noqa
Esempio n. 7
0
"""Settings for the omero-3Dscript app."""

import sys
from omeroweb.settings import process_custom_settings, report_settings

OMERO_3DSCRIPT_SETTINGS_MAPPING = {
    "omero.web.omero_3Dscript.processing_server":
        ["OMERO_3DSCRIPT_PROCESSING_SERVER",
         "localhost",
         str,
         "IP/hostname of the machine running the Fiji 3Dscript server"],

    "omero.web.omero_3Dscript.fiji_bin":
        ["OMERO_3DSCRIPT_FIJI_BIN",
         "",
         str,
         "Path to the Fiji/ImageJ executable"],

    "omero.web.omero_3Dscript.omero_server_external_ip":
        ["OMERO_3DSCRIPT_OMERO_SERVER_EXTERNAL_IP",
         "",
         str,
         "IP/hostname of the omero server, to be used from the processing machine to download data. Normally, this might not need to be set, but in case OMERO.web accesses OMERO.server with an internal IP (e.g. when run inside a container), it is required to set this variable."],
}

process_custom_settings(sys.modules[__name__], 'OMERO_3DSCRIPT_SETTINGS_MAPPING')
report_settings(sys.modules[__name__])