Module pywraps :: Class cli_t
[frames] | no frames]

Class cli_t

           object --+    
                    |    
pyidc_opaque_object_t --+
                        |
                       cli_t

cli_t wrapper class. This class allows you to implement your own command line interface handlers.

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
register(self, flags=0, sname=None, lname=None, hint=None)
Registers the CLI.
 
unregister(self)
Unregisters the CLI (if it was registered)
 
__del__(self)
 
OnExecuteLine(self, line)
The user pressed Enter.
 
OnKeydown(self, line, x, sellen, vkey, shift)
A keyboard key has been pressed This is a generic callback and the CLI is free to do whatever it wants.
 
OnCompleteLine(self, prefix, n, line, prefix_start)
The user pressed Tab.

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

Class Variables

Inherited from pyidc_opaque_object_t: __idc_cvt_id__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

register(self, flags=0, sname=None, lname=None, hint=None)

 

Registers the CLI.

Parameters:
  • flags - Feature bits. No bits are defined yet, must be 0
  • sname - Short name (displayed on the button)
  • lname - Long name (displayed in the menu)
  • hint - Hint for the input line

OnExecuteLine(self, line)

 

The user pressed Enter. The CLI is free to execute the line immediately or ask for more lines.

This callback is mandatory.

Parameters:
  • line - typed line(s)

OnKeydown(self, line, x, sellen, vkey, shift)

 

A keyboard key has been pressed This is a generic callback and the CLI is free to do whatever it wants.

This callback is optional.

Parameters:
  • line - current input line
  • x - current x coordinate of the cursor
  • sellen - current selection length (usually 0)
  • vkey - virtual key code. if the key has been handled, it should be returned as zero
  • shift - shift state
Returns:
None - Nothing was changed tuple(line, x, sellen, vkey): if either of the input line or the x coordinate or the selection length has been modified. It is possible to return a tuple with None elements to preserve old values. Example: tuple(new_line, None, None, None) or tuple(new_line)

OnCompleteLine(self, prefix, n, line, prefix_start)

 

The user pressed Tab. Find a completion number N for prefix PREFIX

This callback is optional.

Parameters:
  • prefix - Line prefix at x (string)
  • n - completion number (int)
  • line - the current line (string)
  • prefix_start - the index where PREFIX starts in LINE (int)
Returns:
None if no completion could be generated otherwise a String with the completion suggestion