Skip to content

Commit

Permalink
Updating to 0.9.0, restoring literal_eval functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
dluman committed Jul 27, 2024
1 parent 9d8de5e commit 8ee62a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="arglite",
version="0.8.5",
version="0.9.0",
packages=['arglite'],
package_dir={'': 'src'},
include_package_data=True,
Expand Down
3 changes: 2 additions & 1 deletion src/arglite/arglite.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ def flatten(self, args: list = []) -> str:

def pairs(self, args: str = "") -> list:
""" Get each pair of args and values, blanks if no value """
return re.findall(r"((?<![a-z])-{1,2}[a-z0-9]+)(?:\s)([a-zA-Z0-9_]+)?", args)
return re.findall(r"((?<![a-z])-{1,2}[a-z0-9,\[\]\{\}\:\"]+)(?:\s)([a-zA-Z0-9_,\[\]\{\}\:\"]+)?", args)

def typify(self, val: Any) -> Any:
""" Cast as a data structure or other type if possible, else...meh """
try:
print(f"trying type...{val}")
val = literal_eval(val)
except:
pass
Expand Down

0 comments on commit 8ee62a6

Please sign in to comment.