Skip to content

Conversation

@alexjeffburke
Copy link

This commit adds a basic argparse based package level main file which given a filename and a named excavator will perform an excavation and output the usual HTML files.

By default this uses the standard temporary path, but additionally support specifying -d and allow a directory argument of "." which will cause outputting output folder in the cwd: ./output/_autoarchaologist

In order to ensure things are working include tests of the new command line as well as the basic operation of excavating the example file. The tests check the expected HTML files were written for this known input and assert some basic properties of the excavated artifacts.

While here repair the example excavation. The excavation it executes is explicitly declared thus CLI selectable as --excavator examples.showcase

This commit adds a package level main file which uses argparse to
expose a CLI. Given a filename and a named excavator will perform
an excavation and output the usual HTML files. Default to writing
to the classic /tmp output path, but provide support for specifying
a -d option to relocate the output directory.

 allow a directory argument of "." which will
cause outputting output folder in the cwd: ./output/_autoarchaologist

In order to ensure things are working include tests of the new command
line as well as the basic operation of excavating the example file. The
tests check the expected HTML files were written for this known input
and assert some basic properties of the excavated artifacts.

While here repair the example excavation which was not functional after
recent renaming. In addition, multiple runs of the test suite showed
that the temporary file cleanup placed in __del__ could occur as such
a point as to cause an exception opening the file. Move the removal to
such that it occurs after its content is consumed and is safe to remove.
@alexjeffburke alexjeffburke force-pushed the dunder-main-groundwork branch from cd9f204 to d589ed4 Compare April 10, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant