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)

1  
static S mechList_opt_raw_fresh(S name) {
2  
  ifdef mechList_raw_fresh_debug
3  
    print("mechList_raw_fresh :" + name);
4  
  endifdef
5  
  
6  
  O readMode = mechMode().readMode;
7  
  if (readMode instanceof File) {
8  
    S md5Name = uniqueFileNameUsingMD5_80_v2(upper(name));
9  
    ret loadTextFileFromZipFile((File) readMode, md5Name);
10  
  }
11  
  ifclass VirtualMechLists
12  
  else if (readMode cast VirtualMechLists)
13  
    ret readMode.mL_raw(name);
14  
  endif
15  
16  
  bool useLocal = false, useRemote = true;
17  
  if (eq(readMode, 'mergeLocalAndRemote))
18  
    useLocal = true;
19  
  else if (eq(readMode, 'local)) {
20  
    useLocal = true; useRemote = false;
21  
  }
22  
   
23  
  S s = "";
24  
  
25  
  if (useRemote) {
26  
    if (eq(mechMode().readMode, 'localCopies))
27  
      s = unnull(loadTextFile(remoteMechListMirrorFile(name)));
28  
    else
29  
      s = serverMechList_raw_fresh(name, true);
30  
  }
31  
  
32  
  if (useLocal)
33  
    s = appendNewLineIfNempty(s) + localMechList_opt_raw_fresh(name);
34  
  
35  
  ret s;
36  
}

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: 512 / 650
Version history: 15 change(s)
Referenced in: [show references]