Skip to content

Commit

Permalink
adds main with warning that not for command-line usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasohara committed Jan 16, 2024
1 parent 086dbfa commit a370884
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mezcla/os_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
from mezcla import debug
from mezcla import system

# Constants
TL = debug.TL


def split_extension(path):
"""Returns basename and extension for PATH"""
Expand All @@ -28,3 +31,19 @@ def split_extension(path):
pass
debug.trace(5, f"split_extension({path}) => {result}")
return result


def main(*args, **kwargs):
"""Supporting code for command-line processing"""
debug.trace_fmtd(6, "main{a}; kw=", a=args, kw=kwargs)
system.print_stderr("Warning: {f} not intended for direct invocation!",
f=system.filename_proper(__file__))
return

#-------------------------------------------------------------------------------

if __name__ == '__main__':
debug.trace_current_context(level=TL.QUITE_VERBOSE)
debug.trace(5, f"module __doc__: {__doc__}")
debug.assertion("TODO:" not in __doc__)
main()

0 comments on commit a370884

Please sign in to comment.