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:
Stéphane Cerveau 2022-02-04 14:47:32 +01:00 committed by GStreamer Marge Bot
parent a997108b18
commit 802c8674d4

26
scripts/generate_init_static_plugins.py Normal file → Executable file
View 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: