vishap package¶
Subpackages¶
Submodules¶
vishap.base module¶
- class vishap.base.BaseVideoPlugin[source]¶
Bases: object
Base video plugin.
- description = None¶
- embed_code = None¶
- height_param_code = 'height="{height}"'¶
- id_pattern = None¶
- name = None¶
- render(url, width=None, height=None)[source]¶
Renders the HTML code of embed video based on from URL given.
Parameters: - url (str) –
- width (int) –
- height (int) –
Return str:
- thumbnail_pattern = None¶
- uid = None¶
- url_pattern = None¶
- width_param_code = 'width="{width}"'¶
vishap.conf module¶
vishap.defaults module¶
vishap.discover module¶
vishap.exceptions module¶
- exception vishap.exceptions.PluginCodeError[source]¶
Bases: exceptions.Exception
Exception raised when language code is left empty or has incorrect value.
- exception vishap.exceptions.ImproperlyConfigured[source]¶
Bases: exceptions.Exception
Exception raised when developer didn’t configure the code properly.
- exception vishap.exceptions.PluginNotFound[source]¶
Bases: exceptions.Exception
Exception raised when language pack is not found for the language code given.
vishap.test module¶
vishap.utils module¶
- vishap.utils.render_video(url, width=None, height=None, plugin_uid=None)[source]¶
Renders the video.
Parameters: - url (str) –
- width (int) –
- height (int) –
- plugin_uid (str) – Preferred plugin to render to video.
Return str: Returns empty string on failure.
Module contents¶
- vishap.render_video(url, width=None, height=None, plugin_uid=None)¶
Renders the video.
Parameters: - url (str) –
- width (int) –
- height (int) –
- plugin_uid (str) – Preferred plugin to render to video.
Return str: Returns empty string on failure.
- vishap.get_registered_plugins()¶
Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet autodiscovered, autodiscovers them.
Return list:
- vishap.get_registered_plugin_uids()¶
Gets a list of registered plugins in a form if tuple (plugin name, plugin description). If not yet autodiscovered, autodiscovers them.
Return list:
- vishap.ensure_autodiscover()¶
Ensures that plugins are autodiscovered.