Skip to content

Commit 0ffec20

Browse files
9.0.1
1 parent 18442c0 commit 0ffec20

25 files changed

Lines changed: 575 additions & 568 deletions

core/messages.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ def msg_war_6(bandset_number=None):
258258
msg_bar_warning(
259259
QApplication.translate(ui_name,
260260
'Band set') + ' ' + str(bandset_number) + ' '
261-
+ QApplication.translate(ui_name,
262-
'is empty')
261+
+ QApplication.translate(ui_name, 'is empty')
263262
)
264263

265264

@@ -275,3 +274,8 @@ def msg_war_7():
275274
def msg_war_8():
276275
# noinspection PyTypeChecker
277276
msg_bar_warning(QApplication.translate(ui_name, 'No tool selected'))
277+
278+
279+
def msg_war_9():
280+
# noinspection PyTypeChecker
281+
msg_bar_warning(QApplication.translate(ui_name, 'Check the expression'))

core/util_qgis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# If not, see <https://www.gnu.org/licenses/>.
2222

2323

24+
import ast
2425
# noinspection PyUnresolvedReferences
2526
from qgis.core import (
2627
QgsProject, QgsVectorFileWriter, QgsLayerTreeNode, QgsMapLayer,
@@ -154,7 +155,7 @@ def read_project_variable(variable_name, value):
154155
except Exception as err:
155156
str(err)
156157
try:
157-
value = eval(value)
158+
value = ast.literal_eval(value)
158159
except Exception as err:
159160
str(err)
160161
return value

core/util_qt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323

2424
from os import path
25+
import ast
2526

2627
from PyQt6.QtCore import Qt, QSettings
2728
from PyQt6.QtGui import QFont, QColor
@@ -41,7 +42,7 @@ def read_registry_keys(key, default_value):
4142
except Exception as err:
4243
str(err)
4344
try:
44-
value = eval(value)
45+
value = ast.literal_eval(value)
4546
except Exception as err:
4647
str(err)
4748
return value

core/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ def random_points_with_condition(
565565
condition = condition.replace(
566566
cfg.qgis_registry[cfg.reg_raster_variable_name], '_array'
567567
)
568-
arr = np.argwhere(eval(condition))
568+
condition = eval(condition, {'__builtins__': None}, {'_array': _array})
569+
arr = np.argwhere(condition)
569570
rng = np.random.default_rng()
570571
try:
571572
pixels = rng.choice(arr, size=point_number)

i18n/models/semiautomaticclassificationplugin.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4722,7 +4722,7 @@ size</source>
47224722
</message>
47234723
<message>
47244724
<location filename="../interface/scp_dock.py" line="1454"/>
4725-
<location filename="../spectral_signature/spectral_signature_plot.py" line="452"/>
4725+
<location filename="../spectral_signature/spectral_signature_plot.py" line="453"/>
47264726
<source>Delete signatures</source>
47274727
<translation type="unfinished"></translation>
47284728
</message>
@@ -4989,7 +4989,7 @@ size</source>
49894989
<translation type="unfinished"></translation>
49904990
</message>
49914991
<message>
4992-
<location filename="../core/util_qt.py" line="146"/>
4992+
<location filename="../core/util_qt.py" line="147"/>
49934993
<source>Select a directory</source>
49944994
<translation type="unfinished"></translation>
49954995
</message>
@@ -5058,12 +5058,12 @@ size</source>
50585058
<translation type="unfinished"></translation>
50595059
</message>
50605060
<message>
5061-
<location filename="../interface/download_products_tab.py" line="734"/>
5061+
<location filename="../interface/download_products_tab.py" line="732"/>
50625062
<source>Download the images in the table (requires internet connection)</source>
50635063
<translation type="unfinished"></translation>
50645064
</message>
50655065
<message>
5066-
<location filename="../interface/download_products_tab.py" line="403"/>
5066+
<location filename="../interface/download_products_tab.py" line="401"/>
50675067
<source>Are you sure you want to clear the table?</source>
50685068
<translation type="unfinished"></translation>
50695069
</message>
@@ -5073,7 +5073,7 @@ size</source>
50735073
<translation type="unfinished"></translation>
50745074
</message>
50755075
<message>
5076-
<location filename="../interface/multiple_roi_tab.py" line="285"/>
5076+
<location filename="../interface/multiple_roi_tab.py" line="283"/>
50775077
<source>Save the point list to file</source>
50785078
<translation type="unfinished"></translation>
50795079
</message>
@@ -5176,28 +5176,28 @@ size</source>
51765176
</message>
51775177
<message>
51785178
<location filename="../spectral_signature/scatter_plot.py" line="632"/>
5179-
<location filename="../spectral_signature/spectral_signature_plot.py" line="159"/>
5179+
<location filename="../spectral_signature/spectral_signature_plot.py" line="160"/>
51805180
<source>Save plot to file</source>
51815181
<translation type="unfinished"></translation>
51825182
</message>
51835183
<message>
5184-
<location filename="../spectral_signature/spectral_signature_plot.py" line="197"/>
5184+
<location filename="../spectral_signature/spectral_signature_plot.py" line="198"/>
51855185
<source>Add to Signature list</source>
51865186
<translation type="unfinished"></translation>
51875187
</message>
51885188
<message>
5189-
<location filename="../spectral_signature/spectral_signature_plot.py" line="203"/>
5189+
<location filename="../spectral_signature/spectral_signature_plot.py" line="204"/>
51905190
<source>Are you sure you want to add highlighted signatures to the list?</source>
51915191
<translation type="unfinished"></translation>
51925192
</message>
51935193
<message>
5194-
<location filename="../spectral_signature/spectral_signature_plot.py" line="457"/>
5194+
<location filename="../spectral_signature/spectral_signature_plot.py" line="458"/>
51955195
<source>Are you sure you want to delete highlighted signatures?</source>
51965196
<translation type="unfinished"></translation>
51975197
</message>
51985198
<message>
5199-
<location filename="../spectral_signature/spectral_signature_plot.py" line="329"/>
5200-
<location filename="../spectral_signature/spectral_signature_plot.py" line="501"/>
5199+
<location filename="../spectral_signature/spectral_signature_plot.py" line="330"/>
5200+
<location filename="../spectral_signature/spectral_signature_plot.py" line="502"/>
52015201
<source>Values</source>
52025202
<translation type="unfinished"></translation>
52035203
</message>
@@ -5328,8 +5328,8 @@ size</source>
53285328
<translation type="unfinished"></translation>
53295329
</message>
53305330
<message>
5331-
<location filename="../interface/download_products_tab.py" line="603"/>
5332-
<location filename="../interface/download_products_tab.py" line="621"/>
5331+
<location filename="../interface/download_products_tab.py" line="601"/>
5332+
<location filename="../interface/download_products_tab.py" line="619"/>
53335333
<source>Downloading ...</source>
53345334
<translation type="unfinished"></translation>
53355335
</message>
@@ -5341,12 +5341,12 @@ size</source>
53415341
<translation type="unfinished"></translation>
53425342
</message>
53435343
<message>
5344-
<location filename="../interface/download_products_tab.py" line="481"/>
5344+
<location filename="../interface/download_products_tab.py" line="479"/>
53455345
<source>Select a text file of product table</source>
53465346
<translation type="unfinished"></translation>
53475347
</message>
53485348
<message>
5349-
<location filename="../interface/download_products_tab.py" line="494"/>
5349+
<location filename="../interface/download_products_tab.py" line="492"/>
53505350
<source>Export table to file</source>
53515351
<translation type="unfinished"></translation>
53525352
</message>
@@ -5429,7 +5429,7 @@ size</source>
54295429
</message>
54305430
<message>
54315431
<location filename="../interface/band_clustering_tab.py" line="112"/>
5432-
<location filename="../interface/classification_tab.py" line="203"/>
5432+
<location filename="../interface/classification_tab.py" line="204"/>
54335433
<source>Save classification</source>
54345434
<translation type="unfinished"></translation>
54355435
</message>
@@ -5472,15 +5472,15 @@ size</source>
54725472
<translation type="unfinished"></translation>
54735473
</message>
54745474
<message>
5475-
<location filename="../core/util_qt.py" line="193"/>
5476-
<location filename="../interface/download_products_tab.py" line="431"/>
5475+
<location filename="../core/util_qt.py" line="194"/>
5476+
<location filename="../interface/download_products_tab.py" line="429"/>
54775477
<location filename="../interface/image_conversion_tab.py" line="168"/>
54785478
<source>Remove rows</source>
54795479
<translation type="unfinished"></translation>
54805480
</message>
54815481
<message>
5482-
<location filename="../core/util_qt.py" line="198"/>
5483-
<location filename="../interface/download_products_tab.py" line="436"/>
5482+
<location filename="../core/util_qt.py" line="199"/>
5483+
<location filename="../interface/download_products_tab.py" line="434"/>
54845484
<location filename="../interface/image_conversion_tab.py" line="173"/>
54855485
<source>Are you sure you want to remove highlighted rows from the table?</source>
54865486
<translation type="unfinished"></translation>
@@ -5694,12 +5694,12 @@ size</source>
56945694
<translation type="unfinished"></translation>
56955695
</message>
56965696
<message>
5697-
<location filename="../interface/classification_tab.py" line="115"/>
5697+
<location filename="../interface/classification_tab.py" line="116"/>
56985698
<source>Select a classifier file</source>
56995699
<translation type="unfinished"></translation>
57005700
</message>
57015701
<message>
5702-
<location filename="../interface/classification_tab.py" line="196"/>
5702+
<location filename="../interface/classification_tab.py" line="197"/>
57035703
<source>Save classifier</source>
57045704
<translation type="unfinished"></translation>
57055705
</message>
@@ -5710,12 +5710,12 @@ size</source>
57105710
<translation type="unfinished"></translation>
57115711
</message>
57125712
<message>
5713-
<location filename="../interface/download_products_tab.py" line="356"/>
5713+
<location filename="../interface/download_products_tab.py" line="354"/>
57145714
<source>ERROR</source>
57155715
<translation type="unfinished"></translation>
57165716
</message>
57175717
<message>
5718-
<location filename="../interface/download_products_tab.py" line="400"/>
5718+
<location filename="../interface/download_products_tab.py" line="398"/>
57195719
<source>Clear the table</source>
57205720
<translation type="unfinished"></translation>
57215721
</message>
@@ -5801,7 +5801,7 @@ size</source>
58015801
<translation type="unfinished"></translation>
58025802
</message>
58035803
<message>
5804-
<location filename="../interface/multiple_roi_tab.py" line="336"/>
5804+
<location filename="../interface/multiple_roi_tab.py" line="334"/>
58055805
<source>Select a point list file</source>
58065806
<translation type="unfinished"></translation>
58075807
</message>
@@ -5902,68 +5902,68 @@ size</source>
59025902
<translation type="unfinished"></translation>
59035903
</message>
59045904
<message>
5905-
<location filename="../spectral_signature/signature_importer.py" line="45"/>
5905+
<location filename="../spectral_signature/signature_importer.py" line="46"/>
59065906
<source>Chapter 1: Minerals</source>
59075907
<translation type="unfinished"></translation>
59085908
</message>
59095909
<message>
5910-
<location filename="../spectral_signature/signature_importer.py" line="49"/>
5910+
<location filename="../spectral_signature/signature_importer.py" line="50"/>
59115911
<source>Chapter 2: Soils and Mixtures</source>
59125912
<translation type="unfinished"></translation>
59135913
</message>
59145914
<message>
5915-
<location filename="../spectral_signature/signature_importer.py" line="52"/>
5915+
<location filename="../spectral_signature/signature_importer.py" line="53"/>
59165916
<source>Chapter 3: Coatings</source>
59175917
<translation type="unfinished"></translation>
59185918
</message>
59195919
<message>
5920-
<location filename="../spectral_signature/signature_importer.py" line="55"/>
5920+
<location filename="../spectral_signature/signature_importer.py" line="56"/>
59215921
<source>Chapter 4: Liquids</source>
59225922
<translation type="unfinished"></translation>
59235923
</message>
59245924
<message>
5925-
<location filename="../spectral_signature/signature_importer.py" line="58"/>
5925+
<location filename="../spectral_signature/signature_importer.py" line="59"/>
59265926
<source>Chapter 5: Organics</source>
59275927
<translation type="unfinished"></translation>
59285928
</message>
59295929
<message>
5930-
<location filename="../spectral_signature/signature_importer.py" line="61"/>
5930+
<location filename="../spectral_signature/signature_importer.py" line="62"/>
59315931
<source>Chapter 6: Artificial</source>
59325932
<translation type="unfinished"></translation>
59335933
</message>
59345934
<message>
5935-
<location filename="../spectral_signature/signature_importer.py" line="65"/>
5935+
<location filename="../spectral_signature/signature_importer.py" line="66"/>
59365936
<source>Chapter 7: Vegetation and Mixtures</source>
59375937
<translation type="unfinished"></translation>
59385938
</message>
59395939
<message>
5940-
<location filename="../spectral_signature/spectral_signature_plot.py" line="324"/>
5941-
<location filename="../spectral_signature/spectral_signature_plot.py" line="492"/>
5940+
<location filename="../spectral_signature/spectral_signature_plot.py" line="325"/>
5941+
<location filename="../spectral_signature/spectral_signature_plot.py" line="493"/>
59425942
<source>Wavelength</source>
59435943
<translation type="unfinished"></translation>
59445944
</message>
59455945
<message>
5946-
<location filename="../spectral_signature/spectral_signature_plot.py" line="489"/>
5946+
<location filename="../spectral_signature/spectral_signature_plot.py" line="490"/>
59475947
<source>Pixel count</source>
59485948
<translation type="unfinished"></translation>
59495949
</message>
59505950
<message>
5951-
<location filename="../spectral_signature/spectral_signature_plot.py" line="508"/>
5951+
<location filename="../spectral_signature/spectral_signature_plot.py" line="509"/>
59525952
<source>Standard deviation</source>
59535953
<translation type="unfinished"></translation>
59545954
</message>
59555955
<message>
5956-
<location filename="../spectral_signature/spectral_signature_plot.py" line="584"/>
5956+
<location filename="../spectral_signature/spectral_signature_plot.py" line="585"/>
59575957
<source>Euclidean distance</source>
59585958
<translation type="unfinished"></translation>
59595959
</message>
59605960
<message>
5961-
<location filename="../spectral_signature/spectral_signature_plot.py" line="587"/>
5961+
<location filename="../spectral_signature/spectral_signature_plot.py" line="588"/>
59625962
<source>Bray-Curtis similarity [%]</source>
59635963
<translation type="unfinished"></translation>
59645964
</message>
59655965
<message>
5966-
<location filename="../spectral_signature/spectral_signature_plot.py" line="590"/>
5966+
<location filename="../spectral_signature/spectral_signature_plot.py" line="591"/>
59675967
<source>Spectral angle</source>
59685968
<translation type="unfinished"></translation>
59695969
</message>

0 commit comments

Comments
 (0)