diff --git a/.gitignore b/.gitignore index 9414613dd..e22c10752 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ kanjivg.xml *.pyc kanjivg-*xml.gz kanjivg-*.zip +stripped/* diff --git a/README.md b/README.md index 16a29e321..4404cad38 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/clean.py b/clean.py index 8d892df9c..84157f33f 100755 --- a/clean.py +++ b/clean.py @@ -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) diff --git a/kvg.py b/kvg.py index bf452bfc2..a54b3e544 100755 --- a/kvg.py +++ b/kvg.py @@ -20,6 +20,8 @@ import sys, os, re, datetime from kanjivg import licenseString from utils import open +verbose = False + pathre = re.compile(r'') helpString = """Usage: %s [ kanji files ] @@ -90,7 +92,8 @@ def release(): out.write(data) out.write("\n") out.close() - print("%d kanji emitted" % len(files)) + if verbose: + print("%d kanji emitted" % len(files)) actions = { "split": (createPathsSVG, 2), diff --git a/updatepublic.sh b/updatepublic.sh index 49ce58688..439b939a7 100755 --- a/updatepublic.sh +++ b/updatepublic.sh @@ -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