当前位置: 首页>>代码示例>>Python>>正文


Python IndentedHelpFormatter.__init__方法代码示例

本文整理汇总了Python中optparse.IndentedHelpFormatter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python IndentedHelpFormatter.__init__方法的具体用法?Python IndentedHelpFormatter.__init__怎么用?Python IndentedHelpFormatter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在optparse.IndentedHelpFormatter的用法示例。


在下文中一共展示了IndentedHelpFormatter.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__ (self,
               indent_increment=2,
               max_help_position=32, 
               width=78,
               short_first=1):
     IndentedHelpFormatter.__init__(
         self, indent_increment, max_help_position,
         width, short_first)
开发者ID:JohnReid,项目名称:bioinf-utilities,代码行数:10,代码来源:deoptparse.py

示例2: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     from textwrap import fill, wrap
     IndentedHelpFormatter.__init__(self, *args, **kwargs)
     tw = type('textwrap_mock', (object, ), dict(
         fill=staticmethod(fill),
         wrap=staticmethod(lambda *args, **kwargs:
             wrap(*args, **dict(kwargs, break_on_hyphens=False)),
         )))
     self.format_option.__globals__['textwrap'] = tw
开发者ID:jnpkrn,项目名称:clufter,代码行数:11,代码来源:main.py

示例3: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self,
              indent_increment=0,
              max_help_position=80,
              width=None,
              short_first=1):
     IndentedHelpFormatter.__init__(self,
                                    indent_increment=indent_increment,
                                    max_help_position=max_help_position,
                                    width=width,
                                    short_first=short_first)
开发者ID:asntech,项目名称:rSeqPipeline,代码行数:12,代码来源:misc.py

示例4: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self, banner, *argv, **argd):
     self.banner = banner
     IndentedHelpFormatter.__init__(self, *argv, **argd)
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:5,代码来源:google.py

示例5: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     IndentedHelpFormatter.__init__(self, *args, **kwargs)
开发者ID:mcevoyandy,项目名称:neptune,代码行数:4,代码来源:cli.py

示例6: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self):
     # indent incr, max_help_pos, width, short_first
     IndentedHelpFormatter.__init__(self, 2, 26, None, 1)
开发者ID:joelimome,项目名称:runfunc,代码行数:5,代码来源:runfunc.py

示例7: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self, heading):
     self.heading = heading
     IndentedHelpFormatter.__init__(self)
开发者ID:strannik-j,项目名称:yafotkiuploader,代码行数:5,代码来源:yaploader.py

示例8: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self, subcommand_arg_summaries, *args, **kwargs):
     self.subcommand_arg_summaries = subcommand_arg_summaries
     IndentedHelpFormatter.__init__(self, *args, **kwargs)
开发者ID:guits,项目名称:numeter,代码行数:5,代码来源:_utils.py

示例9: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     IndentedHelpFormatter.__init__(self, *args, **kwargs)
     self.help_position = 0
开发者ID:wadoon,项目名称:pytagsfs,代码行数:5,代码来源:optgroup.py

示例10: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
	def __init__(self):
		IndentedHelpFormatter.__init__(self)
开发者ID:dvorberg,项目名称:wikklytext,代码行数:4,代码来源:wik.py

示例11: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     IndentedHelpFormatter.__init__(self, *args, **kwargs)
     self.envvar_tag = "%envvar"
开发者ID:jwhitlark,项目名称:ConfigurationManager,代码行数:5,代码来源:ConfigManager.py

示例12: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
    def __init__(self,
                 metavar_format=' <{}>',
                 metavar_column=None,
                 option_separator=', ',
                 align_long_opts=False,
                 help_string_formatter=None,
                 preformatted_description=True,
                 preformatted_epilog=True,
                 *args, **kw):
        """
        :arg metavar_format:
             Evaluated as `metavar_format.format(metavar)` if string.
             If callable, evaluated as `metavar_format(metavar)`.

        :arg metavar_column:
             Column to which all metavars should be aligned.

        :arg option_separator:
             String between short and long option. E.g: ', ' -> '-f, --format'.

        :arg align_long_opts:
             Align all long options on the current indent level to the same
             column. For example:

                align_long_opts=False         align_long_opts=True
             --------------------------    --------------------------
             -h, --help  show this  ...    -h, --help  show this  ...
             --fast      avoid slow ...        --fast  avoid slow ...

        :arg help_string_format:
             Function to call to call on help string after expansion. Called
             as `help_string_format(help, option)`.

        :arg preformatted_description:
             If True, description will be displayed as-is, instead of
             text-wrapping it first.

        :arg preformatted_description:
             If True, epilog will be displayed as-is, instead of
             text-wrapping it first.

        :arg width:
             Maximum help message width. Defaults to 78 unless $COLUMNS is set.
        """

        if not callable(metavar_format):
            func = partial(format_option_metavar, fmt=metavar_format)
        else:
            func = metavar_format

        self.metavar_format   = func
        self.metavar_column   = metavar_column
        self.align_long_opts  = align_long_opts
        self.option_separator = option_separator
        self.help_string_formatter = help_string_formatter

        if 'width' not in kw:
            try:
                kw['width'] = int(os.environ['COLUMNS']) - 2
            except (KeyError, ValueError):
                kw['width'] = 78

        kw['max_help_position'] = kw.get('max_help_position', kw['width'])
        kw['indent_increment']  = kw.get('indent_increment', 1)
        kw['short_first']       = kw.get('short_first', 1)

        # leave full control of description and epilog to us
        self.preformatted_description = preformatted_description
        self.preformatted_epilog      = preformatted_epilog

        IndentedHelpFormatter.__init__(self, *args, **kw)
开发者ID:gvalkov,项目名称:optparse-pretty,代码行数:73,代码来源:optparse_mooi.py

示例13: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
	def __init__(self, output):
		IndentedHelpFormatter.__init__(self)
		self.output = output
开发者ID:ashmew2,项目名称:gentoo-mirrorselect,代码行数:5,代码来源:output.py

示例14: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self):
     IndentedHelpFormatter.__init__(self)
     self.max_help_position = 50
     self.width = 120
开发者ID:kochbeck,项目名称:videocleaner,代码行数:6,代码来源:moviecleaner.py

示例15: __init__

# 需要导入模块: from optparse import IndentedHelpFormatter [as 别名]
# 或者: from optparse.IndentedHelpFormatter import __init__ [as 别名]
 def __init__(self):
     IndentedHelpFormatter.__init__(self,
         width=min(get_terminal_size()[0], 80) - 2)
     self.default_tag = ''
开发者ID:alphaManimal,项目名称:click,代码行数:6,代码来源:_optparse.py


注:本文中的optparse.IndentedHelpFormatter.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。