607 if self._has_arcs and other_data._has_lines: |
607 if self._has_arcs and other_data._has_lines: |
608 raise DataError("Can't combine line data with arc data") |
608 raise DataError("Can't combine line data with arc data") |
609 |
609 |
610 aliases = aliases or PathAliases() |
610 aliases = aliases or PathAliases() |
611 |
611 |
612 # Force the database we're writing to to exist before we start nesting |
612 # Force the database we're writing to to exist before we start nesting contexts. |
613 # contexts. |
|
614 self._start_using() |
613 self._start_using() |
615 |
614 |
616 # Collector for all arcs, lines and tracers |
615 # Collector for all arcs, lines and tracers |
617 other_data.read() |
616 other_data.read() |
618 with other_data._connect() as con: |
617 with other_data._connect() as con: |
772 if self._debug.should("dataio"): |
771 if self._debug.should("dataio"): |
773 self._debug.write(f"Erasing data file {self._filename!r}") |
772 self._debug.write(f"Erasing data file {self._filename!r}") |
774 file_be_gone(self._filename) |
773 file_be_gone(self._filename) |
775 if parallel: |
774 if parallel: |
776 data_dir, local = os.path.split(self._filename) |
775 data_dir, local = os.path.split(self._filename) |
777 localdot = local + ".*" |
776 local_abs_path = os.path.join(os.path.abspath(data_dir), local) |
778 pattern = os.path.join(os.path.abspath(data_dir), localdot) |
777 pattern = glob.escape(local_abs_path) + ".*" |
779 for filename in glob.glob(pattern): |
778 for filename in glob.glob(pattern): |
780 if self._debug.should("dataio"): |
779 if self._debug.should("dataio"): |
781 self._debug.write(f"Erasing parallel data file {filename!r}") |
780 self._debug.write(f"Erasing parallel data file {filename!r}") |
782 file_be_gone(filename) |
781 file_be_gone(filename) |
783 |
782 |