Beispiel #1
0
class Folders(Referenceable, SignalBroadcaster):
    """An interface to interact with User Defined Folders"""

    __metaclass__ = RemoteMeta

    # calls that will be accessible remotely
    remote_calls = [
        'create',
        'delete',
        'get_folders',
        'subscribe',
        'unsubscribe',
        'get_info',
        'refresh_volumes',
    ]

    def __init__(self, volume_manager, fs_manager):
        """Creates the instance."""
        super(Folders, self).__init__()
        self.syncdaemon_folders = SyncdaemonFolders(volume_manager, fs_manager)

    def create(self, path):
        """Create a user defined folder in the specified path."""
        logger.debug('Folders.create: %r', path)
        try:
            self.syncdaemon_folders.create(path)
        except Exception, e:
            logger.exception('Error while creating udf: %r', path)
            self.emit_folder_create_error(path, str(e))
Beispiel #2
0
 def __init__(self, volume_manager, fs_manager):
     """Creates the instance."""
     super(Folders, self).__init__()
     self.syncdaemon_folders = SyncdaemonFolders(volume_manager, fs_manager)