Transport

module: rspub.core.transport

Transport resources and sitemaps to the web server

class rspub.core.transport.TransportEvent[source]

Bases: enum.Enum

Events fired by Transport

All events are broadcast in the format:

[inform][confirm](source, event, **kwargs)

where source is the calling instance, event is the relevant event and **kwargs hold relevant information about the event.

copy_resource = 1

1 inform A resource was copied to a temporary location

copy_sitemap = 2

2 inform A sitemap was copied to a temporary location

copy_file = 3

3 confirm Copy file confirm message with interrupt

transfer_file = 4

4 confirm Transfer file confirm message with interrupt

resource_not_found = 10

10 inform A resource was not found

start_copy_to_temp = 15

15 inform Start copy resources and sitemaps to temporary directory

zip_resources = 20

20 inform Start packaging resources and sitemaps

scp_resources = 21

21 inform Start transfer of files with scp

ssh_client_creation = 22

22 inform Trying to create ssh client

scp_exception = 23

23 inform Encountered exception while transferring files with scp

scp_progress = 24

24 inform Progress as defined by SCPClient

scp_transfer_complete = 25

25 inform Transfer of one file complete

transport_start = 30

30 inform Transport started

transport_end = 31

31 inform Transport ended

class rspub.core.transport.ResourceAuditorEvent[source]

Bases: enum.Enum

Events fired by Transport

All events are broadcast in the format:

[inform](source, event, **kwargs)

where source is the calling instance, event is the relevant event and **kwargs hold relevant information about the event.

site_map_not_found = 11

11 inform`` A sitemap was not found

class rspub.core.transport.ResourceAuditor(paras)[source]

Bases: rspub.util.observe.Observable

__init__(paras)[source]
all_resources()[source]
all_resources_generator()[source]
last_resources_generator()[source]
extract_paths(uri)[source]
get_generator(all_resources)[source]
class rspub.core.transport.Transport(paras)[source]

Bases: rspub.core.transport.ResourceAuditor

__init__(paras)[source]
handle_resources(function, all_resources=False, include_description=True)[source]
zip_resources(all_resources=False)[source]
scp_resources(all_resources=False, password='secret')[source]
create_ssh_client(password)[source]
scp_put(files, remote_path)[source]
progress(filename, size, sent)[source]