Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

36
LINES

< > BotCompany Repo | #1014210 // mechList_opt_raw_fresh

JavaX fragment (include)

static S mechList_opt_raw_fresh(S name) {
  ifdef mechList_raw_fresh_debug
    print("mechList_raw_fresh :" + name);
  endifdef
  
  O readMode = mechMode().readMode;
  if (readMode instanceof File) {
    S md5Name = uniqueFileNameUsingMD5_80_v2(upper(name));
    ret loadTextFileFromZipFile((File) readMode, md5Name);
  }
  ifclass VirtualMechLists
  else if (readMode cast VirtualMechLists)
    ret readMode.mL_raw(name);
  endif

  bool useLocal = false, useRemote = true;
  if (eq(readMode, 'mergeLocalAndRemote))
    useLocal = true;
  else if (eq(readMode, 'local)) {
    useLocal = true; useRemote = false;
  }
   
  S s = "";
  
  if (useRemote) {
    if (eq(mechMode().readMode, 'localCopies))
      s = unnull(loadTextFile(remoteMechListMirrorFile(name)));
    else
      s = serverMechList_raw_fresh(name, true);
  }
  
  if (useLocal)
    s = appendNewLineIfNempty(s) + localMechList_opt_raw_fresh(name);
  
  ret s;
}

Author comment

Began life as a copy of #1014030

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv

No comments. add comment

Snippet ID: #1014210
Snippet name: mechList_opt_raw_fresh
Eternal ID of this version: #1014210/16
Text MD5: 468cf8907b22d033ddafa36d7cac3086
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-09 20:30:19
Source code size: 965 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 449 / 587
Version history: 15 change(s)
Referenced in: [show references]