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

34
LINES

< > BotCompany Repo | #1028784 // Zip + LineComp all JavaX Text snippets (from local snippets DB) [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 11335K of libraries. Click here for Pure Java version (14297L/103K).

1  
!7
2  
3  
sclass ZipTextSnippets > DynSingleFunctionWithPrintLog {
4  
  switchable bool withPrivate;
5  
  
6  
  void doIt ctex {
7  
    bool withPrivate = ZipTextSnippets.this.withPrivate;
8  
    L snippets = cast call(dm_getModule(dm_snippetsDB()), 'allSnippets);
9  
    print("Got " + n2(snippets, "snippet"));
10  
    
11  
    File zipFile = javaxBackupDir("botcompany-texts-" + ymdWithMinuses() + (withPrivate ? "-with-private" : "") + ".zip");
12  
    print("Zipping to " + zipFile + "...");
13  
    new TreeMap<Long, S> titles;
14  
    {
15  
      temp ZipOutputStream zipOut = zipOutputStream(zipFile);
16  
      new Var<Long> size;
17  
      for (O sn : snippets) {
18  
        if (!withPrivate && !isTrue(get isPublic(sn))) continue;
19  
        if (eq(rcall textLength(sn), 0)) continue;
20  
        long id = getLong(sn, 'snippetID);
21  
        S title = getString title(sn);
22  
        titles.put(id, title);
23  
        addFileToZip(zipOut, (File) call(sn, 'file), id + ".text");
24  
        if (setVar_trueIfChanged(size, fileSizeInMegabytes_floor(zipFile)))
25  
          print(size + " MB");
26  
      }
27  
      zip_addTextFile(zipOut, "titles.text", mapToLines(titles,
28  
        (id, title) -> id + ": " + firstLine(title));
29  
    }
30  
    printFileInfo(zipFile);
31  
    zipToLineComp(zipFile);
32  
    //uploadFileToFileServer(zipFile, zipFile.getName());
33  
  }
34  
}

Author comment

Began life as a copy of #1018036

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028784
Snippet name: Zip + LineComp all JavaX Text snippets (from local snippets DB) [Dyn Module]
Eternal ID of this version: #1028784/11
Text MD5: a851b6a7d613725e8bcaeca976913b43
Transpilation MD5: 3b3237feb5c81ef006e8634b2627d553
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-16 15:28:30
Source code size: 1306 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 319 / 1062
Version history: 10 change(s)
Referenced in: [show references]