예제 #1
0
def list_opts():
    """Returns a list of oslo_config options available in the library.

    The returned list includes all oslo_config options which may be registered
    at runtime by the library.
    Each element of the list is a tuple. The first element is the name of the
    group under which the list of elements in the second element will be
    registered. A group name of None corresponds to the [DEFAULT] group in
    config files.
    The purpose of this is to allow tools like the Oslo sample config file
    generator to discover the options exposed to users by this library.

    :returns: a list of (group_name, opts) tuples
    """
    from tvrenamer.common import tools
    all_opts = []
    all_opts.extend(
        tools.make_opt_list([CLI_OPTS, EPISODE_OPTS, FORMAT_OPTS], None))
    all_opts.extend(tools.make_opt_list([CACHE_OPTS], 'cache'))
    return all_opts
예제 #2
0
파일: options.py 프로젝트: shad7/tvrenamer
def list_opts():
    """Returns a list of oslo_config options available in the library.

    The returned list includes all oslo_config options which may be registered
    at runtime by the library.
    Each element of the list is a tuple. The first element is the name of the
    group under which the list of elements in the second element will be
    registered. A group name of None corresponds to the [DEFAULT] group in
    config files.
    The purpose of this is to allow tools like the Oslo sample config file
    generator to discover the options exposed to users by this library.

    :returns: a list of (group_name, opts) tuples
    """
    from tvrenamer.common import tools
    all_opts = []
    all_opts.extend(tools.make_opt_list([CLI_OPTS,
                                         EPISODE_OPTS,
                                         FORMAT_OPTS], None))
    all_opts.extend(tools.make_opt_list([CACHE_OPTS], 'cache'))
    return all_opts
예제 #3
0
 def test_make_opt_list(self):
     group_name = "test"
     options = ["x", "y", "z", "v"]
     results = tools.make_opt_list(options, group_name)
     self.assertEqual(results, [("test", ["x", "y", "z", "v"])])
예제 #4
0
 def test_make_opt_list(self):
     group_name = 'test'
     options = ['x', 'y', 'z', 'v']
     results = tools.make_opt_list(options, group_name)
     self.assertEqual(results, [('test', ['x', 'y', 'z', 'v'])])