pycrossword  0.4
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | Private Attributes | List of all members
pycross.utils.pluginmanager.PxAPI Class Reference

Wrapper class for the application main window (pycross::gui::MainWindow). More...

Public Member Functions

def __init__ (self, mainwindow)
 Constructor takes a single parameter - the instance of pycross::gui::MainWindow (main window). More...
 
def trigger_action (self, action_name, display_name=True)
 Triggers an action of the app main window. More...
 
def global_options (self, option=None, option_sep='/')
 Returns a pointer to the global options dict guisettings::CWSettings::settings. More...
 
def get_prop (self, propname, default=None)
 Getter method for the main window members by their name. More...
 
def __getattr__ (self, attr)
 

Private Attributes

 __mainwindow
 pycross::gui::MainWindow internal pointer to app main window instance More...
 

Detailed Description

Wrapper class for the application main window (pycross::gui::MainWindow).

Adds a few convenience methods to call the main app actions, query and set global settings, etc. TODO: Must think of a more protected way to expose the main window's methods and members.

Constructor & Destructor Documentation

◆ __init__()

def pycross.utils.pluginmanager.PxAPI.__init__ (   self,
  mainwindow 
)

Constructor takes a single parameter - the instance of pycross::gui::MainWindow (main window).

Member Function Documentation

◆ __getattr__()

def pycross.utils.pluginmanager.PxAPI.__getattr__ (   self,
  attr 
)

◆ get_prop()

def pycross.utils.pluginmanager.PxAPI.get_prop (   self,
  propname,
  default = None 
)

Getter method for the main window members by their name.

Parameters
propnamestr member name (property or method)
defaultthe default value if the member wasn't found (default = None)
Returns
member of the main window instance

◆ global_options()

def pycross.utils.pluginmanager.PxAPI.global_options (   self,
  option = None,
  option_sep = '/' 
)

Returns a pointer to the global options dict guisettings::CWSettings::settings.

◆ trigger_action()

def pycross.utils.pluginmanager.PxAPI.trigger_action (   self,
  action_name,
  display_name = True 
)

Triggers an action of the app main window.

Parameters
action_namestr object name or display text of the action to be called
display_namebool True if the display text is passed, otherwise, the action will be located by its object (variable) name

Member Data Documentation

◆ __mainwindow

pycross.utils.pluginmanager.PxAPI.__mainwindow
private

pycross::gui::MainWindow internal pointer to app main window instance


The documentation for this class was generated from the following file: