Update argument names and documentation for clarity in main.py and README.md
This commit is contained in:
parent
e31ae00528
commit
329b076caf
2 changed files with 29 additions and 5 deletions
26
main.py
26
main.py
|
|
@ -30,7 +30,7 @@ class BookCollection(dict):
|
|||
keys = expand_range(sequence)
|
||||
|
||||
for key in keys:
|
||||
if not args.hors_series and not float(key).is_integer():
|
||||
if not args.non_series and not float(key).is_integer():
|
||||
continue
|
||||
self.setdefault(key, [])
|
||||
self[key].append(book.asin)
|
||||
|
|
@ -189,7 +189,7 @@ def main():
|
|||
except requests.exceptions.HTTPError:
|
||||
pass
|
||||
|
||||
if not found:
|
||||
if not found and args.oncoming:
|
||||
soon_to_release_books.append(key)
|
||||
logger.debug(
|
||||
"%s Book %d is yet to be released - %s",
|
||||
|
|
@ -216,9 +216,25 @@ def main():
|
|||
if __name__ == "__main__":
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-d", "--dev", action="store_true")
|
||||
parser.add_argument("-v", "--verbose", action="store_true")
|
||||
parser.add_argument("--hors-series", action="store_true")
|
||||
# General flags
|
||||
parser.add_argument(
|
||||
"-v", "--verbose", action="store_true", help="Enable verbose logging"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d", "--dev", action="store_true", help="Use development/mock connectors"
|
||||
)
|
||||
|
||||
# Feature-specific flags
|
||||
parser.add_argument(
|
||||
"--non-series",
|
||||
action="store_true",
|
||||
help="Include non-series books (books not part of a numbered series)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--oncoming",
|
||||
action="store_true",
|
||||
help="Show books to be released",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,14 @@ python main.py
|
|||
|
||||
Logs are written to the `log` file.
|
||||
|
||||
### Feature-specific Arguments
|
||||
|
||||
- `--non-series`
|
||||
Include non-series books (books not part of a numbered series).
|
||||
|
||||
- `--oncoming`
|
||||
Show books that are yet to be released.
|
||||
|
||||
## Project Structure
|
||||
|
||||
- [main.py](main.py): Entry point and main logic
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue