Esempio n. 1
0
    def __init__(self, s=None, **kwargs):

        if s is not None:
            m = timing_regex.match(s)
            if m:
                if m.group(3):
                    phase_ids = m.group(3).split('|')
                elif m.group(5):
                    phase_ids = [m.group(5)]
                else:
                    phase_ids = []

                select = m.group(2) or ''

                offset = 0.0
                if m.group(6):
                    offset = float(m.group(6))

                kwargs = dict(
                    phase_ids=phase_ids,
                    select=select,
                    offset=offset)

            else:
                raise InvalidTimingSpecification(s)

        SObject.__init__(self, **kwargs)
Esempio n. 2
0
    def __init__(self, s=None, **kwargs):
        if s is not None:
            t = s.split('=')
            if len(t) != 2:
                raise InvalidGridSpec(
                    'invalid grid specification element: %s' % s)

            sp, sr = t[0].strip(), t[1].strip()

            kwargs['param'] = sp
            kwargs['rs'] = RS(sr)

        SObject.__init__(self, **kwargs)
Esempio n. 3
0
    def __init__(self, s=None, **kwargs):
        if s is not None:
            t = s.splitlines()
            tt = []
            for x in t:
                x = x.strip()
                if x:
                    tt.extend(x.split(';'))

            elements = []
            for se in tt:
                elements.append(GSE(se))

            kwargs['elements'] = elements

        SObject.__init__(self, **kwargs)
Esempio n. 4
0
    def __init__(self, *args, **kwargs):
        d = {}
        if len(args) == 1:
            d = self.parse(args[0])
        elif len(args) in (2, 3):
            d['start'], d['stop'] = [float(x) for x in args[:2]]
            if len(args) == 3:
                d['step'] = float(args[2])

        for k, v in kwargs:
            if k in d:
                raise ArgumentError('%s specified more than once' % k)

            d[k] = v

        SObject.__init__(self, **d)
Esempio n. 5
0
            def __init__(self, s=None, **kwargs):
                if s is not None:
                    network, station = s.split('.')
                    kwargs = dict(network=network, station=station)

                SObject.__init__(self, **kwargs)
Esempio n. 6
0
            def __init__(self, s=None, **kwargs):
                if s is not None:
                    network, station = s.split('.')
                    kwargs = dict(network=network, station=station)

                SObject.__init__(self, **kwargs)
Esempio n. 7
0
 def __init__(self, pattern):
     self._pattern = pattern
     SObject.__init__(self)