Skip to content

Commit 7febe1b

Browse files
committed
adjust line length to maintain length < 90
1 parent d09f9b7 commit 7febe1b

File tree

4 files changed

+37
-28
lines changed

4 files changed

+37
-28
lines changed

lib/fdiff/__main__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,16 @@ def run(argv):
124124
# head and tail are not supported when external diff tool is called
125125
if args.head or args.tail:
126126
sys.stderr.write(
127-
f"[ERROR] The head and tail options are not supported with external diff executable calls.{os.linesep}"
127+
f"[ERROR] The head and tail options are not supported with external "
128+
f"diff executable calls.{os.linesep}"
128129
)
129130
sys.exit(1)
130131

131132
# lines of context filter is not supported when external diff tool is called
132133
if args.lines != 3:
133134
sys.stderr.write(
134-
f"[ERROR] The lines option is not supported with external diff executable calls.{os.linesep}"
135+
f"[ERROR] The lines option is not supported with external diff "
136+
f"executable calls.{os.linesep}"
135137
)
136138
sys.exit(1)
137139

lib/fdiff/diff.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def _async_fetch_files(dirpath, urls):
3939
elif task.result().http_status != 200:
4040
# handle non-200 HTTP response status codes + file write fails
4141
raise AIOError(
42-
f"failed to pull '{task.result().url}' with HTTP status code {task.result().http_status}"
42+
f"failed to pull '{task.result().url}' with HTTP status "
43+
f"code {task.result().http_status}"
4344
)
4445

4546

@@ -188,7 +189,8 @@ def u_diff(
188189
that is not included in filepath_a OR filepath_b
189190
:raises: fdiff.exceptions.AIOError if exception raised during execution of async I/O
190191
GET request for URL or file write
191-
:raises: fdiff.exceptions.AIOError if GET request to URL returned non-200 response status code"""
192+
:raises: fdiff.exceptions.AIOError if GET request to URL returned non-200 response
193+
status code"""
192194
with tempfile.TemporaryDirectory() as tmpdirpath:
193195
# define the file paths with either local file requests
194196
# or HTTP GET requests of remote files based on the command line request
@@ -236,23 +238,24 @@ def external_diff(
236238
use_multiprocess=True,
237239
):
238240
"""Performs a unified diff on a TTX serialized data format dump of font binary data using
239-
an external diff executable that is requested by the caller via `command`
240-
241-
command: (string) command line executable string and arguments to define execution
242-
filepath_a: (string) pre-file local file path or URL path
243-
filepath_b: (string) post-file local file path or URL path
244-
include_tables: (list of str) Python list of OpenType tables to include in the diff
245-
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
246-
use_multiprocess: (bool) use multi-processor optimizations (default=True)
247-
248-
include_tables and exclude_tables are mutually exclusive arguments. Only one should
249-
be defined
250-
251-
:returns: Generator of ordered diff line strings that include newline line endings
252-
:raises: KeyError if include_tables or exclude_tables includes a mis-specified table
253-
that is not included in filepath_a OR filepath_b
254-
:raises: IOError if exception raised during execution of `command` on TTX files
255-
:raises: fdiff.exceptions.AIOError if GET request to URL returned non-200 response status code"""
241+
an external diff executable that is requested by the caller via `command`
242+
243+
command: (string) command line executable string and arguments to define execution
244+
filepath_a: (string) pre-file local file path or URL path
245+
filepath_b: (string) post-file local file path or URL path
246+
include_tables: (list of str) Python list of OpenType tables to include in the diff
247+
exclude_tables: (list of str) Python list of OpentType tables to exclude from the diff
248+
use_multiprocess: (bool) use multi-processor optimizations (default=True)
249+
250+
include_tables and exclude_tables are mutually exclusive arguments. Only one should
251+
be defined
252+
253+
:returns: Generator of ordered diff line strings that include newline line endings
254+
:raises: KeyError if include_tables or exclude_tables includes a mis-specified table
255+
that is not included in filepath_a OR filepath_b
256+
:raises: IOError if exception raised during execution of `command` on TTX files
257+
:raises: fdiff.exceptions.AIOError if GET request to URL returned non-200 response
258+
status code"""
256259
with tempfile.TemporaryDirectory() as tmpdirpath:
257260
# define the file paths with either local file requests
258261
# or HTTP GET requests of remote files based on the command line request

lib/fdiff/remote.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def _get_filepath_from_url(url, dirpath):
2020

2121

2222
async def async_fetch(session, url):
23-
"""Asynchronous I/O HTTP GET request with a ClientSession instantiated from the aiohttp library."""
23+
"""Asynchronous I/O HTTP GET request with a ClientSession instantiated
24+
from the aiohttp library."""
2425
async with session.get(url) as response:
2526
status = response.status
2627
if status != 200:
@@ -31,8 +32,9 @@ async def async_fetch(session, url):
3132

3233

3334
async def async_fetch_and_write(session, url, dirpath):
34-
"""Asynchronous I/O HTTP GET request with a ClientSession instantiated from the aiohttp library, followed
35-
by an asynchronous I/O file write of the binary to disk with the aiofiles library.
35+
"""Asynchronous I/O HTTP GET request with a ClientSession instantiated
36+
from the aiohttp library, followed by an asynchronous I/O file write of
37+
the binary to disk with the aiofiles library.
3638
3739
:returns `FWRes` namedtuple with url, filepath, http_status, write_success fields"""
3840
FWResponse = namedtuple(
@@ -56,7 +58,8 @@ async def create_async_get_request_session_and_run(urls, dirpath):
5658
"""Creates an aiohttp library ClientSession and performs asynchronous GET requests +
5759
binary file writes with the binary response from the GET request.
5860
59-
:returns list of asyncio Tasks that include `FWRes` namedtuple instances (defined in async_fetch_and_write)"""
61+
:returns list of asyncio Tasks that include `FWRes` namedtuple instances
62+
(defined in async_fetch_and_write)"""
6063
async with aiohttp.ClientSession() as session:
6164
tasks = []
6265
for url in urls:

lib/fdiff/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ def get_file_modtime(path):
2020

2121

2222
def get_tables_argument_list(table_string):
23-
"""Converts a comma separated OpenType table string into a Python list or return None if
24-
the table_string was not defined (i.e., it was not included in an option on the command line).
25-
Tables that are composed of three characters must be right padded with a space."""
23+
"""Converts a comma separated OpenType table string into a Python list or
24+
return None if the table_string was not defined (i.e., it was not included
25+
in an option on the command line). Tables that are composed of three
26+
characters must be right padded with a space."""
2627
if table_string is None:
2728
return None
2829
else:

0 commit comments

Comments
 (0)