Пример #1
0
 def use_arg(self, arg):
     if arg.key == 'includes':
         if is_iterable(arg.value):
             for v in arg.value:
                 self.arguments.value('includes').append(v)
         else:
             v = str(arg.value)
             self.arguments.value('includes').append(v)
         return
     super().use_arg(arg)
Пример #2
0
 def __init__(self, files=None, regexp=None, dirs=None, callback=None):
     self._regexp = regexp
     self._watchmanager = pyinotify.WatchManager()
     if files is not None:
         self._files = [os.path.abspath(f) for f in files]
     else:
         self._files = []
     self._dirs = set([os.path.dirname(f) for f in self._files])
     if dirs is not None:
         if is_iterable(dirs) and not isinstance(dirs, str):
             for x in dirs:
                 self._dirs.add(x)
         else:
             self._dirs.add(dirs)
     self._callback = callback
     assert self._callback is not None