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 ImageSharingImpl.ImageSharingImpl(system, conf)¶
This is the public interface for <no title> objects to interact with an image sharing site, without the <no title> having to know anything about the actual site being used.
Parameters:
system: the <no title> object to interact with the remote system
conf: the <no title> object defining this user
- comment(msg)¶
Add the given message as a comment to the currently viewed entry.
Parameters:
msg: a string that ConsoleUser will type into the comment box
- go_home()¶
Return to the Home page, regardless of where we are now.
- upload(path, desc)¶
Upload a new image with a given description, which can be empty to add no description/text to the image.
Parameters:
path: the path to the file to upload
desc: the text to add as a description of the image
- view(identifier)¶
View/read the page with the given identifier
Parameters:
identifier: the way the client will find the appropriate entry to view
- view_random()¶
Pick an entry at random and view it
- ImageSharingImpl.get_image_sharing(system, config, sharing_type=None)¶
Create an instance of the correct image sharing site implementor based on either values from config or sharing_type if that is given.
Parameters:
system: the <no title> the user interacts with the target system on
config: the <no title> object defining this user
sharing_type: optionally a value of the type of ImageSharingImpl to create regardless of what is in config
Return an instance that implements the <no title> interface or None if no suitable type is found
Examples:
sharing = get_image_sharing( self.system, self.config )
sharing = get_image_sharing( system, config, “friendicaIE9” )