예제 #1
0
파일: hdf5.py 프로젝트: 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])
예제 #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])
예제 #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