Change several python and robot files to 110 chars
Taking advantage of current team limit of 110 chars.
Change-Id: If7ab51fe894889967b8c8bb2f2fa4664f01117d5
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/gen_robot_print.py b/lib/gen_robot_print.py
index c03c9a3..7dd1384 100755
--- a/lib/gen_robot_print.py
+++ b/lib/gen_robot_print.py
@@ -19,26 +19,21 @@
r"""
Sprint the values of one or more variables to the console.
- This is a robot re-definition of the sprint_vars function in gen_print.py.
- Given a list of variable names, this keyword will string print each
- variable name and value such that each value lines up in the same column
- as messages printed with sprint_time().
+ This is a robot re-definition of the sprint_vars function in gen_print.py. Given a list of variable
+ names, this keyword will string print each variable name and value such that each value lines up in the
+ same column as messages printed with sprint_time().
Description of argument(s):
- args The names of the variables to be printed
- (e.g. var1 rather than ${var1}).
- kwargs See sprint_varx in gen_print.py for
- descriptions of all other arguments.
+ args The names of the variables to be printed (e.g. var1 rather than ${var1}).
+ kwargs See sprint_varx in gen_print.py for descriptions of all other arguments.
"""
if 'fmt' in kwargs:
- # Find format option names in kwargs['fmt'] and wrap them with "gp."
- # and "()" to make them into function calls. For example, verbose
- # would be converted to "gp.verbose()". This allows the user to
- # simply specify "fmt=verbose" (vs. fmt=gp.verbose()).
- # Note "terse" has been explicitly added for backward compatibility.
- # Once the repo has been purged of its use, this code can return to
- # its original form.
+ # Find format option names in kwargs['fmt'] and wrap them with "gp." and "()" to make them into
+ # function calls. For example, verbose would be converted to "gp.verbose()". This allows the user
+ # to simply specify "fmt=verbose" (vs. fmt=gp.verbose()).
+ # Note "terse" has been explicitly added for backward compatibility. Once the repo has been purged
+ # of its use, this code can return to its original form.
regex = "(" + "|".join(gp.valid_fmts()) + "|terse)"
kwargs['fmt'] = \
re.sub(regex, "gp.\\1()", kwargs['fmt'])
@@ -53,14 +48,12 @@
def sprint_auto_vars(headers=0):
r"""
- String print all of the Automatic Variables described in the Robot User's
- Guide using sprint_vars.
+ String print all of the Automatic Variables described in the Robot User's Guide using sprint_vars.
NOTE: Not all automatic variables are guaranteed to exist.
Description of argument(s):
- headers This indicates that a header and footer
- should be printed.
+ headers This indicates that a header and footer should be printed.
"""
buffer = ""
@@ -99,28 +92,23 @@
gp.gp_print(buffer)
-# In the following section of code, we will dynamically create print versions
-# for several of the sprint functions defined above. For example, where we
-# have an sprint_vars() function defined above that returns formatted variable
-# print outs in a string, we will create a corresponding rprint_vars()
-# function that will print that string directly to stdout.
+# In the following section of code, we will dynamically create print versions for several of the sprint
+# functions defined above. For example, where we have an sprint_vars() function defined above that returns
+# formatted variable print outs in a string, we will create a corresponding rprint_vars() function that will
+# print that string directly to stdout.
-# It can be complicated to follow what's being created below. Here is an
-# example of the rprint_vars() function that will be created:
+# It can be complicated to follow what's being created below. Here is an example of the rprint_vars()
+# function that will be created:
# def rprint_vars(*args, **kwargs):
-# gp.gp_print(gp.replace_passwords(sprint_vars(*args, **kwargs)),
-# stream='stdout')
+# gp.gp_print(gp.replace_passwords(sprint_vars(*args, **kwargs)), stream='stdout')
# For sprint_vars (defined above), the following functions will be created:
# rprint_vars Robot Print Vars
-# rqprint_vars Robot Print Vars if ${quiet} is set to
-# ${0}.
-# rdprint_vars Robot Print Vars if ${debug} is set to
-# ${1}.
-# rlprint_vars Robot Print Vars to the log instead of to
-# the console.
+# rqprint_vars Robot Print Vars if ${quiet} is set to ${0}.
+# rdprint_vars Robot Print Vars if ${debug} is set to ${1}.
+# rlprint_vars Robot Print Vars to the log instead of to the console.
# Abbreviated names are created for all of the preceding function names:
# rpvars
@@ -128,22 +116,20 @@
# rdpvars
# rlpvars
-# Users are encouraged to only use the abbreviated forms for development but
-# to then ultimately switch to full names.
+# Users are encouraged to only use the abbreviated forms for development but to then ultimately switch to
+# full names.
# Rprint Vars (instead of Rpvars)
replace_dict = {'output_stream': 'stdout', 'mod_qualifier': 'gp.'}
gp_debug_print("gp.robot_env: " + str(gp.robot_env) + "\n")
-# func_names contains a list of all rprint functions which should be created
-# from their sprint counterparts.
+# func_names contains a list of all rprint functions which should be created from their sprint counterparts.
func_names = [
'print_vars', 'print_auto_vars'
]
-# stderr_func_names is a list of functions whose output should go to stderr
-# rather than stdout.
+# stderr_func_names is a list of functions whose output should go to stderr rather than stdout.
stderr_func_names = []
func_defs = gp.create_print_wrapper_funcs(func_names, stderr_func_names,
@@ -151,8 +137,7 @@
gp_debug_print(func_defs)
exec(func_defs)
-# Define an alias. rpvar is just a special case of rpvars where the args
-# list contains only one element.
+# Define an alias. rpvar is just a special case of rpvars where the args list contains only one element.
cmd_buf = "rpvar = rpvars"
gp_debug_print("\n" + cmd_buf + "\n")
exec(cmd_buf)