# -*- coding: utf-8 -*-
#
-# Copyright (C) 2008-2019 EDF R&D
+# Copyright (C) 2008-2021 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
if hasattr(platform, 'linux_distribution'):
__msg += "\n%s%30s : %s" %(__prefix,
"platform.linux_distribution",str(platform.linux_distribution()))
- else:
+ elif hasattr(platform, 'dist'):
__msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
elif sys.platform.startswith('darwin'):
if hasattr(platform, 'mac_ver'):
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]+")"))
- else:
+ elif 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])
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
"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
#