Lines Matching +full:sub +full:- +full:function

47     os.path.normpath(re.sub("/" + pgm_name, "", pgm_file_path)) + os.path.sep
119 Return the function name associated with the indicated stack frame.
122 …stack_frame_ix The index of the stack frame whose function name should be returne…
123 … the caller does not specify a value, this function will set the value to
125 … wrapper function "print_func_name", this function will bump it up by 1.
149 …This function will try to prevent this failure by detecting the scenario in advance and making "/t…
163 return len(line) - len(line.lstrip(" "))
166 # get_arg_name is not a print function per se. It has been included in this module because it is u…
170 …Return the "name" of an argument passed to a function. This could be a literal or a variable name.
182 … return the name of the target function as specified in the calling line
184function uses an alias function name, the alias name would be returned.
186 … with the given example, if arg_num is -2 the 2nd parm to the left of the
187 … "=" ("rc" in this case) should be returned. If arg_num is -1, the 1st
189 … If arg_num is less than -2, an entire dictionary is returned. The keys
190 to the dictionary for this example would be -2 and -1.
191 …stack_frame_ix The stack frame index of the target function. This value must be …
205 … # Getting the var name of the first arg to this function, test1. Note, in this case, it doesn't
222 # Note: To avoid infinite recursion, avoid calling any function that calls this function (e.g.
225 … The user can set environment variable "GET_ARG_NAME_DEBUG" to get debug output from this function.
228 # have this function include source code in the debug output.
235 'Programmer error - Variable "stack_frame_ix" has an'
268 "Programmer error - The caller has asked for"
280 # filename of "<string>" may mean that the function in question was defined dynamically and
296 line_ix = cur_line_no - source_line_num - 1
299 line_ix = cur_line_no - source_line_num
302 print("\n Variables retrieved from inspect.stack() function:")
318 …# _run_exitfuncs is at the top of the stack (i.e. if we're running an exit function). I've coded a
319 # work-around below for this deficiency.
322 # Get called_func_id by searching for our function in the list of all functions.
324 for func_name, function in all_functions:
326 called_func_id = id(function)
329 # function.
333 for func_name, function in all_functions:
336 func_id = id(function)
341 …# running from exit function), I've added code to handle pvar, qpvar, dpvar, etc. aliases explicit…
344 aliases.add(re.sub("print_var", "pvar", real_called_func_name))
346 # The call to the function could be encased in a recast (e.g. int(func_name())).
348 import_name_regex = "([a-zA-Z0-9_]+\\.)?"
354 # Search backward through source lines looking for the calling function name.
356 for start_line_ix in range(line_ix, 0, -1):
365 "Programmer error - Could not find the source line with"
366 + ' a reference to function "'
381 end_line_ix -= 1
385 prior_line = source_lines[start_line_ix - 1]
386 prior_line_stripped = re.sub(r"[ ]*\\([\r\n]$)", " \\1", prior_line)
392 start_line_ix -= 1
401 composite_line = re.sub("=[ ]*([^ ])", "= \\1", composite_line, 1)
404 lvalue_string = re.sub(lvalue_regex, "", composite_line)
412 # A non-ordered dict doesn't look as nice when printed but it will do.
414 ix = len(lvalues_list) * -1
422 called_func_name = re.sub(called_func_name_regex, "\\4", composite_line)
423 arg_list_etc = "(" + re.sub(pre_args_regex, "", composite_line)
445 nest_level = -1
456 nest_level -= 1
484 argument = args_list[arg_num - 1]
507 #(CDT) 2016/07/08 15:25:35 - Hi.
517 #(CDT) 2016/08/03 17:12:05 - Hi.
525 #(CDT) 2016/08/03 17:16:25.510469 - Hi.
528 … the amount of time that has elapsed since the last time this function was
533 #(CDT) 2016/08/03 17:17:40 - 0 - Hi.
537 #(CDT) 2016/08/03 17:18:47.317339 - 0.000046 - Hi.
562 + " - "
571 time_string = time_string + " - " + elapsed_seconds
573 return time_string + " - " + buffer
587 - A time stamp
588 - The "**ERROR**" string
589 - The caller's buffer string.
599 #(CDT) 2016/08/03 17:12:05 - **ERROR** Oops.
636 …# Consider a single nibble whose signed values can range from -8 to 7 (0x8 to 0x7). A value of 0x7
638 … # set, the value 7 clearly will fit in one nibble. With -8 = 0x8 = 0b1000, one has the smallest
640 … # of -8 to a working_number of 7, this function can accurately calculate the number of bits and
642 working_number = abs(number) - 1
650 return len(bin(working_number)) - 2
666 …# Consider a single nibble whose signed values can range from -8 to 7 (0x8 to 0x7). A value of 0x7
668 … # set, the value 7 clearly will fit in one nibble. With -8 = 0x8 = 0b1000, one has the smallest
670 … # of -8 to a working_number of 7, this function can accurately calculate the number of bits and
672 working_number = abs(number) - 1
689 …# Check to see whether the negative bit is set. This is the left-most bit in the highest order di…
690 negative_mask = 2 ** (num_hex_digits * 4 - 1)
708 The value returned is a function of sys.maxsize.
742 Return non-zero if var_value is a type of dictionary and 0 if it is not.
744 …The specific non-zero value returned will indicate what type of dictionary var_value is (see const…
809 … a list of the valid formats that can be specified for the fmt argument of the sprint_varx function
829 … Create a string consisting of function-definition code that can be executed to create constant fmt
834 …Likewise, the sprint_varx function will use these generated functions to correctly interpret the f…
837 Example output from this function:
855 # Dynamically create fmt definitions (for use with the fmt argument of sprint_varx function):
861 Constant function to return fmt value of 0.
863 …at sprint_varx defaults to printing in terse format, the terse option is deprecated. This function
866 Once the repo has been purged of the use of terse, this function can be removed.
876 Note that the list passed to this function will be modified.
893 This function was written for use by the sprint_varx function defined in this module.
895 …When sprint_varx is processing a multi-level object such as a list or dictionary (which in turn may
906 ('sub',
917 [sub]:
922 …of the dictionary entries with the keys 'one', 'two' and 'sub'. The third level is comprised of t…
926 integer value set by calling the verbose() function.
935 ord_dict[sub]:
936 ord_dict[sub][three]: 3
937 ord_dict[sub][four]: 4
953 ord_dict[sub]: <collections.OrderedDict>
954 ord_dict[sub][three]: 3 <int>
955 ord_dict[sub][four]: 4 <int>
962 ord_dict[sub]: <collections.OrderedDict>
963 ord_dict[sub][three]: 3 <int>
964 ord_dict[sub][four]: 4 <int>
971 ord_dict[sub]:
972 ord_dict[sub][three]: 3 <int>
973 ord_dict[sub][four]: 4 <int>
1009 Note that the sprint_var function (defined below) can be used to call this function so that the
1011 function is the one that would normally be used by the general user.
1022 #(CDT) 2016/08/10 17:34:42.847374 - 0.001285 - Doing this...
1024 #(CDT) 2016/08/10 17:34:42.847510 - 0.000136 - Doing that...
1026 This function recognizes several complex types of data such as dict, list or tuple.
1043 … A bit map to dictate the format of the output. For printing multi-level
1073 printed via the print_time function.
1101 col1_width = col1_width - indent
1112 # example, instead of printing -1 as "0x-000000000000001" it will be printed as
1114 var_value = var_value & (2 ** (num_hex_digits * 4) - 1)
1137 "%" + str(indent) + "s%-" + str(col1_width) + "s" + value_format
1148 var_name = re.sub(r".*\[", "[", var_name)
1150 var_name = re.sub(r"[\[\]]", "", var_name)
1167 loc_var_name = re.sub(r".*\[", "[", var_name)
1171 loc_var_name = re.sub(r"[\[\]]", "", loc_var_name)
1246 indent -= 2
1248 col1_width = col1_width - indent
1252 + "s%-"
1279 # Get the name of the first variable passed to this function.
1308 def sprint_dashes(indent=dft_indent, width=80, line_feed=1, char="-"):
1329 Pre-pend the specified number of characters to the text string (i.e. indent it) and return it.
1348 …For the given stack_frame, return a formatted string containing the function name and all its argu…
1370 # "?" is the name used when code is not in a function.
1411 # Now we need to print this in a nicely-wrapped way.
1421 …Return a call stack report for the given point in the program with line numbers, function names and
1422 function parameters and arguments.
1426 -------------------------------------------------------------------------
1427 Python function call stack
1429 Line # Function name and arguments
1430 ------ ------------------------------------------------------------------
1435 -------------------------------------------------------------------------
1445 buffer += sindent("Python function call stack\n\n", indent)
1446 buffer += sindent("Line # Function name and arguments\n", indent)
1477 …Print a line indicating what function is executing and with what parameter values. This is useful…
1482 #(CDT) 2016/08/25 17:54:27 - Executing: func1(x = 1)
1485 …stack_frame_ix The index of the stack frame whose function info should be returne…
1486 … the caller does not specify a value, this function will set the value to
1488 … wrapper function "print_executing", this function will bump it up by 1.
1506 max_width = 160 - (dft_col1_width + 11)
1591 # __builtin__.arg_obj is created by the get_arg module function, gen_get_options.
1648 … # Calling sprint_call_stack with stack_frame_ix of 0 causes it to show itself and this function in
1671 #(CDT) 2016/08/25 17:57:36 - Issuing: ls
1677 #(CDT) 2016/08/25 17:57:36 - (test_mode) Issuing: ls
1715 total_time = time.time() - start_time
1739 … Simply return the user's buffer. This function is used by the qprint and dprint functions defined
1754 … Simply return the user's buffer with a line feed. This function is used by the qprint and dprint
1774 This function is intended for use only by other functions in this module.
1797 This function is intended for use only by other functions in this module.
1813 This function is intended for use only by other functions in this module.
1831 … If var_value is None, this function will return the corresponding global value of the variable in
1839 This function is useful for other functions in setting default values for parameters.
1863 … circumstances, this value need not be provided. This function can figure
1865 would be if this function is called directly from a .robot file.
1907 function calling this function, etc.
1938 registered, this function will simply do nothing.
1976 return re.sub(password_regex, "********", buffer)
1985 To illustrate, suppose there is a "print_foo_bar" function in the func_names list.
1986 This function will...
1987 - Expect that there is an sprint_foo_bar function already in existence.
1988 - Create a print_foo_bar function which calls sprint_foo_bar and prints the result.
1989- Create a qprint_foo_bar function which calls upon sprint_foo_bar only if global value quiet is 0.
1990- Create a dprint_foo_bar function which calls upon sprint_foo_bar only if global value debug is 1.
1992 …Also, code will be generated to define aliases for each function as well. Each alias will be crea…
1993 … replacing "print_" in the function name with "p" For example, the alias for print_foo_bar will be
1997 … func_names A list of functions for which print wrapper function code is to be
2001 …replace_dict Please see the create_func_def_string function in wrap_utils.py for
2004 func_prefix Prefix to be prepended to the generated function name.
2019 # We don't want to try to redefine the "print" function, thus the following if statement.
2054 alias = re.sub("print_", "p", func_name)
2055 alias = re.sub("print", "p", alias)
2073 # functions defined above. So, for example, where we have an sprint_time() function defined above …
2074 # returns the time to the caller in a string, we will create a corresponding print_time() function
2078 # function that will be created:
2083 # For each print function defined below, there will also be a qprint, a dprint and an lprint versio…
2086 # The q version of each print function will only print if the quiet variable is 0.
2087 # The d version of each print function will only print if the debug variable is 1.
2088 # The l version of each print function will print the contents as log data. For conventional progr…
2089 # means use of the logging module. For robot programs it means use of the BuiltIn().log() function.