gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit23b9164a23b9164aMdEditor: a clipboard whose text is only the names or file:// paths of its files (a file manager copy) is about the files, as before; any other text wins (tickets#49); gate casesmre23b9164a/tests/same-output-compare.py

1.3 KB

  1. #!/usr/bin/env python3
  2. # tests/same-output-compare.py (components mission 002): compare two tests/same-output.mjs runs. Masks only what changes per run / per code hash: ?v= hashes, source positions
  3. # (file.hl:L:C), the seed time, upload names (time-random), the hl-shell cache name. python3 compare.py A B [-v]
  4. import os, re, sys, difflib
  5. a, b = sys.argv[1], sys.argv[2]; v = '-v' in sys.argv
  6. def mask(t):
  7. t = re.sub(r'\?v=[0-9a-f]+', '?v=H', t)
  8. t = re.sub(r'(\w[\w./-]*\.hl):\d+:\d+', r'\1:L:C', t)
  9. t = re.sub(r'@\d+:\d+', '@L:C', t)
  10. t = re.sub(r'hl-shell-[0-9a-f]+', 'hl-shell-H', t)
  11. t = re.sub(r'/md-editor/files/\d+-[0-9a-f]+', '/md-editor/files/T-R', t)
  12. t = re.sub(r'\b1[78]\d{11}\b', 'TIME', t)
  13. t = re.sub(r'("version"|"build"|"seed"|"now")\s*:\s*"?[\w.-]+"?', r'\1:X', t)
  14. return t
  15. fa, fb = sorted(os.listdir(a)), sorted(os.listdir(b))
  16. same = diff = 0
  17. for f in sorted(set(fa) | set(fb)):
  18. if f not in fa or f not in fb: print('ONLY IN', 'A' if f in fa else 'B', f); diff += 1; continue
  19. x, y = mask(open(os.path.join(a, f), errors='replace').read()), mask(open(os.path.join(b, f), errors='replace').read())
  20. if x == y: same += 1; continue
  21. diff += 1; print('DIFF', f)
  22. if v:
  23. for l in list(difflib.unified_diff(re.split(r'(?<=[;,}>\n])', x), re.split(r'(?<=[;,}>\n])', y), lineterm='', n=0))[2:40]: print(' ', l[:300])
  24. print(f'same {same}, different {diff}')

Branches

Latest commits

  • 23b9164aMdEditor: a clipboard whose text is only the names or file:// paths of its files (a file manager copy) is about the files, as before; any other text wins (tickets#49); gate casesmre
  • b0f1ec28MdEditor: a clipboard with text always pastes the text, also when a picture is on it too (a spreadsheet or office app), files on or off; a picture alone still goes to the files; real Ctrl+V gate tests/md-paste-files.mjs (tickets#49)mre
  • 4bd11128MdEditor: the Table button's empty table is written as a real pipe table (empty cells), so it survives the source switch, a save and a reload (notes#7)mre
  • 7437e32bMdEditor draws its surface at once when claimed from server HTML: 1 ms mount animation, the first editor mounts all editors of the pagemre
  • 5de0264cRe-vendor onto Hybriel master acaceaf3 (set-day27b): binary, lib and plugins; exit 1 on a startup fault; .gitignore binmre
  • 79c77e7dMerge sb3-standby: components deploys through its standbymre
  • c5442043components: no jobs switch needed in the standbymre
  • 8d2fb24ccomponents: a standby container (port 45016, profile standby); deploy hands over through standby-swap.sh without a gapmre
  • c2834dd3Merge mr-fixes: media player state after a queue pick, Range handling, cover-less audio, accessibility labelsmre
  • 354fe3c6Media player: audio without a cover starts and shows its time (the mount tick sits on the seek bar, which every item has); the speed button names the current speed, the seek slider says its time in words; a gate page for the first render on cover-less audio and a fourth demo queue item without a covermre
  • ee4aee1eMedia player: a new queue item shows its own speed, mute, play state and time and starts when asked, also for two videos in a row; the media route reads suffix ranges and ignores range lists and garbage instead of answering 500; stronger gate checks (the 10 percent drag, the played bar, the queue tap)mre
  • 9a4f9b31Merge mp-player: media served from the committed filesmre
  • ab96e686Media route: serve the demo's media from the committed files in components/media-player (storage/ is not in git, the deploy gate found no files)mre
  • b2980734Merge mp-player: the media player (components/media-player), its demo and the media iconsmre
  • 1c41293eMediaPlayer: back / forward 10 s as replay / forward 10 icons (circular arrow with a 10), the play button keeps its surface background on audio and video, the media route's range end is a letmre
  • 9e1ab228MP: report, LOG line, STATUS entrymre
  • dd003e5dMediaPlayer: audio and video in one phone-first player (components/media-player), its demo /media-player with a queue, the media icons in components/icons, the demo's media files served with ranges (lib/media.hl), 35 gate checksmre
  • e54f83adMdEditor: text typed before the editor is built is kept (the build takes it in once, the input handler no longer writes it to the field first), tickets#35mre
  • 8c920932gate: the 11 old drop-zone checks now test the one-box pick mode (drop anywhere in the box, Choose files button inside it, no drop zone)mre
  • 626de199MdEditor: copy and cut put the selection's Markdown on the clipboard, a clipboard with HTML only pastes its text, gate checks for copy, cut and paste (components#20)mre