Salome HOME
projects
/
modules
/
adao.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor documentation improvements
[modules/adao.git]
/
src
/
daComposant
/
daCore
/
PlatformInfo.py
diff --git
a/src/daComposant/daCore/PlatformInfo.py
b/src/daComposant/daCore/PlatformInfo.py
index fcd9387d2039bc694f5cbe7a6810cb11341175f3..45eafeeaa6d4f73372ea4177f446920aaca1581d 100644
(file)
--- a/
src/daComposant/daCore/PlatformInfo.py
+++ b/
src/daComposant/daCore/PlatformInfo.py
@@
-1,6
+1,6
@@
# -*- coding: utf-8 -*-
#
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2008-20
19
EDF R&D
+# Copyright (C) 2008-20
21
EDF R&D
#
# 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
@@
-93,7
+93,7
@@
class PlatformInfo(object):
if hasattr(platform, 'linux_distribution'):
__msg += "\n%s%30s : %s" %(__prefix,
"platform.linux_distribution",str(platform.linux_distribution()))
if hasattr(platform, 'linux_distribution'):
__msg += "\n%s%30s : %s" %(__prefix,
"platform.linux_distribution",str(platform.linux_distribution()))
- el
se
:
+ el
if hasattr(platform, 'dist')
:
__msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
elif sys.platform.startswith('darwin'):
if hasattr(platform, 'mac_ver'):
__msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
elif sys.platform.startswith('darwin'):
if hasattr(platform, 'mac_ver'):
@@
-104,7
+104,7
@@
class PlatformInfo(object):
if (platform.mac_ver()[0].split('.')[1] == key):
__msg += "\n%s%30s : %s" %(__prefix,
"platform.mac_ver",str(platform.mac_ver()[0]+"(" + macosx_dict[key]+")"))
if (platform.mac_ver()[0].split('.')[1] == key):
__msg += "\n%s%30s : %s" %(__prefix,
"platform.mac_ver",str(platform.mac_ver()[0]+"(" + macosx_dict[key]+")"))
- el
se
:
+ el
if hasattr(platform, 'dist')
:
__msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
elif os.name == 'nt':
__msg += "\n%s%30s : %s" %(__prefix,"platform.win32_ver",platform.win32_ver()[1])
__msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
elif os.name == 'nt':
__msg += "\n%s%30s : %s" %(__prefix,"platform.win32_ver",platform.win32_ver()[1])
@@
-253,9
+253,12
@@
def uniq( __sequence ):
def isIterable( __sequence, __check = False, __header = "" ):
"""
def isIterable( __sequence, __check = False, __header = "" ):
"""
- Vérification que l'argument est un itérable
+ Vérification que l'argument est un itérable interne.
+ Remarque : pour permettre le test correct en MultiFonctions,
+ - Ne pas accepter comme itérable un "numpy.ndarray"
+ - Ne pas accepter comme itérable avec hasattr(__sequence, "__iter__")
"""
"""
- if isinstance( __sequence, (list, tuple, map) ):
+ if isinstance( __sequence, (list, tuple, map
, dict
) ):
__isOk = True
elif type(__sequence).__name__ in ('generator','range'):
__isOk = True
__isOk = True
elif type(__sequence).__name__ in ('generator','range'):
__isOk = True
@@
-310,8
+313,9
@@
def checkFileNameImportability( __filename, __warnInsteadOfPrint=True ):
"no \"__init__.py\" file in the same directory."+\
"\n The name of the file in question is the following:"+\
"\n %s")%(int(str(__filename).count(".")-1), __filename)
"no \"__init__.py\" file in the same directory."+\
"\n The name of the file in question is the following:"+\
"\n %s")%(int(str(__filename).count(".")-1), __filename)
- if __warnInsteadOfPrint: logging.warning(__msg)
- else: print(__msg)
+ if __warnInsteadOfPrint is None: pass
+ elif __warnInsteadOfPrint: logging.warning(__msg)
+ else: print(__msg)
else:
__conform = True
#
else:
__conform = True
#