コード例 #1
0
 def cancel(self):
     if self.__idle_id:
         gobject.source_remove(self.__idle_id)
         self.__idle_id = 0
     if self.__monid:
         gnomevfs.monitor_cancel(self.__monid)
         self.__monid = None
コード例 #2
0
ファイル: fs_gnomevfs.py プロジェクト: sandeep-datta/hotwire
 def cancel(self):
     if self.__idle_id:
         gobject.source_remove(self.__idle_id)
         self.__idle_id = 0
     if self.__monid:
         gnomevfs.monitor_cancel(self.__monid)
         self.__monid = None
コード例 #3
0
ファイル: FileGnomeVfs.py プロジェクト: arsfeld/conduit
    def add(self, folder, monitorType):
        if self._id != None:
            gnomevfs.monitor_cancel(self._id)
            self._id = None

        try:
            self._id = gnomevfs.monitor_add(folder, monitorType, self._monitor_cb)
        except gnomevfs.NotSupportedError:
            # silently fail if we are looking at a folder that doesn't support directory monitoring
            self._id = None
コード例 #4
0
ファイル: WebilderDesktop.py プロジェクト: Andrer757/webilder
def delete_files(main_window, forever):
    """Delete the selected files."""
    iconview = main_window.iconview
    selected = iconview.get_selected_items()
    if selected and len(selected)>1:
        if forever:
            message = _('Would you like to permanently delete the '
                        'selected images?')
        else:
            message = _('Would you like to delete the selected images?')

        dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION,
            buttons=gtk.BUTTONS_YES_NO,
            message_format=message)
        response = dlg.run()
        dlg.destroy()
        if response != gtk.RESPONSE_YES:
            return

    banned = open(os.path.expanduser('~/.webilder/banned_photos'), 'a')
    model = iconview.get_model()

    monitor = main_window.collection_monitor
    if monitor['monitor'] is not None:
        gnomevfs.monitor_cancel(monitor['monitor'])
        monitor['monitor'] = None

    for path in selected:
        iterator = model.get_iter(path)
        data = model.get_value(iterator,
            IV_DATA_COLUMN)
        for fname in (data['filename'], data['info_file'], data['thumb']):
            try:
                os.remove(fname)
            except (IOError, OSError):
                pass
        if forever:
            banned.write(os.path.basename(data['filename'])+'\n')
        model.remove(iterator)

    if monitor['dir']:
        monitor['monitor'] = gnomevfs.monitor_add(
            monitor['dir'],
            gnomevfs.MONITOR_DIRECTORY,
            main_window.collection_directory_changed)

    banned.close()
コード例 #5
0
def delete_files(main_window, forever):
    """Delete the selected files."""
    iconview = main_window.iconview
    selected = iconview.get_selected_items()
    if selected and len(selected) > 1:
        if forever:
            message = _('Would you like to permanently delete the '
                        'selected images?')
        else:
            message = _('Would you like to delete the selected images?')

        dlg = gtk.MessageDialog(type=gtk.MESSAGE_QUESTION,
                                buttons=gtk.BUTTONS_YES_NO,
                                message_format=message)
        response = dlg.run()
        dlg.destroy()
        if response != gtk.RESPONSE_YES:
            return

    banned = open(os.path.expanduser('~/.webilder/banned_photos'), 'a')
    model = iconview.get_model()

    monitor = main_window.collection_monitor
    if monitor['monitor'] is not None:
        gnomevfs.monitor_cancel(monitor['monitor'])
        monitor['monitor'] = None

    for path in selected:
        iterator = model.get_iter(path)
        data = model.get_value(iterator, IV_DATA_COLUMN)
        for fname in (data['filename'], data['info_file'], data['thumb']):
            try:
                os.remove(fname)
            except (IOError, OSError):
                pass
        if forever:
            banned.write(os.path.basename(data['filename']) + '\n')
        model.remove(iterator)

    if monitor['dir']:
        monitor['monitor'] = gnomevfs.monitor_add(
            monitor['dir'], gnomevfs.MONITOR_DIRECTORY,
            main_window.collection_directory_changed)

    banned.close()
コード例 #6
0
	def close(self):
		gnomevfs.monitor_cancel(self.monitor)
		self.monitor = None
コード例 #7
0
ファイル: io.py プロジェクト: dcreager/revelation
def file_monitor_cancel(handle):
	"Cancels file monitoring"

	gnomevfs.monitor_cancel(handle)
コード例 #8
0
ファイル: FileGnomeVfs.py プロジェクト: arsfeld/conduit
 def cancel(self):
     if self._id != None:
         gnomevfs.monitor_cancel(self._id)
         self._id = None