-
Notifications
You must be signed in to change notification settings - Fork 39
/
config.m
48 lines (48 loc) · 1.63 KB
/
config.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function res = config(name, value)
% CONFIG(name, value)
% Description:
% Manage DataJoint configuration.
% Inputs:
% name[optional]: (string) Dot-based address to desired setting.
% value[optional]: (string) New value to be set.
% Examples:
% dj.config
% dj.config('safemode')
% dj.config('safemode', true)
% previous_value = dj.config('safemode', false)
% dj.config('stores.external_raw', struct(...
% 'datajoint_type', 'blob', ...
% 'protocol', 'file', ...
% 'location', '/net/djblobs/myschema' ...
% ))
% dj.config('stores.external', struct(...
% 'datajoint_type', 'blob', ...
% 'protocol', 's3', ...
% 'endpoint', 's3.amazonaws.com:9000', ...
% 'bucket', 'testbucket', ...
% 'location', 'datajoint-projects/lab1', ...
% 'access_key', '1234567', ...
% 'secret_key', 'foaf1234'...
% ))
% dj.config('blobCache', '/net/djcache')
switch nargin
case 0
out = dj.internal.Settings;
res = out.result;
case 1
out = dj.internal.Settings(name);
res = out.result;
case 2
switch nargout
case 0
dj.internal.Settings(name, value);
case 1
out = dj.internal.Settings(name, value);
res = out.result;
otherwise
error('Exceeded 1 output limit.')
end
otherwise
error('Exceeded 2 input limit.')
end
end