~ubuntu-branches/ubuntu/precise/ubuntuone-client/precise-201112142106

« back to all changes in this revision

Viewing changes to ubuntuone/platform/linux/filesystem_notifications.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2011-08-09 12:47:56 UTC
  • mfrom: (1.1.53 upstream)
  • Revision ID: james.westby@ubuntu.com-20110809124756-7nzilp3oix0a1yl9
Tags: 1.7.1-0ubuntu1
* New upstream release.
* debian/*:
  - Removed obsolete pycompat file
  - Removed ubuntuone-client-gnome deps and binary packaging, as it was
    moved out to separate project upstream.
  - Updated copyright to remove obsolete file reference
* debian/patches:
  - Removed patches which have been included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# Author: Facundo Batista <facundo@canonical.com>
4
4
#
5
 
# Copyright 2009 Canonical Ltd.
 
5
# Copyright 2009-2011 Canonical Ltd.
6
6
#
7
7
# This program is free software: you can redistribute it and/or modify it
8
8
# under the terms of the GNU General Public License version 3, as published
15
15
#
16
16
# You should have received a copy of the GNU General Public License along
17
17
# with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
18
19
"""Module that implements the Filesystem Monitor machinery."""
19
20
 
20
21
import logging
453
454
            w_dict = self._general_watchs
454
455
            events = INOTIFY_EVENTS_GENERAL
455
456
 
 
457
        # not add it if already there
 
458
        if dirpath in w_dict:
 
459
            self.log.debug("Watch already there for %r", dirpath)
 
460
            return defer.succeed(False)
 
461
 
456
462
        # add the watch!
457
463
        self.log.debug("Adding %s inotify watch to %r", w_type, dirpath)
458
464
        result = w_manager.add_watch(dirpath, events)
459
465
        w_dict[dirpath] = result[dirpath]
460
 
 
461
 
    def has_watch(self, dirpath):
462
 
        """Check if a dirpath is watched."""
463
 
        return (dirpath in self._general_watchs or
464
 
                dirpath in self._ancestors_watchs)
 
466
        return defer.succeed(True)
465
467
 
466
468
    def inotify_watch_fix(self, pathfrom, pathto):
467
469
        """Fix the path in inotify structures."""