##// END OF EJS Templates
comments: make dismiss less prominent
comments: make dismiss less prominent

File last commit:

r4476:8538fa60 default
r4587:e0e71538 stable
Show More
__init__.py
52 lines | 1.9 KiB | text/x-python | PythonLexer
file-store: rename module from upload_store to file_store.
r3453 # -*- coding: utf-8 -*-
code: update copyrights to 2020
r4306 # Copyright (C) 2016-2020 RhodeCode GmbH
file-store: rename module from upload_store to file_store.
r3453 #
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3
# (only), as published by the Free Software Foundation.
#
# 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 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/>.
#
# This program is dual-licensed. If you wish to learn more about the
# RhodeCode Enterprise Edition, including its added features, Support services,
# and proprietary license terms, please see https://rhodecode.com/licenses/
import os
from rhodecode.apps.file_store import config_keys
from rhodecode.config.middleware import _bool_setting, _string_setting
def _sanitize_settings_and_apply_defaults(settings):
"""
Set defaults, convert to python types and validate settings.
"""
_bool_setting(settings, config_keys.enabled, 'true')
_string_setting(settings, config_keys.backend, 'local')
default_store = os.path.join(os.path.dirname(settings['__file__']), 'upload_store')
_string_setting(settings, config_keys.store_path, default_store)
def includeme(config):
settings = config.registry.settings
_sanitize_settings_and_apply_defaults(settings)
config.add_route(
name='upload_file',
pattern='/_file_store/upload')
config.add_route(
name='download_file',
artifacts: few fixes for handling cases of using sub path to store artifacts....
r4476 pattern='/_file_store/download/{fid:.*}')
artifacts: expose a special auth-token based artifacts download urls....
r4003 config.add_route(
name='download_file_by_token',
artifacts: few fixes for handling cases of using sub path to store artifacts....
r4476 pattern='/_file_store/token-download/{_auth_token}/{fid:.*}')
file-store: rename module from upload_store to file_store.
r3453
# Scan module for configuration decorators.
config.scan('.views', ignore='.tests')