Skip to content

Commit ced9191

Browse files
do not use unknown in/out
1 parent 7aaac45 commit ced9191

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

acclimatise/cli_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ class CliFileSystemType(CliType):
7979
Takes a directory / file path
8080
"""
8181

82-
output: bool = None
82+
output: bool = False
8383
"""
84-
Indicator if it is input or output (None if unknown)
84+
Indicator if it is input or output
8585
"""
8686

8787

acclimatise/model.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,18 +388,16 @@ def capital(self):
388388
int_num_re = re.compile(r"([+-]?[0-9]+)", flags=re.IGNORECASE)
389389

390390

391-
def distinguish_inout(string, cls) -> cli_types.CliFileSystemType:
391+
def distinguish_inout(string, cls: typing.Type[cli_types.CliFileSystemType]) -> cli_types.CliFileSystemType:
392392
"""
393393
distinguish input/output files/directories given a string
394394
"""
395395
im = input_re.search(string)
396396
om = output_re.search(string)
397-
if im and not om:
398-
return cls(output=False)
399-
elif not im and om:
397+
if not im and om:
400398
return cls(output=True)
401399
else:
402-
return cls()
400+
return cls(output=False)
403401

404402

405403
def infer_type(string) -> typing.Optional[cli_types.CliType]:

0 commit comments

Comments
 (0)