Esempio n. 1
0
    def _file_name_changed ( self, old_file_name, new_file_name ):
        """ Handles the 'file_name' trait being changed.
        """
        if old_file_name != '':
            file_watch.watch( self._update, old_file_name, remove = True )

        if new_file_name != '':
            file_watch.watch( self._update, new_file_name )
            self._update( new_file_name )
Esempio n. 2
0
    def _selected_changed ( self, record ):
        """ Handles the user selecting a local variable.
        """
        # Only set up the file watch when a UI is actually active:
        if not self.initialized:
            self.initialized = True
            file_watch.watch( self.update_all_items, ui_db_name() )

        if record is not None:
            # Display the contents of the selected data base record:
            db = get_ui_db()
            if db is not None:
                id = record.id
                self.value = HasPayload( payload      = db[ id ],
                                         payload_name = id.split( '.' )[-1],
                                         payload_full_name = id )
                db.close()
        else:
            self.value = None
Esempio n. 3
0
    def _selected_changed(self, record):
        """ Handles the user selecting a local variable.
        """
        # Only set up the file watch when a UI is actually active:
        if not self.initialized:
            self.initialized = True
            file_watch.watch(self.update_all_items, ui_db_name())

        if record is not None:
            # Display the contents of the selected data base record:
            db = get_ui_db()
            if db is not None:
                id = record.id
                self.value = HasPayload(payload=db[id],
                                        payload_name=id.split('.')[-1],
                                        payload_full_name=id)
                db.close()
        else:
            self.value = None
Esempio n. 4
0
 def set_listener ( self, file_name, remove ):
     """ Sets up/Removes a file watch on a specified file.
     """
     if exists( file_name ):
         file_watch.watch( self.file_changed, file_name, remove = remove )
Esempio n. 5
0
 def stop_monitoring(self):
     """ Stops monitoring the associated path for file changes.
     """
     file_watch.watch(self._file_changed, self.path, remove=True)
Esempio n. 6
0
 def start_monitoring(self):
     """ Starts monitoring the associated path for file changes.
     """
     file_watch.watch(self._file_changed, self.path)
Esempio n. 7
0
 def stop_monitoring ( self ):
     """ Stops monitoring the associated path for file changes.
     """
     file_watch.watch( self._file_changed, self.path, remove = True )
Esempio n. 8
0
 def start_monitoring ( self ):
     """ Starts monitoring the associated path for file changes.
     """
     file_watch.watch( self._file_changed, self.path )
Esempio n. 9
0
 def _set_listener ( self, file_name, remove ):
     """ Sets up/Removes a file watch on a specified file.
     """
     if exists( file_name ):
         file_watch.watch( self._file_changed, file_name, remove = remove )