Skip to content

Commit 7d72026

Browse files
committed
[diff] add docstring for external_diff function
1 parent 3ff69ac commit 7d72026

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

lib/fdiff/diff.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#
2424
# TODO: add docstrings for all private functions
2525

26+
2627
def _async_fetch_files(dirpath, urls):
2728
loop = asyncio.get_event_loop()
2829
tasks = loop.run_until_complete(
@@ -175,6 +176,7 @@ def u_diff(
175176
context_lines: (int) number of context lines to include in the diff (default=3)
176177
include_tables: (list of str) Python list of OpenType tables to include in the diff
177178
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
179+
use_multiprocess: (bool) use multi-processor optimizations (default=True)
178180
179181
include_tables and exclude_tables are mutually exclusive arguments. Only one should
180182
be defined
@@ -224,7 +226,24 @@ def external_diff(
224226
exclude_tables=None,
225227
use_multiprocess=True,
226228
):
227-
# TODO: Add docstring documentation
229+
"""Performs a unified diff on a TTX serialized data format dump of font binary data using
230+
an external diff executable that is requested by the caller via `command`
231+
232+
command: (string) command line executable string and arguments to define execution
233+
filepath_a: (string) pre-file local file path or URL path
234+
filepath_b: (string) post-file local file path or URL path
235+
include_tables: (list of str) Python list of OpenType tables to include in the diff
236+
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
237+
use_multiprocess: (bool) use multi-processor optimizations (default=True)
238+
239+
include_tables and exclude_tables are mutually exclusive arguments. Only one should
240+
be defined
241+
242+
:returns: Generator of ordered diff line strings that include newline line endings
243+
:raises: KeyError if include_tables or exclude_tables includes a mis-specified table
244+
that is not included in filepath_a OR filepath_b
245+
:raises: IOError if exception raised during execution of `command` on TTX files
246+
:raises: fdiff.exceptions.AIOError if GET request to URL returned non-200 response status code"""
228247
with tempfile.TemporaryDirectory() as tmpdirpath:
229248
# define the file paths with either local file requests
230249
# or HTTP GET requests of remote files based on the command line request

0 commit comments

Comments
 (0)