1
0
mirror of https://github.com/KanjiVG/kanjivg.git synced 2026-01-24 23:23:12 +01:00

Stripped file related changes

This adds an ignore, and a cleanup for the stripped directory, and
adds the zip file of stripped files to the release. It quietens
kvg.py. It adds a note on the stripped file to README.md.
This commit is contained in:
Ben Bullock
2024-08-08 10:10:17 +09:00
parent a4b51d966d
commit cbb107dd08
5 changed files with 22 additions and 3 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ kanjivg.xml
*.pyc
kanjivg-*xml.gz
kanjivg-*.zip
stripped/*

View File

@@ -31,6 +31,14 @@ This zip file contains all of the SVG files, including the variant
forms, in the same format as they were in the repository at the time
the release was made.
* kanjivg-YYYYMMDD-stripped.zip
This zip file contains all of the SVG files, including the variant
forms, but with all of the attributes such as the stroke type,
radical, or element removed from the files. This file is specifically
for people who use XML parsers which limit the use of user-defined
attributes.
* kanjivg-YYYYMMDD.xml.gz
The file kanjivg-YYYYMMDD.xml.gz contains all of the non-variant SVG

View File

@@ -3,7 +3,7 @@
# This script removes unnecessary files such as backups from Emacs or
# old release files.
import os, glob
import os, glob, shutil
# Print debugging information if set to a true value.
@@ -30,3 +30,7 @@ for file in emacsBackups:
if verbose:
print("Removing %s" % (file) )
os.remove(file)
stripped = 'stripped'
if os.path.exists(stripped):
shutil.rmtree(stripped)

5
kvg.py
View File

@@ -20,6 +20,8 @@ import sys, os, re, datetime
from kanjivg import licenseString
from utils import open
verbose = False
pathre = re.compile(r'<path .*d="([^"]*)".*/>')
helpString = """Usage: %s <command> [ kanji files ]
@@ -90,7 +92,8 @@ def release():
out.write(data)
out.write("</kanjivg>\n")
out.close()
print("%d kanji emitted" % len(files))
if verbose:
print("%d kanji emitted" % len(files))
actions = {
"split": (createPathsSVG, 2),

View File

@@ -3,10 +3,13 @@ d=`date +%Y%m%d`
outFileOne="kanjivg-$d.xml.gz"
outFileAll="kanjivg-$d-all.zip"
outFileMain="kanjivg-$d-main.zip"
outFileStripped="kanjivg-$d-stripped.zip"
zip -rq $outFileAll kanji/*.svg
zip -rq $outFileMain kanji/?????.svg
/home/ben/projects/kvgpub/cmd/strip/strip
zip -rq $outFileStripped stripped/*.svg
./kvg.py release
gzip -c kanjivg.xml >$outFileOne
release="r$d"
gh release create --generate-notes --prerelease $release $outFileOne $outFileAll $outFileMain
gh release create --generate-notes --prerelease $release $outFileOne $outFileAll $outFileMain $outFileStripped