Commit 30702cb1 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Geometry: Fixed #29 with a hacky solution.

Showing with 17 additions and 2 deletions
+17 -2
......@@ -17,9 +17,10 @@
# -*- coding: utf-8 -*-
import os
import pathlib
import sys
import time
import pathlib
import logging
from copy import deepcopy
from tools import timer, trace
......@@ -54,6 +55,8 @@ from View.Geometry.Profile.Window import ProfileWindow
_translate = QCoreApplication.translate
logger = logging.getLogger()
class GeometryWindow(PamhyrWindow):
_pamhyr_ui = "GeometryReach"
......@@ -480,13 +483,25 @@ class GeometryWindow(PamhyrWindow):
def _paste(self):
header, data = self.parseClipboardTable()
if len(data) == 0:
if len(data) + len(header) == 0:
return
# if len(header) != 0:
# header.append("reach")
# header.append("status")
# HACK: The CVS module detect the first line to csv header in
# some particular case... To avoid this we append to data list
# the "headers". /!\ This hack must failed if a real header
# exists (a better solution is welcome).
logger.debug(
"Geometry: Paste: " +
f"header = {header}, " +
f"data = {data}"
)
if len(header) != 0:
data = [header] + data
for row in data:
row.append(self._reach)
row.append(self._study.river._status)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment