Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'OCCT780'
[modules/smesh.git]
/
src
/
Tools
/
blocFissure
/
gmu
/
eliminateDoubles.py
diff --git
a/src/Tools/blocFissure/gmu/eliminateDoubles.py
b/src/Tools/blocFissure/gmu/eliminateDoubles.py
index 97a9276c188920f5922db2ee64c20b5c59b1177c..83a7410f1ed24e386eb92eb2016977e58f48b2db 100644
(file)
--- a/
src/Tools/blocFissure/gmu/eliminateDoubles.py
+++ b/
src/Tools/blocFissure/gmu/eliminateDoubles.py
@@
-1,5
+1,5
@@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
-# Copyright (C) 2014-202
0 EDF R&D
+# Copyright (C) 2014-202
4 EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@
-17,26
+17,25
@@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+"""éliminer les doublons d'une liste de subshapes"""
import logging
from .geomsmesh import geompy
import logging
from .geomsmesh import geompy
-# -----------------------------------------------------------------------------
-# --- éliminer les doublons d'une liste de subshapes
-
def eliminateDoubles(obj, subshapes):
def eliminateDoubles(obj, subshapes):
- """
- éliminer les doublons d'une liste de subshapes
- """
- idsubs = {}
+ """éliminer les doublons d'une liste de subshapes"""
+
+ idsubs = dict()
for sub in subshapes:
subid = geompy.GetSubShapeID(obj, sub)
for sub in subshapes:
subid = geompy.GetSubShapeID(obj, sub)
- if subid in
list(idsubs.keys())
:
+ if subid in
idsubs
:
idsubs[subid].append(sub)
else:
idsubs[subid] = [sub]
idsubs[subid].append(sub)
else:
idsubs[subid] = [sub]
- shortList = []
- for k, v in idsubs.items():
- shortList.append(v[0])
+
+ shortList = list()
+ for _, l_sub in idsubs.items():
+ shortList.append(l_sub[0])
logging.debug("shortList=%s", shortList)
logging.debug("shortList=%s", shortList)
+
return shortList
return shortList