mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Geometry: Fixed #29 with a hacky solution.
This commit is contained in:
1 parent
e930bcaa91
commit
30702cb118
1 file changed
+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)
|
||||
|
||||
Reference in new issue
Block a user