Skip to content

Commit

Permalink
Changing implementation of default scale
Browse files Browse the repository at this point in the history
  • Loading branch information
EtorixDev authored Mar 6, 2023
1 parent 8ac8797 commit 71fadcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def readme():

setup(
name = "timelength",
version = "1.1.6",
version = "1.1.7",
url = "https://github.com/Etorix0005/timelength",
license = "MIT License",
author = "Etorix",
Expand Down
6 changes: 3 additions & 3 deletions timelength/timelength.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ def __parse(self, passed_value, strict):

index = 0
input_length = None
input_scale = None if self.strict or len(potential_values) > 1 else "second"
input_scale = None
preceeding_num = False
preceeding_alpha = True
if not self.strict and len(potential_values) == 1 and isfloat(potential_values[0]):
potential_values.append(f"second{'s' if potential_values[0] != 1 else ''}")
invalid_values = [item for item in potential_values if item and not isfloat(item) and item not in self.__abbreviations]
potential_values = [item for item in potential_values if item and item not in invalid_values]
# If invalid and strict, error
Expand Down Expand Up @@ -181,8 +183,6 @@ def __parse(self, passed_value, strict):
index += 1
# Append pairs to valid_values to be returned
if input_length is not None and input_scale is not None:
if input_length != 1 and input_scale == "second":
input_scale += "s"
valid_values.append((input_length, input_scale))
input_length = None
input_scale = None
Expand Down

0 comments on commit 71fadcf

Please sign in to comment.