Exemplo n.º 1
0
 def __init__(self, start, stop, categories=None, rand=True, maxnbr=None,
              state=None, name=None):
     super().__init__(
         geoiputils.IPRanges(ranges=[(utils.ip2int(start),
                                      utils.ip2int(stop))]),
         rand=rand, maxnbr=maxnbr, state=state,
         name=name or 'RANGE-%s-%s' % (start, stop), categories=categories,
     )
Exemplo n.º 2
0
 def __init__(self, count=10, categories=None, rand=True, maxnbr=None,
              state=None):
     Target.__init__(
         self,
         geoiputils.IPRanges(ranges=[(2130706433, 2130706432 + count)]),
         rand=rand, maxnbr=maxnbr, state=state
     )
     if categories is None:
         categories = ['TEST']
     self.infos = {'categories': categories}
Exemplo n.º 3
0
 def __init__(self, start, stop, categories=None, rand=True, maxnbr=None,
              state=None):
     Target.__init__(
         self,
         geoiputils.IPRanges(ranges=[(utils.ip2int(start),
                                      utils.ip2int(stop))]),
         rand=rand, maxnbr=maxnbr, state=state
     )
     if categories is None:
         categories = ['RANGE-%s-%s' % (start, stop)]
     self.infos = {'categories': categories}
Exemplo n.º 4
0
 def __init__(self, count=10, categories=None, rand=True, maxnbr=None,
              state=None):
     if count < 0:
         raise ValueError('count must be greater than or equal to 0')
     if count > 16777216:
         raise ValueError('count must be lower than or equal to 16777216')
     super().__init__(
         geoiputils.IPRanges(ranges=[(2130706433, 2130706432 + count)]),
         rand=rand, maxnbr=maxnbr, state=state, name='TEST-%d' % count,
         categories=categories,
     )