Skip to content

Commit a46590d

Browse files
committed
Merge branch 'master' of https://github.com/iluvcapra/wavinfo into feature-smpl
2 parents f0353ab + c6f66b2 commit a46590d

File tree

8 files changed

+66
-41
lines changed

8 files changed

+66
-41
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ venv_docs/
110110
.DS_Store
111111

112112
.vscode/
113+
114+
poetry.lock

docs/source/conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,25 @@
1212
# add these directories to sys.path here. If the directory is relative to the
1313
# documentation root, use os.path.abspath to make it absolute, like shown here.
1414
#
15+
import importlib
1516
import os
1617
import sys
1718
sys.path.insert(0, os.path.abspath('../..'))
1819
sys.path.insert(0, os.path.abspath("../../.."))
1920
print(sys.path)
2021

21-
import wavinfo
22+
import importlib
2223

2324
# -- Project information -----------------------------------------------------
2425

2526
project = u'wavinfo'
26-
copyright = u'2018-2023, Jamie Hardt'
27+
copyright = u'2018-2024, Jamie Hardt'
2728
author = u'Jamie Hardt'
2829

2930
# The short X.Y version
30-
version = wavinfo.__short_version__
31+
version = "3.1"
3132
# The full version, including alpha/beta/rc tags
32-
release = wavinfo.__version__
33+
release = importlib.metadata.version("wavinfo")
3334

3435

3536
# -- General configuration ---------------------------------------------------

docs/source/references.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ iXML
3939
Sampler Metadata
4040
----------------
4141

42-
* `RecordingBlogs.com — Sample chunk (of a Wave file)<https://www.recordingblogs.com/wiki/sample-chunk-of-a-wave-file>`_
42+
* `RecordingBlogs.com — Sample chunk (of a Wave file) <https://www.recordingblogs.com/wiki/sample-chunk-of-a-wave-file>`_
4343

4444
RIFF Metadata
4545
-------------

pyproject.toml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
# https://python-poetry.org/docs/pyproject/
2+
13
[build-system]
2-
requires = ["flit_core >=3.2,<4"]
3-
build-backend = "flit_core.buildapi"
4+
requires = ["poetry-core"]
5+
build-backend = "poetry.core.masonry.api"
46

5-
[project]
7+
[tool.poetry]
68
name = "wavinfo"
7-
authors = [{name = "Jamie Hardt", email = "jamiehardt@me.com"}]
9+
version = "3.0.1"
10+
description = "Probe WAVE files for all metadata"
11+
authors = ["Jamie Hardt <jamiehardt@me.com>"]
12+
license = "MIT"
813
readme = "README.md"
9-
dynamic = ["version", "description"]
10-
requires-python = "~=3.8"
1114
classifiers = [
1215
'Development Status :: 5 - Production/Stable',
1316
'License :: OSI Approved :: MIT License',
@@ -20,9 +23,10 @@ classifiers = [
2023
"Programming Language :: Python :: 3.12",
2124
"Programming Language :: Python :: 3.13"
2225
]
23-
dependencies = [
24-
"lxml ~= 5.3.0"
25-
]
26+
homepage = "https://github.com/iluvcapra/wavinfo"
27+
repository = "https://github.com/iluvcapra/wavinfo.git"
28+
documentation = "https://wavinfo.readthedocs.io/"
29+
urls.Tracker = 'https://github.com/iluvcapra/wavinfo/issues'
2630
keywords = [
2731
'waveform',
2832
'metadata',
@@ -35,29 +39,17 @@ keywords = [
3539
'broadcast'
3640
]
3741

38-
[tool.flit.module]
39-
name = "wavinfo"
42+
[tool.poetry.extras]
43+
doc = ['sphinx', 'sphinx_rtd_theme']
4044

41-
[project.optional-dependencies]
42-
doc = [
43-
'sphinx >= 5.3.0',
44-
'sphinx_rtd_theme >= 1.1.1',
45-
]
46-
47-
[project.urls]
48-
Home = "https://github.com/iluvcapra/wavinfo"
49-
Documentation = "https://wavinfo.readthedocs.io/"
50-
Source = "https://github.com/iluvcapra/wavinfo.git"
51-
Issues = 'https://github.com/iluvcapra/wavinfo/issues'
52-
53-
[project.entry_points.console_scripts]
45+
[tool.poetry.scripts]
5446
wavinfo = 'wavinfo.__main__:main'
5547

56-
[project.scripts]
57-
wavinfo = "wavinfo.__main__:main"
58-
59-
[tool.flit.external-data]
60-
directory = "data"
48+
[tool.poetry.dependencies]
49+
python = "^3.8"
50+
lxml = "~= 5.3.0"
51+
sphinx_rtd_theme = {version= '>= 1.1.1', optional=true}
52+
sphinx = {version= '>= 5.3.0', optional=true}
6153

6254
[tool.pyright]
6355
typeCheckingMode = "basic"

wavinfo/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@
44

55
from .wave_reader import WavInfoReader
66
from .riff_parser import WavInfoEOFError
7-
8-
__version__ = '3.0.0'
9-
__short_version__ = '3.0.0'

wavinfo/__main__.py

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import datetime
21
from . import WavInfoReader
3-
from . import __version__
42

3+
import datetime
54
from optparse import OptionParser
65
import sys
6+
import os
77
import json
88
from enum import Enum
9+
import importlib.metadata
910
from base64 import b64encode
1011

1112

@@ -24,10 +25,22 @@ class MissingDataError(RuntimeError):
2425

2526

2627
def main():
28+
version = importlib.metadata.version('wavinfo')
29+
manpath = os.path.dirname(__file__) + "/man"
2730
parser = OptionParser()
2831

2932
parser.usage = 'wavinfo (--adm | --ixml) <FILE> +'
3033

34+
# parser.add_option('--install-manpages',
35+
# help="Install manual pages for wavinfo",
36+
# default=False,
37+
# action='store_true')
38+
39+
parser.add_option('--man',
40+
help="Read the manual and exit.",
41+
default=False,
42+
action='store_true')
43+
3144
parser.add_option('--adm', dest='adm',
3245
help='Output ADM XML',
3346
default=False,
@@ -39,6 +52,26 @@ def main():
3952
action='store_true')
4053

4154
(options, args) = parser.parse_args(sys.argv)
55+
56+
# if options.install_manpages:
57+
# print("Installing manpages...")
58+
# print(f"Docfiles at {__file__}")
59+
# return
60+
61+
if options.man:
62+
import shlex
63+
print("Which man page?")
64+
print("1) wavinfo usage")
65+
print("7) General info on Wave file metadata")
66+
m = input("?> ")
67+
68+
args = ["man", "-M", manpath, "1", "wavinfo"]
69+
if m.startswith("7"):
70+
args[3] = "7"
71+
72+
os.system(shlex.join(args))
73+
return
74+
4275
for arg in args[1:]:
4376
try:
4477
this_file = WavInfoReader(path=arg)
@@ -56,7 +89,7 @@ def main():
5689
ret_dict = {
5790
'filename': arg,
5891
'run_date': datetime.datetime.now().isoformat(),
59-
'application': "wavinfo " + __version__,
92+
'application': f"wavinfo {version}",
6093
'scopes': {}
6194
}
6295
for scope, name, value in this_file.walk():
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ With no options,
1717
will emit a JSON (Javascript Object Notation) object containing all
1818
detected metadata.
1919
.IP "\-\-adm"
20-
Output any Audio Definition Model (ADM) metadata in
20+
Output Audio Definition Model (ADM) XML metadata in
2121
.BR FILE .
2222
.IP "\-\-ixml"
2323
Output any iXML metdata in

0 commit comments

Comments
 (0)