Skip to content

Commit

Permalink
Added doc strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahGale committed Jan 18, 2024
1 parent 89a29f1 commit 522820c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions montepy/_scripts/change_to_ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@


def define_args(args):
"""
Parses the arguments from the command line.
:param args: the arguments from the command line.
:type args: list
:returns: the parsed arguments (with argparse)
:rtype: argparse.Namespace
"""
parser = argparse.ArgumentParser(
prog="Change_to_ascii",
description="Change the encoding of a file to strict ASCII. Everything not compliant will be removed.",
Expand All @@ -29,6 +37,12 @@ def define_args(args):


def strip_characters(args):
"""
Strips non-ascii characters from the input file, and writes out the output file.
:param args: the parsed command line arguments.
:type args: argparse.Namespace
"""
if args.whitespace:
replacer = " "
elif args.delete:
Expand Down Expand Up @@ -57,6 +71,12 @@ def strip_characters(args):


def main(args=None):
"""
Main runner function.
:param args: The arguments passed from the command line.
:type args: list
"""
if args is None:
args = sys.argv[1:]
args = define_args(args)
Expand Down

0 comments on commit 522820c

Please sign in to comment.