Esempio n. 1
0
File: hdf5.py Progetto: Q-L/pymworks
def make_match_string(key, to_code):
    codes = datafile.key_to_code(key, to_code)
    if codes is None:
        codes = []
    if not isinstance(codes, (tuple, list)):
        codes = [codes, ]
    return ' | '.join(['(code == %i)' % c for c in codes])
Esempio n. 2
0
def make_match_string(key, to_code):
    codes = datafile.key_to_code(key, to_code)
    if codes is None:
        codes = []
    if not isinstance(codes, (tuple, list)):
        codes = [
            codes,
        ]
    return ' | '.join(['(code == %i)' % c for c in codes])
Esempio n. 3
0
 def get_events(self, key=None, time_range=None):
     kt, tt = make_tests(key, time_range, self.to_code)
     if key is None:
         codes = self.eventbuffer.keys()
     else:
         codes = key_to_code(key, self.to_code)
         if not isinstance(codes, (tuple, list)):
             codes = [codes, ]
     events = []
     for code in codes:
         for e in self.eventbuffer[code]:
             if tt(e):
                 events.append(e)
     return events