From 8de7ba0bf9a55f2b7f21dea47b52772c31a1e7a1 Mon Sep 17 00:00:00 2001 From: "John M. Horan" Date: Mon, 4 Dec 2017 17:35:40 -0800 Subject: [PATCH] Update docstrings to imperative style #26 Signed-off-by: John M. Horan --- src/deltacode/__init__.py | 8 ++++---- src/deltacode/cli.py | 6 +++--- src/deltacode/models.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/deltacode/__init__.py b/src/deltacode/__init__.py index b17399c4..6b7c1a55 100644 --- a/src/deltacode/__init__.py +++ b/src/deltacode/__init__.py @@ -35,7 +35,7 @@ class DeltaCode(object): """ - Handles the basic operations on a pair of incoming ScanCode scans (in JSON + Handle the basic operations on a pair of incoming ScanCode scans (in JSON format) and the Delta objects created from a comparison of the files (in the form of File objects) contained in those scans. """ @@ -46,9 +46,9 @@ def __init__(self, new_path, old_path): def align_scan(self): """ - Seeks to align the paths of a pair of files (File objects) in the pair + Seek to align the paths of a pair of files (File objects) in the pair of incoming scans so that the attributes and other characteristics of - the files can be compared with one another. Calls utils.fix_trees(), + the files can be compared with one another. Call utils.fix_trees(), which calls utils.align_trees(). """ try: @@ -63,7 +63,7 @@ def determine_delta(self): """ Given new and old scans, return an OrderedDict of Delta objects grouping the objects under the keys 'added', 'modified', 'removed' or 'unmodified'. - Returns None if no File objects can be loaded from either scan. + Return None if no File objects can be loaded from either scan. """ if self.new.files is None or self.old.files is None: return None diff --git a/src/deltacode/cli.py b/src/deltacode/cli.py index 5f642dfb..629fd038 100644 --- a/src/deltacode/cli.py +++ b/src/deltacode/cli.py @@ -71,11 +71,11 @@ def generate_json(delta, result_file): @click.option('-j', '--json-file', prompt=False, type=click.Path(exists=False), help='Identify the path to the .json output file') def cli(new, old, csv_file, json_file): """ - This script identifies the changes that need to be made to the 'old' + Identify the changes that need to be made to the 'old' scan file (-o or -old) in order to generate the 'new' scan file (-n or - -new). The results are written to a .csv file (-c or -csv-file) or a + -new). Write the results to a .csv file (-c or -csv-file) or a .json file (-j or -json-file) at a user-designated location. If no file - option is selected, the JSON results are printed to the console. + option is selected, print the JSON results to the console. """ # do the delta delta = DeltaCode(new, old) diff --git a/src/deltacode/models.py b/src/deltacode/models.py index 353cc2cf..d8bf91f9 100644 --- a/src/deltacode/models.py +++ b/src/deltacode/models.py @@ -32,7 +32,7 @@ class Scan(object): """ - Processes the files contained in an incoming ScanCode scan to test whether + Process the files contained in an incoming ScanCode scan to test whether they are valid, retrieve the scan's 'files_count' value, create a list of File objects, and generate a dictionary of File objects indexed by a selected key.