示例#1
0
文件: monitor.py 项目: koll00/Gui_SM
 def update_remote_view(self):
     """
     Return remote view of globals()
     """
     settings = self.remote_view_settings
     if settings:
         ns = self.get_current_namespace()
         more_excluded_names = ['In', 'Out'] if self.ipython_shell else None
         remote_view = make_remote_view(ns, settings, more_excluded_names)
         communicate(self.n_request,
                     dict(command="remote_view", data=remote_view))
示例#2
0
 def update_remote_view(self):
     """
     Return remote view of globals()
     """
     settings = self.remote_view_settings
     if settings:
         ns = self.get_current_namespace()
         more_excluded_names = ['In', 'Out'] if self.ipython_shell else None
         remote_view = make_remote_view(ns, settings, more_excluded_names)
         communicate(self.n_request,
                     dict(command="remote_view", data=remote_view))
示例#3
0
文件: monitor.py 项目: koll00/Gui_SM
 def mglobals(self):
     """Return current globals -- handles Pdb frames"""
     if self.pdb_frame is not None:
         return self.pdb_frame.f_globals
     else:
         if self._mglobals is None:
             from __main__ import __dict__ as glbs
             self._mglobals = glbs
         else:
             glbs = self._mglobals
         if self.ipykernel is None and '__ipythonkernel__' in glbs:
             self.ipykernel = glbs['__ipythonkernel__']
             communicate(self.n_request,
                         dict(command="ipykernel",
                              data=self.ipykernel.connection_file))
         if self.ipython_shell is None and '__ipythonshell__' in glbs:
             # IPython 0.13+ kernel
             self.ipython_shell = glbs['__ipythonshell__']
             glbs = self.ipython_shell.user_ns
             self.ip = self.ipython_shell.get_ipython()
         self._mglobals = glbs
         return glbs
示例#4
0
 def mglobals(self):
     """Return current globals -- handles Pdb frames"""
     if self.pdb_frame is not None:
         return self.pdb_frame.f_globals
     else:
         if self._mglobals is None:
             from __main__ import __dict__ as glbs
             self._mglobals = glbs
         else:
             glbs = self._mglobals
         if self.ipykernel is None and '__ipythonkernel__' in glbs:
             self.ipykernel = glbs['__ipythonkernel__']
             communicate(
                 self.n_request,
                 dict(command="ipykernel",
                      data=self.ipykernel.connection_file))
         if self.ipython_shell is None and '__ipythonshell__' in glbs:
             # IPython 0.13+ kernel
             self.ipython_shell = glbs['__ipythonshell__']
             glbs = self.ipython_shell.user_ns
             self.ip = self.ipython_shell.get_ipython()
         self._mglobals = glbs
         return glbs
示例#5
0
def monitor_copy_global(sock, orig_name, new_name):
    """Copy global variable *orig_name* to *new_name*"""
    return communicate(sock, '__copy_global__("%s", "%s")' \
                       % (orig_name, new_name))
示例#6
0
def monitor_del_global(sock, name):
    """Del global variable *name*"""
    return communicate(sock, '__del_global__("%s")' % name)
示例#7
0
def monitor_set_global(sock, name, value):
    """Set global variable *name* value to *value*"""
    return communicate(sock, '__set_global__("%s")' % name, settings=[value])
示例#8
0
def monitor_get_global(sock, name):
    """Get global variable *name* value"""
    return communicate(sock, '__get_global__("%s")' % name)
示例#9
0
文件: monitor.py 项目: koll00/Gui_SM
def monitor_copy_global(sock, orig_name, new_name):
    """Copy global variable *orig_name* to *new_name*"""
    return communicate(sock, '__copy_global__("%s", "%s")' \
                       % (orig_name, new_name))
示例#10
0
 def notify_pdb_step(self, fname, lineno):
     """Notify the ExternalPythonShell regarding pdb current frame"""
     communicate(self.n_request,
                 dict(command="pdb_step", data=(fname, lineno)))
示例#11
0
文件: monitor.py 项目: koll00/Gui_SM
def monitor_load_globals(sock, filename, ext):
    """Load globals() from file"""
    return communicate(sock, '__load_globals__()', settings=[filename, ext])
示例#12
0
文件: monitor.py 项目: koll00/Gui_SM
def monitor_save_globals(sock, settings, filename):
    """Save globals() to file"""
    return communicate(sock, '__save_globals__()',
                       settings=[settings, filename])
示例#13
0
文件: monitor.py 项目: koll00/Gui_SM
 def notify_open_file(self, fname, lineno=1):
     """Open file in Spyder's editor"""
     communicate(self.n_request,
                 dict(command="open_file", data=(fname, lineno)))
示例#14
0
文件: monitor.py 项目: koll00/Gui_SM
 def notify_pdb_step(self, fname, lineno):
     """Notify the ExternalPythonShell regarding pdb current frame"""
     communicate(self.n_request,
                 dict(command="pdb_step", data=(fname, lineno)))
示例#15
0
文件: monitor.py 项目: koll00/Gui_SM
 def refresh(self):
     """Refresh variable explorer in ExternalPythonShell"""
     communicate(self.n_request, dict(command="refresh"))
示例#16
0
文件: monitor.py 项目: koll00/Gui_SM
def monitor_get_global(sock, name):
    """Get global variable *name* value"""
    return communicate(sock, '__get_global__("%s")' % name)
示例#17
0
 def refresh(self):
     """Refresh variable explorer in ExternalPythonShell"""
     communicate(self.n_request, dict(command="refresh"))
示例#18
0
文件: monitor.py 项目: koll00/Gui_SM
def monitor_set_global(sock, name, value):
    """Set global variable *name* value to *value*"""
    return communicate(sock, '__set_global__("%s")' % name,
                       settings=[value])
示例#19
0
 def notify_open_file(self, fname, lineno=1):
     """Open file in Spyder's editor"""
     communicate(self.n_request,
                 dict(command="open_file", data=(fname, lineno)))
示例#20
0
def monitor_load_globals(sock, filename, ext):
    """Load globals() from file"""
    return communicate(sock, '__load_globals__()', settings=[filename, ext])
示例#21
0
def monitor_save_globals(sock, settings, filename):
    """Save globals() to file"""
    return communicate(sock,
                       '__save_globals__()',
                       settings=[settings, filename])
示例#22
0
文件: monitor.py 项目: koll00/Gui_SM
def monitor_del_global(sock, name):
    """Del global variable *name*"""
    return communicate(sock, '__del_global__("%s")' % name)