Ejemplo n.º 1
0
    def on_local_create(self, path):
        head, _ = os.path.split(path)
        if not self.drive_files.has_key(head):
            self.on_local_create(head)

        if self.drive_files.has_key(path):
            logger.info("file %s already exists", path)
            return

        # create drive item
        parent = self._find_parent(head)
        if parent is None:
            return

        to_create = GoogleDriveFile(path)
        to_create.create(parent.id)
        self.drive_files[path] = to_create