mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 08:50:41 +00:00
Reorganized man files to fall inside module
This commit is contained in:
@@ -38,9 +38,6 @@ keywords = [
|
|||||||
'film',
|
'film',
|
||||||
'broadcast'
|
'broadcast'
|
||||||
]
|
]
|
||||||
include = [
|
|
||||||
{ path = "data/", format = ["sdist", "wheel"] },
|
|
||||||
]
|
|
||||||
|
|
||||||
[tool.poetry.extras]
|
[tool.poetry.extras]
|
||||||
doc = ['sphinx', 'sphinx_rtd_theme']
|
doc = ['sphinx', 'sphinx_rtd_theme']
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
import datetime
|
|
||||||
from . import WavInfoReader
|
from . import WavInfoReader
|
||||||
|
|
||||||
|
import datetime
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import sys
|
import sys, os
|
||||||
import json
|
import json
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
|
|
||||||
version = importlib.metadata.version('wavinfo')
|
|
||||||
|
|
||||||
|
|
||||||
class MyJSONEncoder(json.JSONEncoder):
|
class MyJSONEncoder(json.JSONEncoder):
|
||||||
def default(self, o):
|
def default(self, o):
|
||||||
@@ -25,10 +21,22 @@ class MissingDataError(RuntimeError):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
version = importlib.metadata.version('wavinfo')
|
||||||
|
manpath = os.path.dirname(__file__) + "/man"
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
|
|
||||||
parser.usage = 'wavinfo (--adm | --ixml) <FILE> +'
|
parser.usage = 'wavinfo (--adm | --ixml) <FILE> +'
|
||||||
|
|
||||||
|
parser.add_option('--install-manpages',
|
||||||
|
help="Install manual pages for wavinfo",
|
||||||
|
default=False,
|
||||||
|
action='store_true')
|
||||||
|
|
||||||
|
parser.add_option('--man',
|
||||||
|
help="Read the manual",
|
||||||
|
default=False,
|
||||||
|
action='store_true')
|
||||||
|
|
||||||
parser.add_option('--adm', dest='adm',
|
parser.add_option('--adm', dest='adm',
|
||||||
help='Output ADM XML',
|
help='Output ADM XML',
|
||||||
default=False,
|
default=False,
|
||||||
@@ -40,6 +48,25 @@ def main():
|
|||||||
action='store_true')
|
action='store_true')
|
||||||
|
|
||||||
(options, args) = parser.parse_args(sys.argv)
|
(options, args) = parser.parse_args(sys.argv)
|
||||||
|
|
||||||
|
if options.install_manpages:
|
||||||
|
print("Installing manpages...")
|
||||||
|
print(f"Docfiles at {__file__}")
|
||||||
|
return
|
||||||
|
|
||||||
|
if options.man:
|
||||||
|
print("Which man page?")
|
||||||
|
print("1) wavinfo usage")
|
||||||
|
print("7) General info on Wave file metadata")
|
||||||
|
m = input("?> ")
|
||||||
|
|
||||||
|
if m.startswith("1"):
|
||||||
|
os.system(f"man -M {manpath} 1 wavinfo")
|
||||||
|
elif m.startswith("7"):
|
||||||
|
os.system(f"man -M {manpath} 7 wavinfo")
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
for arg in args[1:]:
|
for arg in args[1:]:
|
||||||
try:
|
try:
|
||||||
this_file = WavInfoReader(path=arg)
|
this_file = WavInfoReader(path=arg)
|
||||||
@@ -57,7 +84,7 @@ def main():
|
|||||||
ret_dict = {
|
ret_dict = {
|
||||||
'filename': arg,
|
'filename': arg,
|
||||||
'run_date': datetime.datetime.now().isoformat(),
|
'run_date': datetime.datetime.now().isoformat(),
|
||||||
'application': "wavinfo " + version,
|
'application': f"wavinfo {version}",
|
||||||
'scopes': {}
|
'scopes': {}
|
||||||
}
|
}
|
||||||
for scope, name, value in this_file.walk():
|
for scope, name, value in this_file.walk():
|
||||||
|
|||||||
Reference in New Issue
Block a user