Beispiel #1
0
 def setup(self):
     args = self.args()
     overlap = args.int_arg('-o')
     disjoint = args.int_arg('-d')
     if overlap is not None and disjoint is not None:
         self.usage()
     elif overlap is not None:
         self._window_generator = _OverlapWindow(overlap)
     elif disjoint is not None:
         self._window_generator = _DisjointWindow(disjoint)
     else:
         predicate = args.next_function()
         self._window_generator = _PredicateWindow(predicate)
Beispiel #2
0
 def setup(self):
     args = self.args()
     overlap = args.int_arg('-o')
     disjoint = args.int_arg('-d')
     if overlap is not None and disjoint is not None:
         self.usage()
     elif overlap is not None:
         self._window_generator = _OverlapWindow(overlap)
     elif disjoint is not None:
         self._window_generator = _DisjointWindow(disjoint)
     else:
         predicate = args.next_function()
         self._window_generator = _PredicateWindow(predicate)
Beispiel #3
0
 def setup(self):
     args = self.args()
     self._count = args.next_int()
     self._start = args.next_int()
     pad = args.int_arg('-p')
     if self._start is None:
         self._start = 0
     if pad is not None:
         self._format = '%%0%sd' % pad
         if len(str(self._count + self._start)) > pad:
             self.usage()
     if args.has_next():
         self.usage()