@@ -25,11 +25,11 @@ def calculate_function(traversal, howcall=None):
2525 )
2626 )
2727
28- if "pipeline " in traversal .specific_invocation_params :
28+ if "code " in traversal .specific_invocation_params :
2929
3030 return {
3131 "function" : interpret .build_function (
32- traversal .specific_invocation_params ["pipeline " ],
32+ traversal .specific_invocation_params ["code " ],
3333 global_namespace = global_namespace ,
3434 howcall = howcall ,
3535 )
@@ -41,7 +41,7 @@ def calculate_function(traversal, howcall=None):
4141def calculate_reduce (traversal ):
4242
4343 function = interpret .build_function (
44- traversal .specific_invocation_params ["pipeline " ],
44+ traversal .specific_invocation_params ["code " ],
4545 traversal .global_invocation_options .global_options ["global_namespace" ],
4646 howcall = interpret .HowCall .VARARGS ,
4747 )
@@ -146,37 +146,37 @@ async def async_chain(items, exit_stack):
146146
147147
148148subcommands = [
149- click .Command ("map" , short_help = "Call <pipeline > on each line of input." ),
150- click .Command ("async-map" , short_help = "Call <pipeline > on each line of input." ),
151- click .Command ("apply" , short_help = "Call <pipeline > on input as a sequence." ),
149+ click .Command ("map" , short_help = "Call <code > on each line of input." ),
150+ click .Command ("async-map" , short_help = "Call <code > on each line of input." ),
151+ click .Command ("apply" , short_help = "Call <code > on input as a sequence." ),
152152 click .Command (
153- "async-apply" ,
154- short_help = "Call <pipeline> asynchronously on input as a sequence." ,
153+ "async-apply" , short_help = "Call <code> asynchronously on input as a sequence."
155154 ),
156155 click .Command (
157156 "filter" ,
158- short_help = "Call <pipeline > on each line of input and exclude false values." ,
157+ short_help = "Call <code > on each line of input and exclude false values." ,
159158 ),
160159 click .Command (
161160 "async-filter" ,
162- short_help = "Async call <pipeline > on each line of input and exclude false values." ,
161+ short_help = "Async call <code > on each line of input and exclude false values." ,
163162 ),
164163 click .Command (
165- "stack" , short_help = "Call <pipeline > on input as a single concatenated string."
164+ "stack" , short_help = "Call <code > on input as a single concatenated string."
166165 ),
167166 click .Command (
168167 "async-map-unordered" ,
169- short_help = "Call <pipeline > on each line of input, ignoring order of input items." ,
168+ short_help = "Call <code > on each line of input, ignoring order of input items." ,
170169 ),
171170 click .Command (
172171 "dropwhile" ,
173172 short_help = "Evaluate <predicate> on function and drop values until first falsy." ,
174173 ),
174+ click .Command ("eval" , short_help = "Evaluate a python expression <code>" ),
175175]
176176
177177
178178def build_callback (sub_command ):
179- def callback (pipeline , autocall , ** parameters ):
179+ def callback (code , autocall , ** parameters ):
180180 if autocall :
181181 howcall = interpret .HowCall .SINGLE
182182 else :
@@ -186,7 +186,7 @@ def callback(pipeline, autocall, **parameters):
186186 {
187187 "name" : sub_command .name .replace ("-" , "_" ),
188188 "howcall" : howcall ,
189- "pipeline " : pipeline ,
189+ "code " : code ,
190190 "parameters" : parameters ,
191191 }
192192 ]
@@ -202,7 +202,7 @@ def callback(pipeline, autocall, **parameters):
202202
203203 subcommand .params = [
204204 click .Option (["--autocall/--no-autocall" ], is_flag = True , default = True ),
205- click .Argument (["pipeline " ]),
205+ click .Argument (["code " ]),
206206 ]
207207 subcommand .callback = build_callback (subcommand )
208208 subcommand = option_exec_before (subcommand )
@@ -219,19 +219,19 @@ def callback(pipeline, autocall, **parameters):
219219def _reduce (function_name , ** parameters ):
220220 return [
221221 {
222- "pipeline " : f"toolz.curry({ function_name } )" ,
222+ "code " : f"toolz.curry({ function_name } )" ,
223223 "name" : "reduce" ,
224224 "parameters" : parameters ,
225225 }
226226 ]
227227
228228
229- @registry .add_cli (name = "eval" )
230- @click .command ("eval" , short_help = "Call <pipeline > without any input." )
231- @option_exec_before
232- @click .argument ("expression" )
233- def _eval (expression , ** parameters ):
234- return [{"pipeline " : expression , "name" : "eval" , "parameters" : parameters }]
229+ # @registry.add_cli(name="eval")
230+ # @click.command("eval", short_help="Call <code > without any input.")
231+ # @option_exec_before
232+ # @click.argument("expression")
233+ # def _eval(expression, **parameters):
234+ # return [{"code ": expression, "name": "eval", "parameters": parameters}]
235235
236236
237237more_commands = [
0 commit comments