##// END OF EJS Templates
channelstream: use proper pyramid event to create storage on app creation.
marcink -
r2303:7829bcfe default
parent child Browse files
Show More
@@ -20,6 +20,7 b''
20 20
21 21 import os
22 22
23 from pyramid.events import ApplicationCreated
23 24 from pyramid.settings import asbool
24 25
25 26 from rhodecode.config.routing import ADMIN_PREFIX
@@ -57,6 +58,14 b' PLUGIN_DEFINITION = {'
57 58 }
58 59
59 60
61 def maybe_create_history_store(event):
62 # create plugin history location
63 settings = event.app.registry.settings
64 history_dir = settings.get('channelstream.history.location', '')
65 if history_dir and not os.path.exists(history_dir):
66 os.makedirs(history_dir, 0750)
67
68
60 69 def includeme(config):
61 70 settings = config.registry.settings
62 71 PLUGIN_DEFINITION['config']['enabled'] = asbool(
@@ -71,10 +80,7 b' def includeme(config):'
71 80 PLUGIN_DEFINITION['name'],
72 81 PLUGIN_DEFINITION['config']
73 82 )
74 # create plugin history location
75 history_dir = PLUGIN_DEFINITION['config']['history.location']
76 if history_dir and not os.path.exists(history_dir):
77 os.makedirs(history_dir, 0750)
83 config.add_subscriber(maybe_create_history_store, ApplicationCreated)
78 84
79 85 config.add_route(
80 86 name='channelstream_connect',
General Comments 0
You need to be logged in to leave comments. Login now