本文整理汇总了Python中absl.flags.DEFINE_spaceseplist方法的典型用法代码示例。如果您正苦于以下问题:Python flags.DEFINE_spaceseplist方法的具体用法?Python flags.DEFINE_spaceseplist怎么用?Python flags.DEFINE_spaceseplist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类absl.flags
的用法示例。
在下文中一共展示了flags.DEFINE_spaceseplist方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_flag_help_in_xml_space_separated_list
# 需要导入模块: from absl import flags [as 别名]
# 或者: from absl.flags import DEFINE_spaceseplist [as 别名]
def test_flag_help_in_xml_space_separated_list(self):
flags.DEFINE_spaceseplist('dirs', 'src libs bin',
'Directories to search.', flag_values=self.fv)
expected_separators = sorted(string.whitespace)
expected_output = (
'<flag>\n'
' <file>tool</file>\n'
' <name>dirs</name>\n'
' <meaning>Directories to search.</meaning>\n'
' <default>src libs bin</default>\n'
' <current>[\'src\', \'libs\', \'bin\']</current>\n'
' <type>whitespace separated list of strings</type>\n'
'LIST_SEPARATORS'
'</flag>\n').replace('LIST_SEPARATORS',
_list_separators_in_xmlformat(expected_separators,
indent=' '))
self._check_flag_help_in_xml('dirs', 'tool', expected_output)
示例2: test_flag_help_in_xml_space_separated_list_with_comma_compat
# 需要导入模块: from absl import flags [as 别名]
# 或者: from absl.flags import DEFINE_spaceseplist [as 别名]
def test_flag_help_in_xml_space_separated_list_with_comma_compat(self):
flags.DEFINE_spaceseplist('dirs', 'src libs,bin',
'Directories to search.', comma_compat=True,
flag_values=self.fv)
expected_separators = sorted(string.whitespace + ',')
expected_output = (
'<flag>\n'
' <file>tool</file>\n'
' <name>dirs</name>\n'
' <meaning>Directories to search.</meaning>\n'
' <default>src libs bin</default>\n'
' <current>[\'src\', \'libs\', \'bin\']</current>\n'
' <type>whitespace or comma separated list of strings</type>\n'
'LIST_SEPARATORS'
'</flag>\n').replace('LIST_SEPARATORS',
_list_separators_in_xmlformat(expected_separators,
indent=' '))
self._check_flag_help_in_xml('dirs', 'tool', expected_output)