gm3dmo/syslog-to-csv

Problems with the __main__ file

JnyJny opened this issue · 0 comments

JnyJny commented

if __name__ == "__main__":
dist = distribution("bundlefun")
data_path = dist.locate_file("log-formats.json")
print(type(data_path), data_path)
exit(main())

You are missing an import to make this go:

from importlib.metadata import distribution

if __name__  == "__main__":

     success = True
    dist = distribution("bundlefun")
    path = dist.locate_file(...)
    ...
    return 0 if success else 1

The final line in your code exit(main()) is going to fail since you haven't written a main function to be called.