예제 #1
0
    def __init__(self, *args, **kwargs):
        Process.__init__(self)
        if (len(args) > 1 and
            not any(isinstance(arg, (TableExpression, list, tuple))
                    for arg in args)):
            args = (args,)
        self.args = args
        suffix = kwargs.pop('suffix', '')
        fname = kwargs.pop('fname', None)
        mode = kwargs.pop('mode', 'w')
        if kwargs:
            kwarg, _ = kwargs.popitem()
            raise TypeError("'%s' is an invalid keyword argument for csv()"
                            % kwarg)

        if fname is not None and suffix:
            raise ValueError("csv() can't have both 'suffix' and 'fname' "
                             "arguments")
        if fname is None:
            suffix = "_" + suffix if suffix else ""
            fname = "{entity}_{period}" + suffix + ".csv"
        self.fname = fname
        if mode not in ('w', 'a'):
            raise ValueError("csv() mode argument must be either "
                             "'w' (overwrite) or 'a' (append)")
        self.mode = mode
예제 #2
0
 def __init__(self, filter):
     Process.__init__(self)
     self.filter = filter
예제 #3
0
 def __init__(self, expr1, expr2):
     Process.__init__(self)
     self.expr1 = expr1
     self.expr2 = expr2
예제 #4
0
 def __init__(self, expr):
     Process.__init__(self)
     self.expr = expr
예제 #5
0
 def __init__(self, period=None):
     Process.__init__(self)
     self.period = period
예제 #6
0
 def __init__(self, *args):
     Process.__init__(self)
     self.args = args