Geometry: Fixed #29 with a hacky solution.

setup.py
Pierre-Antoine Rouby 2024-01-08 16:30:56 +01:00
parent e930bcaa91
commit 30702cb118
1 changed files with 17 additions and 2 deletions

View File

@ -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)