Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
idlelib.CallTips.CallTips Class Reference

List of all members.

Public Member Functions

def __init__
def close
def force_open_calltip_event
def try_open_calltip_event
def refresh_calltip_event
def open_calltip
def fetch_tip
def get_entity

Public Attributes

 editwin
 text
 active_calltip

Static Public Attributes

list menudefs

Private Member Functions

def _make_tk_calltip_window
def _remove_calltip_window

Private Attributes

 _calltip_window

Detailed Description

Definition at line 18 of file CallTips.py.


Constructor & Destructor Documentation

def idlelib.CallTips.CallTips.__init__ (   self,
  editwin = None 
)

Definition at line 26 of file CallTips.py.

00026 
00027     def __init__(self, editwin=None):
00028         if editwin is None:  # subprocess and test
00029             self.editwin = None
00030         else:
00031             self.editwin = editwin
00032             self.text = editwin.text
00033             self.active_calltip = None
00034             self._calltip_window = self._make_tk_calltip_window

Here is the caller graph for this function:


Member Function Documentation

Definition at line 38 of file CallTips.py.

00038 
00039     def _make_tk_calltip_window(self):
00040         # See __init__ for usage
00041         return CallTipWindow.CallTip(self.text)

def idlelib.CallTips.CallTips._remove_calltip_window (   self,
  event = None 
) [private]

Definition at line 42 of file CallTips.py.

00042 
00043     def _remove_calltip_window(self, event=None):
00044         if self.active_calltip:
00045             self.active_calltip.hidetip()
00046             self.active_calltip = None

Here is the caller graph for this function:

Definition at line 35 of file CallTips.py.

00035 
00036     def close(self):
00037         self._calltip_window = None

Here is the caller graph for this function:

def idlelib.CallTips.CallTips.fetch_tip (   self,
  name 
)
Return the argument list and docstring of a function or class.

If there is a Python subprocess, get the calltip there.  Otherwise,
either this fetch_tip() is running in the subprocess or it was
called in an IDLE running without the subprocess.

The subprocess environment is that of the most recently run script.  If
two unrelated modules are being edited some calltips in the current
module may be inoperative if the module was not the last to run.

To find methods, fetch_tip must be fed a fully qualified name.

Definition at line 81 of file CallTips.py.

00081 
00082     def fetch_tip(self, name):
00083         """Return the argument list and docstring of a function or class.
00084 
00085         If there is a Python subprocess, get the calltip there.  Otherwise,
00086         either this fetch_tip() is running in the subprocess or it was
00087         called in an IDLE running without the subprocess.
00088 
00089         The subprocess environment is that of the most recently run script.  If
00090         two unrelated modules are being edited some calltips in the current
00091         module may be inoperative if the module was not the last to run.
00092 
00093         To find methods, fetch_tip must be fed a fully qualified name.
00094 
00095         """
00096         try:
00097             rpcclt = self.editwin.flist.pyshell.interp.rpcclt
00098         except:
00099             rpcclt = None
00100         if rpcclt:
00101             return rpcclt.remotecall("exec", "get_the_calltip",
00102                                      (name,), {})
00103         else:
00104             entity = self.get_entity(name)
00105             return get_argspec(entity)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 47 of file CallTips.py.

00047 
00048     def force_open_calltip_event(self, event):
00049         "The user selected the menu entry or hotkey, open the tip."
00050         self.open_calltip(True)

Here is the call graph for this function:

def idlelib.CallTips.CallTips.get_entity (   self,
  name 
)

Definition at line 106 of file CallTips.py.

00106 
00107     def get_entity(self, name):
00108         "Lookup name in a namespace spanning sys.modules and __main.dict__."
00109         if name:
00110             namespace = sys.modules.copy()
00111             namespace.update(__main__.__dict__)
00112             try:
00113                 return eval(name, namespace)
00114             except (NameError, AttributeError):
00115                 return None

Here is the caller graph for this function:

def idlelib.CallTips.CallTips.open_calltip (   self,
  evalfuncs 
)

Definition at line 62 of file CallTips.py.

00062 
00063     def open_calltip(self, evalfuncs):
00064         self._remove_calltip_window()
00065 
00066         hp = HyperParser(self.editwin, "insert")
00067         sur_paren = hp.get_surrounding_brackets('(')
00068         if not sur_paren:
00069             return
00070         hp.set_index(sur_paren[0])
00071         name = hp.get_expression()
00072         if not name:
00073             return
00074         if not evalfuncs and (name.find('(') != -1):
00075             return
00076         argspec = self.fetch_tip(name)
00077         if not argspec:
00078             return
00079         self.active_calltip = self._calltip_window()
00080         self.active_calltip.showtip(argspec, sur_paren[0], sur_paren[1])

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 58 of file CallTips.py.

00058 
00059     def refresh_calltip_event(self, event):
00060         if self.active_calltip and self.active_calltip.is_active():
00061             self.open_calltip(False)

Here is the call graph for this function:

Happens when it would be nice to open a CallTip, but not really
necessary, for example after an opening bracket, so function calls
won't be made.

Definition at line 51 of file CallTips.py.

00051 
00052     def try_open_calltip_event(self, event):
00053         """Happens when it would be nice to open a CallTip, but not really
00054         necessary, for example after an opening bracket, so function calls
00055         won't be made.
00056         """
00057         self.open_calltip(False)

Here is the call graph for this function:


Member Data Documentation

Definition at line 33 of file CallTips.py.

Definition at line 32 of file CallTips.py.

Definition at line 28 of file CallTips.py.

Initial value:
[
        ('edit', [
            ("Show call tip", "<<force-open-calltip>>"),
        ])
    ]

Definition at line 20 of file CallTips.py.

Definition at line 31 of file CallTips.py.


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