Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
anki-code authored Feb 21, 2024
1 parent fcde7ff commit 9ebf6e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions xontrib/pipeliner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
from xontrib_pipeliner_asttokens import asttokens

_default_presets = {
"len": "len(line)",
"strip": "line.strip()",
"lstrip": "line.lstrip()",
"rstrip": "line.rstrip()",
"split": lambda args: f"line.split({repr(args[0])})",
"list": lambda args: f"eval(line)[int({repr(args[0])})]",
"lower": "line.lower()",
"upper": "line.upper()",
"title": "line.title()",
"startswith": lambda args: f"line.startswith({repr(args[0])})",
"endswith": lambda args: f"line.endswith({repr(args[0])})",
}

def _pl(args, stdin, stdout):
Expand Down

0 comments on commit 9ebf6e7

Please sign in to comment.