CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
cmsHarvester.CMSHarvesterHelpFormatter Class Reference

Helper class: CMSHarvesterHelpFormatter. More...

Inheritance diagram for cmsHarvester.CMSHarvesterHelpFormatter:

Public Member Functions

def format_usage
 

Detailed Description

Helper class: CMSHarvesterHelpFormatter.

Helper class to add some customised help output to cmsHarvester.

We want to add some instructions, as well as a pointer to the CMS
Twiki.

Definition at line 149 of file cmsHarvester.py.

Member Function Documentation

def cmsHarvester.CMSHarvesterHelpFormatter.format_usage (   self,
  usage 
)

Definition at line 157 of file cmsHarvester.py.

References join().

Referenced by argparse.ArgumentParser.print_usage(), and python.rootplot.argparse.ArgumentParser.print_usage().

158  def format_usage(self, usage):
159 
160  usage_lines = []
161 
162  sep_line = "-" * 60
163  usage_lines.append(sep_line)
164  usage_lines.append("Welcome to the CMS harvester, a (hopefully useful)")
165  usage_lines.append("tool to create harvesting configurations.")
166  usage_lines.append("For more information please have a look at the CMS Twiki:")
167  usage_lines.append(" %s" % twiki_url)
168  usage_lines.append(sep_line)
169  usage_lines.append("")
170 
171  # Since we only add to the output, we now just append the
172  # original output from IndentedHelpFormatter.
173  usage_lines.append(optparse.IndentedHelpFormatter. \
174  format_usage(self, usage))
175 
176  formatted_usage = "\n".join(usage_lines)
177  return formatted_usage
static std::string join(char **cmd)
Definition: RemoteFile.cc:18