lib

class openlp.plugins.remotes.lib.RemoteTab(parent, title, visible_title, icon_path)[source]

Bases: openlp.core.lib.settingstab.SettingsTab

RemoteTab is the Remotes settings tab in the settings dialog.

generate_icon()[source]

Generate icon for main window

get_ip_address(ip_address)[source]

returns the IP address in dependency of the passed address ip_address == 0.0.0.0: return the IP address of the first valid interface else: return ip_address

load()[source]

Load the configuration and update the server configuration if necessary

on_thumbnails_check_box_changed(check_state)[source]

Toggle the thumbnail check box.

on_twelve_hour_check_box_changed(check_state)[source]

Toggle the 12 hour check box.

retranslateUi()[source]
save()[source]

Save the configuration and update the server configuration if necessary

set_urls()[source]

Update the display based on the data input on the screen

setupUi()[source]
class openlp.plugins.remotes.lib.OpenLPServer[source]

Bases: openlp.core.common.registryproperties.RegistryProperties

start_server()[source]

Start the correct server and save the handler

start_server_instance(address, port, server_class)[source]

Start the server

Parameters:
  • address – The server address
  • port – The run port
  • server_class – the class to start
stop_server()[source]

Stop the server

class openlp.plugins.remotes.lib.HttpRouter[source]

Bases: openlp.core.common.registryproperties.RegistryProperties

This code is called by the HttpServer upon a request and it processes it based on the routing table. This code is stateless and is created on each request. Some variables may look incorrect but this extends BaseHTTPRequestHandler.

add_to_service(plugin_name)[source]

Add item of type plugin_name to the end of the service.

Parameters:plugin_name – name of plugin to be called
alert()[source]

Send an alert.

call_function(function, *args)[source]

Invoke the route function passing the relevant values

Parameters:
  • function – The function to be called.
  • args – Any passed data.
controller(display_type, action)[source]

Perform an action on the slide controller.

Parameters:
  • display_type – This is the type of slide controller, either preview or live.
  • action – The action to perform.
controller_text(var)[source]

Perform an action on the slide controller.

Parameters:var – variable - not used
display(action)[source]

Hide or show the display screen. This is a cross Thread call and UI is updated so Events need to be used.

Parameters:action – This is the action, either hide or show.
do_authorisation()[source]

Create a needs authorisation http header.

do_http_error()[source]

Create a error http header.

do_http_success()[source]

Create a success http header.

do_json_header()[source]

Create a header for JSON messages

do_not_found()[source]

Create a not found http header.

do_post_processor()[source]

Handle the POST amd GET requests placed on the server.

get_content_type(file_name)[source]

Examines the extension of the file and determines what the content_type should be, defaults to text/plain Returns the extension and the content_type

Parameters:file_name – name of file
go_live(plugin_name)[source]

Go live on an item of type plugin.

Parameters:plugin_name – name of plugin
initialise()[source]

Initialise the router stack and any other variables.

main_image()[source]

Return the latest display image as a byte stream.

main_poll()[source]

Poll OpenLP to determine the current slide count.

plugin_info(action)[source]

Return plugin related information, based on the action.

Parameters:action – The action to perform. If search return a list of plugin names which support search.
poll()[source]

Poll OpenLP to determine the current slide number and item name.

process_http_request(url_path, *args)[source]

Common function to process HTTP requests

Parameters:
  • url_path – The requested URL.
  • args – Any passed data.
search(plugin_name)[source]

Return a list of items that match the search text.

Parameters:plugin_name – The plugin name to search in.
serve_file(file_name=None)[source]

Send a file to the socket. For now, just a subset of file types and must be top level inside the html folder. If subfolders requested return 404, easier for security for the present.

Ultimately for i18n, this could first look for xx/file.html before falling back to file.html. where xx is the language, e.g. ‘en’

serve_thumbnail(controller_name=None, dimensions=None, file_name=None)[source]

Serve an image file. If not found return 404.

Parameters:
  • file_name – file name to be served
  • dimensions – image size
  • controller_name – controller to be called
service(action)[source]

Handles requests for service items in the service manager

Parameters:action – The action to perform.
service_list()[source]

Handles requests for service items in the service manager

set_cache_headers()[source]
stages(url_path, file_name)[source]

Allow Stage view to be delivered with custom views.

Parameters:
  • url_path – base path of the URL. Not used but passed by caller
  • file_name – file name with path
Returns:

translate()[source]

Translate various strings in the mobile app.