Package peppy :: Package plugins :: Package games :: Module hangman_mode :: Class RestartGame
[frames] | no frames]

Class RestartGame

      object --+        
               |        
debug.debugmixin --+    
                   |    
actions.SelectAction --+
                       |
                      RestartGame

Restart the current game with a new word.

Reset the gallows and pick a new word.

Instance Methods
 
action(self, index=-1, multiplier=1)
Override this to provide the functionality of the action.

Inherited from actions.SelectAction: __call__, __init__, getMenuItemName, getSubIds, getTooltip, initPostHook, initPreHook, insertIntoMenu, insertIntoToolbar, isEnabled, showEnable

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods
 
worksWithMajorMode(cls, mode)
Hook to restrict the action to only be displayed with a specific major mode

Inherited from actions.SelectAction: getHelp, setAcceleratorText

Inherited from debug.debugmixin: dprint

Class Variables
  alias = _("restart-game")
This alias holds an emacs style name that is used during M-X processing.
  name = _("Restart Game")
This is the name of the menu entry as it appears in the menu bar.
  tooltip = _("Restart Game")
Tooltip that is displayed when the mouse is hovering over the menu entry.
  default_menu = "Hangman", 100
The default menu location is specified here as a tuple containing the menu path (separated by / characters) and a number between 1 and 1000 representing the position within the menu.
  key_bindings = {'default': 'C-R'}
Map of platform to default keybinding.

Inherited from actions.SelectAction: default_toolbar, global_id, icon, keyboard, stock_id

Inherited from debug.debugmixin: debuglevel

Properties

Inherited from object: __class__

Method Details

worksWithMajorMode(cls, mode)
Class Method

 

Hook to restrict the action to only be displayed with a specific major mode

This hook is called by the menu creation code to determine if the action should be displayed when showing the major mode's user interface.

Parameters:
  • mode - the major mode instance
Returns:
True if the action is allowed to be associated with the major mode
Overrides: actions.SelectAction.worksWithMajorMode
(inherited documentation)

action(self, index=-1, multiplier=1)

 

Override this to provide the functionality of the action.

This method gets called when the user initiates the action, whether it be from the menu bar, toolbar, or keyboard.

Parameters:
  • index - The index of the item in the list. This is only useful for list or radio items.
  • multiplier - the multiplier supplied by the keyboard handler. The keyboard handler allows for emacs-style repeat commands. For some actions, it makes sense to allow repetition of the command. For instance, in a command that uppercases words, the multiplier could be 4, would mean that the next 4 words get uppercased. The default is 1.
Overrides: actions.SelectAction.action
(inherited documentation)