Module refinery.units.meta.iffs

Expand source code Browse git
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from . import arg, ConditionalUnit


class iffs(ConditionalUnit):
    """
    Filter incoming chunks depending on whether they contain a given binary substring.
    """
    def __init__(self, needle: arg(help='the string to search for'), negate=False, temporary=False):
        super().__init__(negate=negate, temporary=temporary, needle=needle)

    def match(self, chunk):
        return self.args.needle in chunk

Classes

class iffs (needle, negate=False, temporary=False)

Filter incoming chunks depending on whether they contain a given binary substring.

Expand source code Browse git
class iffs(ConditionalUnit):
    """
    Filter incoming chunks depending on whether they contain a given binary substring.
    """
    def __init__(self, needle: arg(help='the string to search for'), negate=False, temporary=False):
        super().__init__(negate=negate, temporary=temporary, needle=needle)

    def match(self, chunk):
        return self.args.needle in chunk

Ancestors

Methods

def match(self, chunk)
Expand source code Browse git
def match(self, chunk):
    return self.args.needle in chunk

Inherited members