Beispiel #1
0
    def __init__(self, config, record=False):
        """
        Init Program.

        :param record: whether to record results of API calls for playback
        """
        self._record = record
        self._config = config

        d = {}

        for key, default in list({
                'dot': True,
                'posix': True,
                'vfat': False,
                'whitespace': False,
                'printable': False
        }.items()):
            value = None
            value = self._config.getboolean('main', 'path_filter_' + key)
            if value is None:
                value = default

            d[key] = value

        self._filter = path.PathFilter(**d)
Beispiel #2
0
    def __init__(self, config, record=False, stdout=sys.stdout):
        self._record = record
        self._cache = cache.ResultCache()
        self._stdout = stdout
        self._config = config

        d = {}

        for key, default in {'fat': True, 'special': False}.items():
            value = None
            value = self._config.getboolean('main', 'path_filter_' + key)
            if value is None:
                value = default

            d[key] = value

        self._filter = path.PathFilter(**d)
Beispiel #3
0
    def __init__(self, config, record=False):
        """
        :param record: whether to record results of API calls for playback.
        """
        self._record = record
        self._cache = cache.ResultCache()
        self._config = config

        d = {}

        for key, default in list({'fat': True, 'special': False}.items()):
            value = None
            value = self._config.getboolean('main', 'path_filter_' + key)
            if value is None:
                value = default

            d[key] = value

        self._filter = path.PathFilter(**d)
 def setUp(self):
     self._filter_none = path.PathFilter(dot=False, posix=False,
                                         vfat=False, whitespace=False,
                                         printable=False)
     self._filter_dot = path.PathFilter(dot=True, posix=False,
                                        vfat=False, whitespace=False,
                                        printable=False)
     self._filter_posix = path.PathFilter(dot=False, posix=True,
                                          vfat=False, whitespace=False,
                                          printable=False)
     self._filter_vfat = path.PathFilter(dot=False, posix=False,
                                         vfat=True, whitespace=False,
                                         printable=False)
     self._filter_whitespace = path.PathFilter(dot=False, posix=False,
                                               vfat=False, whitespace=True,
                                               printable=False)
     self._filter_printable = path.PathFilter(dot=False, posix=False,
                                              vfat=False, whitespace=False,
                                              printable=True)
     self._filter_all = path.PathFilter(dot=True, posix=True, vfat=True,
                                        whitespace=True, printable=True)
Beispiel #5
0
 def setUp(self):
     self._filter = path.PathFilter(special=True)