1# Copyright 2014 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from telemetry.timeline.timeline_data import TimelineData 6 7class EmptyTimelineDataImporter(object): 8 """Imports empty TimlineData objects.""" 9 def __init__(self, model, timeline_data, import_priority=0): 10 pass 11 12 @staticmethod 13 def CanImport(timeline_data): 14 if not isinstance(timeline_data, TimelineData): 15 return False 16 event_data = timeline_data.EventData() 17 if isinstance(event_data, list): 18 return len(event_data) == 0 19 elif isinstance(event_data, basestring): 20 return len(event_data) == 0 21 return False 22 23 def ImportEvents(self): 24 pass 25 26 def FinalizeImport(self): 27 pass 28