コード例 #1
0
 def option_changed(self, option, value):
     """Option has changed"""
     setattr(self, to_text_string(option), value)
     if not self.is_internal_shell:
         settings = self.get_view_settings()
         communicate(self._get_sock(),
                     'set_remote_view_settings()', settings=[settings])
コード例 #2
0
 def option_changed(self, option, value):
     """Option has changed"""
     setattr(self, to_text_string(option), value)
     if not self.is_internal_shell:
         settings = self.get_view_settings()
         communicate(self._get_sock(),
                     'set_remote_view_settings()',
                     settings=[settings])
コード例 #3
0
 def option_changed(self, option, value):
     """Option has changed"""
     setattr(self, to_text_string(option), value)
     if self.is_ipyclient:
         self.shellwidget.set_namespace_view_settings()
         self.refresh_table()
     else:
         settings = self.get_view_settings()
         communicate(self._get_sock(),
                     'set_remote_view_settings()', settings=[settings])
コード例 #4
0
 def option_changed(self, option, value):
     """Option has changed"""
     setattr(self, to_text_string(option), value)
     if self.is_ipyclient:
         self.shellwidget.set_namespace_view_settings()
         self.refresh_table()
     else:
         settings = self.get_view_settings()
         communicate(self._get_sock(),
                     'set_remote_view_settings()',
                     settings=[settings])
コード例 #5
0
 def refresh_table(self):
     """Refresh variable table"""
     if self.is_visible and self.isVisible():
         if self.is_ipyclient:
             self.shellwidget.refresh_namespacebrowser()
         else:
             if self.shellwidget.is_running():
                 sock = self._get_sock()
                 if sock is None:
                     return
                 try:
                     communicate(sock, "refresh()")
                 except socket.error:
                     # Process was terminated before calling this method
                     pass
コード例 #6
0
 def refresh_table(self):
     """Refresh variable table"""
     if self.is_visible and self.isVisible():
         if self.is_ipyclient:
             self.shellwidget.refresh_namespacebrowser()
         else:
             if self.shellwidget.is_running():
                 sock = self._get_sock()
                 if sock is None:
                     return
                 try:
                     communicate(sock, "refresh()")
                 except socket.error:
                     # Process was terminated before calling this method
                     pass
コード例 #7
0
 def is_data_frame(self, name):
     """Return True if variable is a DataFrame"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_data_frame']
     else:
         return communicate(self._get_sock(),
                            "isinstance(globals()['%s'], DataFrame)" % name)
コード例 #8
0
 def is_list(self, name):
     """Return True if variable is a list or a tuple"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_list']
     else:
         return communicate(self._get_sock(),
                            'isinstance(%s, (tuple, list))' % name)
コード例 #9
0
 def is_series(self, name):
     """Return True if variable is a Series"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_series']
     else:
         return communicate(self._get_sock(),
                            "isinstance(globals()['%s'], Series)" % name)
コード例 #10
0
 def is_series(self, name):
     """Return True if variable is a Series"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_series']
     else:
         return communicate(self._get_sock(),
                            "isinstance(globals()['%s'], Series)" % name)
コード例 #11
0
 def is_data_frame(self, name):
     """Return True if variable is a DataFrame"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_data_frame']
     else:
         return communicate(self._get_sock(),
                            "isinstance(globals()['%s'], DataFrame)" % name)
コード例 #12
0
 def is_list(self, name):
     """Return True if variable is a list or a tuple"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_list']
     else:
         return communicate(self._get_sock(),
                            'isinstance(%s, (tuple, list))' % name)
コード例 #13
0
 def get_value(self, name):
     value = monitor_get_global(self._get_sock(), name)
     if value is None:
         if communicate(self._get_sock(), '%s is not None' % name):
             import pickle
             msg = to_text_string(_("Object <b>%s</b> is not picklable")
                                  % name)
             raise pickle.PicklingError(msg)
     return value
コード例 #14
0
 def get_value(self, name):
     value = monitor_get_global(self._get_sock(), name)
     if value is None:
         if communicate(self._get_sock(), '%s is not None' % name):
             import pickle
             msg = to_text_string(
                 _("Object <b>%s</b> is not picklable") % name)
             raise pickle.PicklingError(msg)
     return value
コード例 #15
0
 def refresh_table(self):
     """Refresh variable table"""
     if self.is_visible and self.isVisible():
         if self.is_internal_shell:
             # Internal shell
             wsfilter = self.get_internal_shell_filter('editable')
             self.editor.set_filter(wsfilter)
             interpreter = self.shellwidget.interpreter
             if interpreter is not None:
                 self.editor.set_data(interpreter.namespace)
                 self.editor.adjust_columns()
         elif self.shellwidget.is_running():
             #            import time; print >>STDOUT, time.ctime(time.time()), "Refreshing namespace browser"
             sock = self._get_sock()
             if sock is None:
                 return
             try:
                 communicate(sock, "refresh()")
             except socket.error:
                 # Process was terminated before calling this method
                 pass
コード例 #16
0
 def refresh_table(self):
     """Refresh variable table"""
     if self.is_visible and self.isVisible():
         if self.is_internal_shell:
             # Internal shell
             wsfilter = self.get_internal_shell_filter('editable')
             self.editor.set_filter(wsfilter)
             interpreter = self.shellwidget.interpreter
             if interpreter is not None:
                 self.editor.set_data(interpreter.namespace)
                 self.editor.adjust_columns()
         elif self.shellwidget.is_running():
 #            import time; print >>STDOUT, time.ctime(time.time()), "Refreshing namespace browser"
             sock = self._get_sock()
             if sock is None:
                 return
             try:
                 communicate(sock, "refresh()")
             except socket.error:
                 # Process was terminated before calling this method
                 pass                
コード例 #17
0
    def get_value(self, name):
        if self.is_ipyclient:
            value = self.shellwidget.get_value(name)

            # Reset temporal variable where value is saved to
            # save memory
            self.shellwidget._kernel_value = None
        else:
            value = monitor_get_global(self._get_sock(), name)
            if value is None:
                if communicate(self._get_sock(), '%s is not None' % name):
                    import pickle
                    msg = to_text_string(_("Object <b>%s</b> is not picklable")
                                         % name)
                    raise pickle.PicklingError(msg)
        return value
コード例 #18
0
    def get_value(self, name):
        if self.is_ipyclient:
            value = self.shellwidget.get_value(name)

            # Reset temporal variable where value is saved to
            # save memory
            self.shellwidget._kernel_value = None
        else:
            value = monitor_get_global(self._get_sock(), name)
            if value is None:
                if communicate(self._get_sock(), '%s is not None' % name):
                    import pickle
                    msg = to_text_string(
                        _("Object <b>%s</b> is not picklable") % name)
                    raise pickle.PicklingError(msg)
        return value
コード例 #19
0
 def is_array(self, name):
     """Return True if variable is a NumPy array"""
     return communicate(self._get_sock(), 'is_array("%s")' % name)
コード例 #20
0
 def is_dict(self, name):
     """Return True if variable is a dictionary"""
     return communicate(self._get_sock(), 'isinstance(%s, dict)' % name)
コード例 #21
0
 def get_len(self, name):
     """Return sequence length"""
     return communicate(self._get_sock(), "len(%s)" % name)
コード例 #22
0
 def is_dict(self, name):
     """Return True if variable is a dictionary"""
     return communicate(self._get_sock(), 'isinstance(%s, dict)' % name)
コード例 #23
0
 def is_array(self, name):
     """Return True if variable is a NumPy array"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_array']
     else:
         return communicate(self._get_sock(), 'is_array("%s")' % name)
コード例 #24
0
 def is_series(self, name):
     """Return True if variable is a Series"""
     return communicate(self._get_sock(),
                        "isinstance(globals()['%s'], Series)" % name)
コード例 #25
0
 def get_array_ndim(self, name):
     """Return array's ndim"""
     return communicate(self._get_sock(), "%s.ndim" % name)
コード例 #26
0
 def get_len(self, name):
     """Return sequence length"""
     if self.is_ipyclient:
         return self.var_properties[name]['len']
     else:
         return communicate(self._get_sock(), "len(%s)" % name)
コード例 #27
0
 def get_array_ndim(self, name):
     """Return array's ndim"""
     return communicate(self._get_sock(), "%s.ndim" % name)
コード例 #28
0
 def is_data_frame(self, name):
     """Return True if variable is a DataFrame"""
     return communicate(self._get_sock(),
          "isinstance(globals()['%s'], DataFrame)" % name)
コード例 #29
0
 def get_array_shape(self, name):
     """Return array's shape"""
     if self.is_ipyclient:
         return self.var_properties[name]['array_shape']
     else:
         return communicate(self._get_sock(), "%s.shape" % name)
コード例 #30
0
 def is_image(self, name):
     """Return True if variable is a PIL.Image image"""
     return communicate(self._get_sock(), 'is_image("%s")' % name)
コード例 #31
0
 def is_array(self, name):
     """Return True if variable is a NumPy array"""
     return communicate(self._get_sock(), 'is_array("%s")' % name)
コード例 #32
0
 def get_len(self, name):
     """Return sequence length"""
     return communicate(self._get_sock(), "len(%s)" % name)
コード例 #33
0
 def is_image(self, name):
     """Return True if variable is a PIL.Image image"""
     return communicate(self._get_sock(), 'is_image("%s")' % name)
コード例 #34
0
 def toggle_auto_refresh(self, state):
     """Toggle auto refresh state"""
     self.autorefresh = state
     if not self.setup_in_progress and not self.is_ipyclient:
         communicate(self._get_sock(),
                     "set_monitor_auto_refresh(%r)" % state)
コード例 #35
0
 def is_data_frame(self, name):
     """Return True if variable is a DataFrame"""
     return communicate(self._get_sock(),
                        "isinstance(globals()['%s'], DataFrame)" % name)
コード例 #36
0
 def is_dict(self, name):
     """Return True if variable is a dictionary"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_dict']
     else:
         return communicate(self._get_sock(), 'isinstance(%s, dict)' % name)
コード例 #37
0
 def get_array_shape(self, name):
     """Return array's shape"""
     return communicate(self._get_sock(), "%s.shape" % name)
コード例 #38
0
 def is_array(self, name):
     """Return True if variable is a NumPy array"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_array']
     else:
         return communicate(self._get_sock(), 'is_array("%s")' % name)
コード例 #39
0
 def is_dict(self, name):
     """Return True if variable is a dictionary"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_dict']
     else:
         return communicate(self._get_sock(), 'isinstance(%s, dict)' % name)
コード例 #40
0
 def is_list(self, name):
     """Return True if variable is a list or a tuple"""
     return communicate(self._get_sock(),
                        'isinstance(%s, (tuple, list))' % name)
コード例 #41
0
 def is_image(self, name):
     """Return True if variable is a PIL.Image image"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_image']
     else:
         return communicate(self._get_sock(), 'is_image("%s")' % name)
コード例 #42
0
 def get_array_ndim(self, name):
     """Return array's ndim"""
     if self.is_ipyclient:
         return self.var_properties[name]['array_ndim']
     else:
         return communicate(self._get_sock(), "%s.ndim" % name)
コード例 #43
0
 def get_len(self, name):
     """Return sequence length"""
     if self.is_ipyclient:
         return self.var_properties[name]['len']
     else:
         return communicate(self._get_sock(), "len(%s)" % name)
コード例 #44
0
 def is_list(self, name):
     """Return True if variable is a list or a tuple"""
     return communicate(self._get_sock(),
                        'isinstance(%s, (tuple, list))' % name)
コード例 #45
0
 def is_image(self, name):
     """Return True if variable is a PIL.Image image"""
     if self.is_ipyclient:
         return self.var_properties[name]['is_image']
     else:
         return communicate(self._get_sock(), 'is_image("%s")' % name)
コード例 #46
0
 def toggle_auto_refresh(self, state):
     """Toggle auto refresh state"""
     self.autorefresh = state
     if not self.setup_in_progress and not self.is_internal_shell:
         communicate(self._get_sock(),
                     "set_monitor_auto_refresh(%r)" % state)
コード例 #47
0
 def is_series(self, name):
     """Return True if variable is a Series"""
     return communicate(self._get_sock(),
          "isinstance(globals()['%s'], Series)" % name)
コード例 #48
0
 def get_array_shape(self, name):
     """Return array's shape"""
     if self.is_ipyclient:
         return self.var_properties[name]['array_shape']
     else:
         return communicate(self._get_sock(), "%s.shape" % name)
コード例 #49
0
 def get_array_ndim(self, name):
     """Return array's ndim"""
     if self.is_ipyclient:
         return self.var_properties[name]['array_ndim']
     else:
         return communicate(self._get_sock(), "%s.ndim" % name)
コード例 #50
0
 def get_array_shape(self, name):
     """Return array's shape"""
     return communicate(self._get_sock(), "%s.shape" % name)