mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 01:31:03 +00:00
gstreamer-full-static: autopep on script
Pass autopep on generate_init_static_plugins.py Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1637>
This commit is contained in:
parent
a997108b18
commit
802c8674d4
1 changed files with 21 additions and 11 deletions
26
scripts/generate_init_static_plugins.py
Normal file → Executable file
26
scripts/generate_init_static_plugins.py
Normal file → Executable file
|
@ -28,6 +28,8 @@ gst_init_static_plugins (void)
|
|||
}
|
||||
}
|
||||
''')
|
||||
|
||||
|
||||
# Retrieve the plugin name as it can be a plugin filename
|
||||
def get_plugin_name(name):
|
||||
for p in plugins:
|
||||
|
@ -35,6 +37,7 @@ def get_plugin_name(name):
|
|||
return p
|
||||
return ''
|
||||
|
||||
|
||||
def process_features(features_list, plugins, feature_prefix):
|
||||
plugins_list = plugins
|
||||
feature_declaration = []
|
||||
|
@ -54,20 +57,24 @@ def process_features(features_list, plugins, feature_prefix):
|
|||
feature_registration += ['%s_REGISTER(%s, NULL);' % (feature_prefix, feature)]
|
||||
return (plugins_list, feature_declaration, feature_registration)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-o', dest="output", help="Output file")
|
||||
parser.add_argument('-p','--plugins', nargs='?', default='', dest="plugins", help="The list of plugins")
|
||||
parser.add_argument('-p', '--plugins', nargs='?', default='', dest="plugins", help="The list of plugins")
|
||||
parser.add_argument('-e', '--elements', nargs='?', default='', dest="elements", help="The list of plugin:elements")
|
||||
parser.add_argument('-t', '--type-finds', nargs='?', default='', dest="typefindfuncs", help="The list of plugin:typefinds")
|
||||
parser.add_argument('-d', '--devide-providers', nargs='?', default='', dest="deviceproviders", help="The list of plugin:deviceproviders")
|
||||
parser.add_argument('-T', '--dynamic-types', nargs='?', default='', dest="dynamictypes", help="The list of plugin:dynamictypes")
|
||||
parser.add_argument('-t', '--type-finds', nargs='?', default='',
|
||||
dest="typefindfuncs", help="The list of plugin:typefinds")
|
||||
parser.add_argument('-d', '--devide-providers', nargs='?', default='',
|
||||
dest="deviceproviders", help="The list of plugin:deviceproviders")
|
||||
parser.add_argument('-T', '--dynamic-types', nargs='?', default='',
|
||||
dest="dynamictypes", help="The list of plugin:dynamictypes")
|
||||
options = parser.parse_args()
|
||||
if options.output is None:
|
||||
output_file = 'gstinitstaticplugins.c'
|
||||
else:
|
||||
output_file = options.output
|
||||
enable_staticelements_plugin = 0;
|
||||
enable_staticelements_plugin = 0
|
||||
elements_declaration = []
|
||||
elements_registration = []
|
||||
typefind_funcs_declaration = []
|
||||
|
@ -90,9 +97,12 @@ if __name__ == "__main__":
|
|||
|
||||
# process the features
|
||||
(plugins, elements_declaration, elements_registration) = process_features(options.elements, plugins, 'GST_ELEMENT')
|
||||
(plugins, typefind_funcs_declaration, typefind_funcs_registration) = process_features(options.typefindfuncs, plugins, 'GST_TYPE_FIND')
|
||||
(plugins, device_providers_declaration, device_providers_registration) = process_features(options.deviceproviders, plugins, 'GST_DEVICE_PROVIDER')
|
||||
(plugins, dynamic_types_declaration, dynamic_types_registration) = process_features(options.dynamictypes, plugins, 'GST_DYNAMIC_TYPE')
|
||||
(plugins, typefind_funcs_declaration, typefind_funcs_registration) = process_features(
|
||||
options.typefindfuncs, plugins, 'GST_TYPE_FIND')
|
||||
(plugins, device_providers_declaration, device_providers_registration) = process_features(
|
||||
options.deviceproviders, plugins, 'GST_DEVICE_PROVIDER')
|
||||
(plugins, dynamic_types_declaration, dynamic_types_registration) = process_features(
|
||||
options.dynamictypes, plugins, 'GST_DYNAMIC_TYPE')
|
||||
|
||||
# Enable plugin or elements according to the ';' separated list.
|
||||
for plugin in plugins:
|
||||
|
|
Loading…
Reference in a new issue