def scan(self):
self.import_file = self.config["instance"]["import-file"]
self.bits = self.import_lister.get(self.import_file)
self.data_file = Path(self.bits["metadata"]).with_suffix(".data")
self.metadata = ConfigParser(inline_comment_prefixes=None)
self.metadata.read(str(self.bits["metadata"]))
if self.data_file.exists():
with self.data_file.open(newline="") as csvfile:
data_reader = csv.DictReader(csvfile, dialect=ImportCsvDialect)
for row in data_reader:
location = float(row["location"])
row["location"] = location
self.data[location] = row
if len(self.data) == 0:
self.add_row(0.0, mark="START")
self.add_row(self.bits["length_secs"], mark="END")
self.update_order()
self.clean()
评论列表
文章目录