Changeset 154


Ignore:
Timestamp:
01/12/20 23:45:24 (5 years ago)
Author:
bduin
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • prdatasets/pr_download.m

    r153 r154  
    239239  global ASK
    240240 
    241   if ASK && ~isempty(datsize) % ask only if datsize has been set
    242     if datsize ~= 0
    243       siz = ['(' num2str(datsize) ' MB)'];
    244     else
    245       siz = '';
    246     end
     241  if ASK && ~isempty(datsize) && datsize > 1 % ask only if datsize has been set
     242    siz = ['(' num2str(datsize) ' MB)'];
    247243    q = input(['Dataset is not available, OK to download ' siz ' [y]/n ?'],'s');
    248244    if ~isempty(q) && ~strcmp(q,'y')
    249245      error('No dataset')
    250246    end
     247    disp(['Downloading ' urlname ' (' num2str(siz) ' MB) ....'])
    251248  else
    252     siz = [];
    253   end
    254  
    255   if isempty(siz)
    256249    disp(['Downloading ' urlname ' ....'])
    257   else
    258     disp(['Downloading ' urlname ' (' num2str(siz) ' MB) ....'])
    259250  end
    260251 
     
    463454 
    464455  if ASK
    465     if ~isempty(size)
     456    if ~isempty(size) && size > 1
    466457      siz = ['(' num2str(size) ' MB)'];
    467     else
    468       siz = '';
    469     end
    470     q = input(['Dataset is not available, OK to download ' siz ' [y]/n ?'],'s');
    471     if ~isempty(q) && ~strcmp(q,'y')
    472       error('Dataset not found')
     458      q = input(['Dataset is not available, OK to download ' siz ' [y]/n ?'],'s');
     459      if ~isempty(q) && ~strcmp(q,'y')
     460        error('Dataset not found')
     461      end
    473462    end
    474463  end
Note: See TracChangeset for help on using the changeset viewer.