Skip to content
Snippets Groups Projects
Unverified Commit 5687aebd authored by mirabilos's avatar mirabilos Committed by mirabilos
Browse files

add showmeta command

parent 51d99925
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ __all__ = [ ...@@ -26,6 +26,7 @@ __all__ = [
"mml2musicxml", "mml2musicxml",
"mml2nxcmono", "mml2nxcmono",
"mmllint", "mmllint",
"showmeta",
] ]
import argparse import argparse
...@@ -35,7 +36,7 @@ from pprint import pprint ...@@ -35,7 +36,7 @@ from pprint import pprint
from .musicxml import convert_mml_file as convert_mml_file_to_musicxml from .musicxml import convert_mml_file as convert_mml_file_to_musicxml
from .mml import mml from .mml import mml
from .nxc import convert_mml_track as convert_mml_track_to_nxc from .nxc import convert_mml_track as convert_mml_track_to_nxc
from .parser import mml_file from .parser import mml_file, mml_file_meta
from .playlist import convert_to_timedlist, timedlist_duration, timedlist_ntracks from .playlist import convert_to_timedlist, timedlist_duration, timedlist_ntracks
def _filter(func): def _filter(func):
...@@ -115,3 +116,17 @@ def mmllint(): ...@@ -115,3 +116,17 @@ def mmllint():
print("No errors.") print("No errors.")
return 0 return 0
mmllint._shortdesc = 'checks MML for some errors' mmllint._shortdesc = 'checks MML for some errors'
def showmeta():
""" Entry point for displaying extended MML metadata
Returns 0 on success, >0 on error.
"""
# parse arguments
aparser = argparse.ArgumentParser()
aparser.add_argument("path", help="path to the file to convert")
args = aparser.parse_args()
pprint(mml_file_meta(args.path))
showmeta._shortdesc = 'displays extended MML file metadata'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment