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 WordProcessor.WordProcessor(system, config, p_type=None)

This is the abstract class which a <no title> interacts with to control a Word Processor (like MS Word or OpenOffice.org Writer). Combined with an instance of WordProcessorImpl these classes implement the Bridge Pattern

Parameters:

  • system: a <no title> object letting us control the remote system

  • config: a <no title> object containing the configuration for this user

  • p_type: optionally override the config file type of word processor to get an instance for a particular word processor, regardless of the default

close_all(save=False)

Exit the application, closing all documents. By default this will not save changes to documents, but this can be overriden if desired.

Parameters:

  • save: whether or not to save changes to documents if prompted

close_document(save=False)

Close the currently active document and switch to a random other open one if any are available. If this is the last open document it will cause Word to exit too. This will not save the document if prompted unless otherwise told to do so.

Parameters:

  • save: whether or not to save the changes if prompted

edit(text)

Type the given text into the currently active document.

Parameters:

  • text: the text to be typed to the current location in the file

insert_pic(path)

Insert a picture from an external file.

Parameters:

  • path: the path to an image file to include in the current document

load(path)

Load a file from the given path.

Parameters:

  • path: the path to the target path

new_document()

Open a new document in the open application

save()

Save the currently active document

save_as(path)

Save the currently active document to a new path.

Parameters:

  • path: the new path