diff --git a/bin/synchronize-private.sh b/bin/synchronize-private.sh index 5815bade3a..de98130bbf 100755 --- a/bin/synchronize-private.sh +++ b/bin/synchronize-private.sh @@ -833,20 +833,6 @@ ARRAY+=(forward/ft_estimate_units.m) ARRAY+=(plotting/private/ft_estimate_units.m) sync ${ARRAY[*]} -################################################################################ -# ft_error.m, should be consistent with ft_notification and ft_warning - -ARRAY=() -ARRAY+=(connectivity/private/ft_error.m) -ARRAY+=(fileio/private/ft_error.m) -ARRAY+=(forward/private/ft_error.m) -ARRAY+=(inverse/private/ft_error.m) -ARRAY+=(plotting/private/ft_error.m) -ARRAY+=(preproc/private/ft_error.m) -ARRAY+=(specest/private/ft_error.m) -ARRAY+=(utilities/ft_error.m) -sync ${ARRAY[*]} - ################################################################################ # ft_fetch_data.m @@ -1040,7 +1026,7 @@ ARRAY+=(inverse/private/ft_inv.m) sync ${ARRAY[*]} ################################################################################ -# ft_notification.m, should be consistent with ft_warning and ft_error +# ft_notification.m, should be consistent with ft_warning etc ARRAY=() ARRAY+=(connectivity/private/ft_notification.m) @@ -1053,6 +1039,61 @@ ARRAY+=(specest/private/ft_notification.m) ARRAY+=(utilities/private/ft_notification.m) sync ${ARRAY[*]} +ARRAY=() +ARRAY+=(connectivity/private/ft_warning.m) +ARRAY+=(fileio/private/ft_warning.m) +ARRAY+=(forward/private/ft_warning.m) +ARRAY+=(inverse/private/ft_warning.m) +ARRAY+=(plotting/private/ft_warning.m) +ARRAY+=(preproc/private/ft_warning.m) +ARRAY+=(specest/private/ft_warning.m) +ARRAY+=(utilities/ft_warning.m) +sync ${ARRAY[*]} + +ARRAY=() +ARRAY+=(connectivity/private/ft_error.m) +ARRAY+=(fileio/private/ft_error.m) +ARRAY+=(forward/private/ft_error.m) +ARRAY+=(inverse/private/ft_error.m) +ARRAY+=(plotting/private/ft_error.m) +ARRAY+=(preproc/private/ft_error.m) +ARRAY+=(specest/private/ft_error.m) +ARRAY+=(utilities/ft_error.m) +sync ${ARRAY[*]} + +ARRAY=() +ARRAY+=(connectivity/private/ft_notice.m) +ARRAY+=(fileio/private/ft_notice.m) +ARRAY+=(forward/private/ft_notice.m) +ARRAY+=(inverse/private/ft_notice.m) +ARRAY+=(plotting/private/ft_notice.m) +ARRAY+=(preproc/private/ft_notice.m) +ARRAY+=(specest/private/ft_notice.m) +ARRAY+=(utilities/ft_notice.m) +sync ${ARRAY[*]} + +ARRAY=() +ARRAY+=(connectivity/private/ft_info.m) +ARRAY+=(fileio/private/ft_info.m) +ARRAY+=(forward/private/ft_info.m) +ARRAY+=(inverse/private/ft_info.m) +ARRAY+=(plotting/private/ft_info.m) +ARRAY+=(preproc/private/ft_info.m) +ARRAY+=(specest/private/ft_info.m) +ARRAY+=(utilities/ft_info.m) +sync ${ARRAY[*]} + +ARRAY=() +ARRAY+=(connectivity/private/ft_debug.m) +ARRAY+=(fileio/private/ft_debug.m) +ARRAY+=(forward/private/ft_debug.m) +ARRAY+=(inverse/private/ft_debug.m) +ARRAY+=(plotting/private/ft_debug.m) +ARRAY+=(preproc/private/ft_debug.m) +ARRAY+=(specest/private/ft_debug.m) +ARRAY+=(utilities/ft_debug.m) +sync ${ARRAY[*]} + ################################################################################ # ft_platform_supports.m @@ -1148,20 +1189,6 @@ ARRAY+=(specest/private/ft_version.m) ARRAY+=(utilities/ft_version.m) sync ${ARRAY[*]} -################################################################################ -# ft_warning.m, should be consistent with ft_notification and ft_error - -ARRAY=() -ARRAY+=(connectivity/private/ft_warning.m) -ARRAY+=(fileio/private/ft_warning.m) -ARRAY+=(forward/private/ft_warning.m) -ARRAY+=(inverse/private/ft_warning.m) -ARRAY+=(plotting/private/ft_warning.m) -ARRAY+=(preproc/private/ft_warning.m) -ARRAY+=(specest/private/ft_warning.m) -ARRAY+=(utilities/ft_warning.m) -sync ${ARRAY[*]} - ################################################################################ # ft_warp_apply.m diff --git a/connectivity/private/ft_debug.m b/connectivity/private/ft_debug.m new file mode 100644 index 0000000000..67df14615b --- /dev/null +++ b/connectivity/private/ft_debug.m @@ -0,0 +1,64 @@ +function varargout = ft_debug(varargin) + +% FT_DEBUG prints a debug message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_debug(...) +% with arguments similar to fprintf, or +% ft_debug(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_debug off +% or for specific ones using +% ft_debug off msgId +% +% To switch them back on, you would use +% ft_debug on +% or for specific ones using +% ft_debug on msgId +% +% Messages are only printed once per timeout period using +% ft_debug timeout 60 +% ft_debug once +% or for specific ones using +% ft_debug once msgId +% +% You can see the most recent messages and identifier using +% ft_debug last +% +% You can query the current on/off/once state for all messages using +% ft_debug query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/connectivity/private/ft_info.m b/connectivity/private/ft_info.m new file mode 100644 index 0000000000..835a2fbf39 --- /dev/null +++ b/connectivity/private/ft_info.m @@ -0,0 +1,64 @@ +function varargout = ft_info(varargin) + +% FT_INFO prints an info message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_info(...) +% with arguments similar to fprintf, or +% ft_info(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_info off +% or for specific ones using +% ft_info off msgId +% +% To switch them back on, you would use +% ft_info on +% or for specific ones using +% ft_info on msgId +% +% Messages are only printed once per timeout period using +% ft_info timeout 60 +% ft_info once +% or for specific ones using +% ft_info once msgId +% +% You can see the most recent messages and identifier using +% ft_info last +% +% You can query the current on/off/once state for all messages using +% ft_info query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/connectivity/private/ft_notice.m b/connectivity/private/ft_notice.m new file mode 100644 index 0000000000..09df9ea51c --- /dev/null +++ b/connectivity/private/ft_notice.m @@ -0,0 +1,64 @@ +function varargout = ft_notice(varargin) + +% FT_NOTICE prints a notice message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_notice(...) +% with arguments similar to fprintf, or +% ft_notice(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_notice off +% or for specific ones using +% ft_notice off msgId +% +% To switch them back on, you would use +% ft_notice on +% or for specific ones using +% ft_notice on msgId +% +% Messages are only printed once per timeout period using +% ft_notice timeout 60 +% ft_notice once +% or for specific ones using +% ft_notice once msgId +% +% You can see the most recent messages and identifier using +% ft_notice last +% +% You can query the current on/off/once state for all messages using +% ft_notice query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/connectivity/private/ft_version.m b/connectivity/private/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/connectivity/private/ft_version.m +++ b/connectivity/private/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end diff --git a/fileio/private/ft_debug.m b/fileio/private/ft_debug.m new file mode 100644 index 0000000000..67df14615b --- /dev/null +++ b/fileio/private/ft_debug.m @@ -0,0 +1,64 @@ +function varargout = ft_debug(varargin) + +% FT_DEBUG prints a debug message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_debug(...) +% with arguments similar to fprintf, or +% ft_debug(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_debug off +% or for specific ones using +% ft_debug off msgId +% +% To switch them back on, you would use +% ft_debug on +% or for specific ones using +% ft_debug on msgId +% +% Messages are only printed once per timeout period using +% ft_debug timeout 60 +% ft_debug once +% or for specific ones using +% ft_debug once msgId +% +% You can see the most recent messages and identifier using +% ft_debug last +% +% You can query the current on/off/once state for all messages using +% ft_debug query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/fileio/private/ft_info.m b/fileio/private/ft_info.m new file mode 100644 index 0000000000..835a2fbf39 --- /dev/null +++ b/fileio/private/ft_info.m @@ -0,0 +1,64 @@ +function varargout = ft_info(varargin) + +% FT_INFO prints an info message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_info(...) +% with arguments similar to fprintf, or +% ft_info(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_info off +% or for specific ones using +% ft_info off msgId +% +% To switch them back on, you would use +% ft_info on +% or for specific ones using +% ft_info on msgId +% +% Messages are only printed once per timeout period using +% ft_info timeout 60 +% ft_info once +% or for specific ones using +% ft_info once msgId +% +% You can see the most recent messages and identifier using +% ft_info last +% +% You can query the current on/off/once state for all messages using +% ft_info query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/fileio/private/ft_notice.m b/fileio/private/ft_notice.m new file mode 100644 index 0000000000..09df9ea51c --- /dev/null +++ b/fileio/private/ft_notice.m @@ -0,0 +1,64 @@ +function varargout = ft_notice(varargin) + +% FT_NOTICE prints a notice message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_notice(...) +% with arguments similar to fprintf, or +% ft_notice(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_notice off +% or for specific ones using +% ft_notice off msgId +% +% To switch them back on, you would use +% ft_notice on +% or for specific ones using +% ft_notice on msgId +% +% Messages are only printed once per timeout period using +% ft_notice timeout 60 +% ft_notice once +% or for specific ones using +% ft_notice once msgId +% +% You can see the most recent messages and identifier using +% ft_notice last +% +% You can query the current on/off/once state for all messages using +% ft_notice query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/fileio/private/ft_version.m b/fileio/private/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/fileio/private/ft_version.m +++ b/fileio/private/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end diff --git a/forward/private/ft_debug.m b/forward/private/ft_debug.m new file mode 100644 index 0000000000..67df14615b --- /dev/null +++ b/forward/private/ft_debug.m @@ -0,0 +1,64 @@ +function varargout = ft_debug(varargin) + +% FT_DEBUG prints a debug message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_debug(...) +% with arguments similar to fprintf, or +% ft_debug(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_debug off +% or for specific ones using +% ft_debug off msgId +% +% To switch them back on, you would use +% ft_debug on +% or for specific ones using +% ft_debug on msgId +% +% Messages are only printed once per timeout period using +% ft_debug timeout 60 +% ft_debug once +% or for specific ones using +% ft_debug once msgId +% +% You can see the most recent messages and identifier using +% ft_debug last +% +% You can query the current on/off/once state for all messages using +% ft_debug query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/forward/private/ft_info.m b/forward/private/ft_info.m new file mode 100644 index 0000000000..835a2fbf39 --- /dev/null +++ b/forward/private/ft_info.m @@ -0,0 +1,64 @@ +function varargout = ft_info(varargin) + +% FT_INFO prints an info message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_info(...) +% with arguments similar to fprintf, or +% ft_info(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_info off +% or for specific ones using +% ft_info off msgId +% +% To switch them back on, you would use +% ft_info on +% or for specific ones using +% ft_info on msgId +% +% Messages are only printed once per timeout period using +% ft_info timeout 60 +% ft_info once +% or for specific ones using +% ft_info once msgId +% +% You can see the most recent messages and identifier using +% ft_info last +% +% You can query the current on/off/once state for all messages using +% ft_info query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/forward/private/ft_notice.m b/forward/private/ft_notice.m new file mode 100644 index 0000000000..09df9ea51c --- /dev/null +++ b/forward/private/ft_notice.m @@ -0,0 +1,64 @@ +function varargout = ft_notice(varargin) + +% FT_NOTICE prints a notice message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_notice(...) +% with arguments similar to fprintf, or +% ft_notice(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_notice off +% or for specific ones using +% ft_notice off msgId +% +% To switch them back on, you would use +% ft_notice on +% or for specific ones using +% ft_notice on msgId +% +% Messages are only printed once per timeout period using +% ft_notice timeout 60 +% ft_notice once +% or for specific ones using +% ft_notice once msgId +% +% You can see the most recent messages and identifier using +% ft_notice last +% +% You can query the current on/off/once state for all messages using +% ft_notice query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/forward/private/ft_version.m b/forward/private/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/forward/private/ft_version.m +++ b/forward/private/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end diff --git a/inverse/private/ft_debug.m b/inverse/private/ft_debug.m new file mode 100644 index 0000000000..67df14615b --- /dev/null +++ b/inverse/private/ft_debug.m @@ -0,0 +1,64 @@ +function varargout = ft_debug(varargin) + +% FT_DEBUG prints a debug message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_debug(...) +% with arguments similar to fprintf, or +% ft_debug(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_debug off +% or for specific ones using +% ft_debug off msgId +% +% To switch them back on, you would use +% ft_debug on +% or for specific ones using +% ft_debug on msgId +% +% Messages are only printed once per timeout period using +% ft_debug timeout 60 +% ft_debug once +% or for specific ones using +% ft_debug once msgId +% +% You can see the most recent messages and identifier using +% ft_debug last +% +% You can query the current on/off/once state for all messages using +% ft_debug query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/inverse/private/ft_info.m b/inverse/private/ft_info.m new file mode 100644 index 0000000000..835a2fbf39 --- /dev/null +++ b/inverse/private/ft_info.m @@ -0,0 +1,64 @@ +function varargout = ft_info(varargin) + +% FT_INFO prints an info message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_info(...) +% with arguments similar to fprintf, or +% ft_info(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_info off +% or for specific ones using +% ft_info off msgId +% +% To switch them back on, you would use +% ft_info on +% or for specific ones using +% ft_info on msgId +% +% Messages are only printed once per timeout period using +% ft_info timeout 60 +% ft_info once +% or for specific ones using +% ft_info once msgId +% +% You can see the most recent messages and identifier using +% ft_info last +% +% You can query the current on/off/once state for all messages using +% ft_info query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/inverse/private/ft_notice.m b/inverse/private/ft_notice.m new file mode 100644 index 0000000000..09df9ea51c --- /dev/null +++ b/inverse/private/ft_notice.m @@ -0,0 +1,64 @@ +function varargout = ft_notice(varargin) + +% FT_NOTICE prints a notice message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_notice(...) +% with arguments similar to fprintf, or +% ft_notice(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_notice off +% or for specific ones using +% ft_notice off msgId +% +% To switch them back on, you would use +% ft_notice on +% or for specific ones using +% ft_notice on msgId +% +% Messages are only printed once per timeout period using +% ft_notice timeout 60 +% ft_notice once +% or for specific ones using +% ft_notice once msgId +% +% You can see the most recent messages and identifier using +% ft_notice last +% +% You can query the current on/off/once state for all messages using +% ft_notice query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/inverse/private/ft_version.m b/inverse/private/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/inverse/private/ft_version.m +++ b/inverse/private/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end diff --git a/plotting/private/ft_debug.m b/plotting/private/ft_debug.m new file mode 100644 index 0000000000..67df14615b --- /dev/null +++ b/plotting/private/ft_debug.m @@ -0,0 +1,64 @@ +function varargout = ft_debug(varargin) + +% FT_DEBUG prints a debug message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_debug(...) +% with arguments similar to fprintf, or +% ft_debug(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_debug off +% or for specific ones using +% ft_debug off msgId +% +% To switch them back on, you would use +% ft_debug on +% or for specific ones using +% ft_debug on msgId +% +% Messages are only printed once per timeout period using +% ft_debug timeout 60 +% ft_debug once +% or for specific ones using +% ft_debug once msgId +% +% You can see the most recent messages and identifier using +% ft_debug last +% +% You can query the current on/off/once state for all messages using +% ft_debug query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/plotting/private/ft_info.m b/plotting/private/ft_info.m new file mode 100644 index 0000000000..835a2fbf39 --- /dev/null +++ b/plotting/private/ft_info.m @@ -0,0 +1,64 @@ +function varargout = ft_info(varargin) + +% FT_INFO prints an info message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_info(...) +% with arguments similar to fprintf, or +% ft_info(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_info off +% or for specific ones using +% ft_info off msgId +% +% To switch them back on, you would use +% ft_info on +% or for specific ones using +% ft_info on msgId +% +% Messages are only printed once per timeout period using +% ft_info timeout 60 +% ft_info once +% or for specific ones using +% ft_info once msgId +% +% You can see the most recent messages and identifier using +% ft_info last +% +% You can query the current on/off/once state for all messages using +% ft_info query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/plotting/private/ft_notice.m b/plotting/private/ft_notice.m new file mode 100644 index 0000000000..09df9ea51c --- /dev/null +++ b/plotting/private/ft_notice.m @@ -0,0 +1,64 @@ +function varargout = ft_notice(varargin) + +% FT_NOTICE prints a notice message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_notice(...) +% with arguments similar to fprintf, or +% ft_notice(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_notice off +% or for specific ones using +% ft_notice off msgId +% +% To switch them back on, you would use +% ft_notice on +% or for specific ones using +% ft_notice on msgId +% +% Messages are only printed once per timeout period using +% ft_notice timeout 60 +% ft_notice once +% or for specific ones using +% ft_notice once msgId +% +% You can see the most recent messages and identifier using +% ft_notice last +% +% You can query the current on/off/once state for all messages using +% ft_notice query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/plotting/private/ft_version.m b/plotting/private/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/plotting/private/ft_version.m +++ b/plotting/private/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end diff --git a/preproc/private/ft_debug.m b/preproc/private/ft_debug.m new file mode 100644 index 0000000000..67df14615b --- /dev/null +++ b/preproc/private/ft_debug.m @@ -0,0 +1,64 @@ +function varargout = ft_debug(varargin) + +% FT_DEBUG prints a debug message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_debug(...) +% with arguments similar to fprintf, or +% ft_debug(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_debug off +% or for specific ones using +% ft_debug off msgId +% +% To switch them back on, you would use +% ft_debug on +% or for specific ones using +% ft_debug on msgId +% +% Messages are only printed once per timeout period using +% ft_debug timeout 60 +% ft_debug once +% or for specific ones using +% ft_debug once msgId +% +% You can see the most recent messages and identifier using +% ft_debug last +% +% You can query the current on/off/once state for all messages using +% ft_debug query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/preproc/private/ft_info.m b/preproc/private/ft_info.m new file mode 100644 index 0000000000..835a2fbf39 --- /dev/null +++ b/preproc/private/ft_info.m @@ -0,0 +1,64 @@ +function varargout = ft_info(varargin) + +% FT_INFO prints an info message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_info(...) +% with arguments similar to fprintf, or +% ft_info(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_info off +% or for specific ones using +% ft_info off msgId +% +% To switch them back on, you would use +% ft_info on +% or for specific ones using +% ft_info on msgId +% +% Messages are only printed once per timeout period using +% ft_info timeout 60 +% ft_info once +% or for specific ones using +% ft_info once msgId +% +% You can see the most recent messages and identifier using +% ft_info last +% +% You can query the current on/off/once state for all messages using +% ft_info query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/preproc/private/ft_notice.m b/preproc/private/ft_notice.m new file mode 100644 index 0000000000..09df9ea51c --- /dev/null +++ b/preproc/private/ft_notice.m @@ -0,0 +1,64 @@ +function varargout = ft_notice(varargin) + +% FT_NOTICE prints a notice message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_notice(...) +% with arguments similar to fprintf, or +% ft_notice(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_notice off +% or for specific ones using +% ft_notice off msgId +% +% To switch them back on, you would use +% ft_notice on +% or for specific ones using +% ft_notice on msgId +% +% Messages are only printed once per timeout period using +% ft_notice timeout 60 +% ft_notice once +% or for specific ones using +% ft_notice once msgId +% +% You can see the most recent messages and identifier using +% ft_notice last +% +% You can query the current on/off/once state for all messages using +% ft_notice query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/preproc/private/ft_version.m b/preproc/private/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/preproc/private/ft_version.m +++ b/preproc/private/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end diff --git a/specest/private/ft_debug.m b/specest/private/ft_debug.m new file mode 100644 index 0000000000..67df14615b --- /dev/null +++ b/specest/private/ft_debug.m @@ -0,0 +1,64 @@ +function varargout = ft_debug(varargin) + +% FT_DEBUG prints a debug message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_debug(...) +% with arguments similar to fprintf, or +% ft_debug(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_debug off +% or for specific ones using +% ft_debug off msgId +% +% To switch them back on, you would use +% ft_debug on +% or for specific ones using +% ft_debug on msgId +% +% Messages are only printed once per timeout period using +% ft_debug timeout 60 +% ft_debug once +% or for specific ones using +% ft_debug once msgId +% +% You can see the most recent messages and identifier using +% ft_debug last +% +% You can query the current on/off/once state for all messages using +% ft_debug query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/specest/private/ft_info.m b/specest/private/ft_info.m new file mode 100644 index 0000000000..835a2fbf39 --- /dev/null +++ b/specest/private/ft_info.m @@ -0,0 +1,64 @@ +function varargout = ft_info(varargin) + +% FT_INFO prints an info message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_info(...) +% with arguments similar to fprintf, or +% ft_info(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_info off +% or for specific ones using +% ft_info off msgId +% +% To switch them back on, you would use +% ft_info on +% or for specific ones using +% ft_info on msgId +% +% Messages are only printed once per timeout period using +% ft_info timeout 60 +% ft_info once +% or for specific ones using +% ft_info once msgId +% +% You can see the most recent messages and identifier using +% ft_info last +% +% You can query the current on/off/once state for all messages using +% ft_info query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/specest/private/ft_notice.m b/specest/private/ft_notice.m new file mode 100644 index 0000000000..09df9ea51c --- /dev/null +++ b/specest/private/ft_notice.m @@ -0,0 +1,64 @@ +function varargout = ft_notice(varargin) + +% FT_NOTICE prints a notice message on screen, depending on the verbosity +% settings of the calling high-level FieldTrip function. +% +% Use as +% ft_notice(...) +% with arguments similar to fprintf, or +% ft_notice(msgId, ...) +% with arguments similar to warning. +% +% You can switch of all messages using +% ft_notice off +% or for specific ones using +% ft_notice off msgId +% +% To switch them back on, you would use +% ft_notice on +% or for specific ones using +% ft_notice on msgId +% +% Messages are only printed once per timeout period using +% ft_notice timeout 60 +% ft_notice once +% or for specific ones using +% ft_notice once msgId +% +% You can see the most recent messages and identifier using +% ft_notice last +% +% You can query the current on/off/once state for all messages using +% ft_notice query +% +% See also FT_ERROR, FT_WARNING, FT_NOTICE, FT_INFO, FT_DEBUG, ERROR, WARNING + +% Copyright (C) 2017, Robert Oostenveld +% +% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org +% for the documentation and details. +% +% FieldTrip is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% FieldTrip 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 General Public License +% along with FieldTrip. If not, see . +% +% $Id$ + +if nargout + [varargout{1:nargout}] = ft_notification(varargin{:}); +elseif isequal(varargin, {'last'}) + % return an answer anyway + varargout{1} = ft_notification(varargin{:}); +else + ft_notification(varargin{:}); +end + diff --git a/specest/private/ft_version.m b/specest/private/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/specest/private/ft_version.m +++ b/specest/private/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end diff --git a/utilities/ft_version.m b/utilities/ft_version.m index c0254f9afc..d1c1fd5579 100644 --- a/utilities/ft_version.m +++ b/utilities/ft_version.m @@ -157,8 +157,13 @@ else % get it from the Contents.m file in the FieldTrip directory if ~isdeployed - tmp = ver(ftpath); - ftver = tmp.Version; + try + tmp = ver(ftpath); + ftver = tmp.Version; + catch + % this fails when Contents.m is not properly formatted + ftver = 'unknown'; + end else ftver = 'deployed'; end