ConsoleUser

Copyright (c) 2010-2023 Skaion Corporarion, www.skaion.com

This project was developed in part by numerous sponsorships from the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints of Governmental purposes notwithstanding any copyright notation thereon.

All content reflects those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or Skaion Corporation.

class StreamingMediaImpl.StreamingMediaImpl(system, config)

StreamingMedia allows a <no title> to interact with any type of Streaming Media source, e.g., YouTube or MediaGoblin, by only focusing on the high level tasks to accomplish, and letting a sub class decide how to carry out those tasks for the specific site being used.

Parameters:

  • system: a <no title> object to communicate with the target system

  • config: a <no title> object holding all our configuration

comment(msg)

Add a comment to the currently viewed media, if possible.

Parameters:

  • msg: the message to leave as a comment, which should be a string to be typed

confirm_comment()

Confirm that the comment was successfully posted.

confirm_upload()

Attempt to confirm that the upload was in fact successful.

consume(media)

Have the user consume the given media, whether by watching the video or listening to the music of whatever makes sense for this stream.

Parameters:

  • media: the identifier by which the User will find the desired media

consume_random()

Pick one of the available media options and consume it.

handle_load_dialog(path)

This should be inherited from Platform, if we got here it went up the wrong path, so let’s try to redirect up the correct side.

Parameters:

  • path: the string path to the file to upload

load(path)

:doc:Platform load tries to expand the File menu and look for Open, but that isn’t what this site needs, so we will change how the start of the method works to click on the “Browse” button instead.

Parameters:

  • path: the string path to the file to upload

submit_comment()

This provides a hook for subclasses to provide their own method of submitting a comment

submit_upload()

This provides a hook for subclasses to provide their own method of submitting the media to be uploaded.

upload(path, title, desc='', tags=(), extra=())

Uplaod a new piece of media to the site.

Parameters:

  • path: the string path to the file to upload

  • title: the title of the media being uploaded

  • desc: optionally the description of the media

  • tags: optionally an iterable of strings of tags for this media

  • extra: optionally an iterable with extra information for this particular media type/site

StreamingMediaImpl.get_streaming_media_client(system, config, stype=None)

This is a factory to use config information to load an instance of the correct class so a <no title> call will be implemented against the correct type of site.

Parameters:

  • system: a <no title> object to communicate with the target system

  • config: a <no title> object holding all our configuration

  • stype: optionally the (string) name of the type of client to create, overriding anything in the config object