Skip to content

Commit

Permalink
anemone formatting + type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ssb22 committed May 14, 2024
1 parent 3f6e345 commit 3c98845
Show file tree
Hide file tree
Showing 3 changed files with 457 additions and 148 deletions.
13 changes: 13 additions & 0 deletions Makefile.pypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- mode: Makefile -*-
check-if-anemone-version-is-changing:
if git diff|grep '^[+]Anemone [0-9]' >/dev/null; then make update-anemone-pypi; else true; fi
update-anemone-pypi:
mkdir anemone
cp ../anemone.py anemone/__init__.py
echo "import anemone;anemone.anemone()" > anemone/__main__.py
echo "from setuptools import setup, find_packages;setup(name='anemone_daisy_maker',version='$$(grep ^Anemone anemone.py|sed -e 's/[^ ]* //' -e 's/ .*//')',entry_points={'console_scripts':['anemone=anemone.__init__:anemone']},author='Silas S. Brown',author_email='ssb$$(echo 22@ca)m.ac.uk',description='Create DAISY digital talking books from HTML text, MP3 audio and JSON time index data',long_description='''$$(python3 -c 'import re;d=open("README.md").read();print(re.sub("[(]also mirrored.*[)]","",re.sub("--(?!help|-)","",chr(10).join(L for L in d[d.index(chr(10)+"Anemone"):].split(chr(10)) if not L.startswith("* Android") and not L.startswith("* Javascript") and not L.startswith("* Unicode")).replace("Python 3 script","module").replace("mp3-recode","mp3_recode"))).replace(chr(10)*3,chr(10)*2).strip())')''',long_description_content_type='text/markdown',packages=find_packages(),classifiers=['Programming Language :: Python :: 3','License :: OSI Approved :: Apache Software License','Operating System :: OS Independent'],python_requires='>=3.7',install_requires=['mutagen'])" > setup.py
python3 setup.py sdist
twine upload dist/*
rm -r anemone_daisy_maker.egg-info dist anemone setup.py
.PHONY: check-if-anemone-version-is-changing
.PHONY: update-anemone-pypi
3 changes: 3 additions & 0 deletions Makefile.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ test_anemone:
unzip -c output_daisy.zip ncc.html|grep '>test<' >/dev/null
./anemone.py --daisy3 test.wav
unzip -c output_daisy.zip navigation.ncx|grep '>test<' >/dev/null
./anemone.py --daisy3 test.wav '<h1 data-pid="T">heading</h1><p data-pid="U">para</p>' '{"markers":[{"id":"T","time":"1"},{"id":"U","time":"2"}]}'
unzip -c output_daisy.zip navigation.ncx|grep '<navLabel><text>heading</text><audio src="0001.mp3" clipBegin="0:00:00.000" clipEnd="0:00:02.000"/></navLabel>' >/dev/null
unzip -c output_daisy.zip 0001.smil|grep '<audio src="0001.mp3" clipBegin="0:00:02.000" clipEnd="0:00:03.000" id="aud1.1" />' >/dev/null
.PHONY: test test_ohi_latex test_anemone

0 comments on commit 3c98845

Please sign in to comment.