def __init__(self, host, userPath, mode, dryrun):
        """ Initialize. """
        self.host = host

        # { vol: [path] }
        # The order of the paths is important to work around btrfs bugs.
        # The first path is usually the root-volume mounted path,
        # which is required by btrfs 3.14.2.
        self.paths = collections.defaultdict((lambda: []))

        if not userPath.endswith("/"):
            self.userVolume = os.path.basename(userPath)
            userPath = os.path.dirname(userPath)
        else:
            self.userVolume = None

        # This will not end with a "/"
        userPath = os.path.normpath(userPath)

        assert userPath.startswith("/"), userPath
        self.userPath = userPath

        logger.debug("%s('%s')", self.__class__.__name__, userPath)

        self.mode = mode
        self.dryrun = dryrun

        self.ignoreExtraVolumes = False
        self.isRemote = False
        self.isDiffStore = False

        # False - Never show progress
        # True - Always show progress
        # None - Show progress for one-sided actions (e.g. measuring)
        self.showProgress = None
def __init__ ( self , host , userPath , mode , dryrun ) : self . host = host self . paths = collections . defaultdict ( ( lambda : [ ] ) ) if not userPath . endswith ( "/" ) : self . userVolume = os . path . basename ( userPath ) userPath = os . path . dirname ( userPath ) else : self . userVolume = None userPath = os . path . normpath ( userPath ) assert userPath . startswith ( "/" ) , userPath self . userPath = userPath logger . debug ( "%s('%s')" , self . __class__ . __name__ , userPath ) self . mode = mode self . dryrun = dryrun self . ignoreExtraVolumes = False self . isRemote = False self . isDiffStore = False self . showProgress = None
Initialize.