]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
feat(src): export the various submodules of the module
authorGbkng <guillaume.brooking@gmail.com>
Wed, 14 Feb 2024 22:41:29 +0000 (23:41 +0100)
committerGbkng <guillaume.brooking@gmail.com>
Wed, 14 Feb 2024 22:43:15 +0000 (23:43 +0100)
src/__init__.py

index 9f3e8d1e7a2fc26019dbee57d82f3ecee2954470..9a5f532926aab549d6ec02cdfc5a135c80f000fb 100644 (file)
 initial imports and utilities methods for salomeTools
 """
 
+__all__ = ["pyconf", "architecture", "printcolors", "options", "system", "ElementTree", "logger", "product", "environment", "fileEnviron", "compilation", "test_module", "template", "debug"]
+
 import os
+import sys
 import shutil
 import errno
 import stat
 import fnmatch
-import pprint as PP
+import platform
+
+from gettext import gettext as _
 from ftplib import FTP
 
+
 from . import pyconf
 from . import architecture
 from . import printcolors
@@ -42,8 +48,9 @@ from . import fileEnviron
 from . import compilation
 from . import test_module
 from . import template
+from . import debug
+
 
-import platform
 if platform.system() == "Windows" :
     import colorama
     colorama.init()
@@ -403,14 +410,14 @@ class Path:
         try:
             os.symlink(str(path), self.path)
             return True
-        except:
+        except Exception:
             return False
 
     def copylink(self, path):
         try:
             os.symlink(os.readlink(self.path), str(path))
             return True
-        except:
+        except Exception:
             return False
 
     def copydir(self, dst, smart=False):
@@ -429,14 +436,14 @@ class Path:
                 dstname = dst + name
                 srcname.copy(dstname, smart)
             return True
-        except:
+        except Exception:
             return False
 
     def copyfile(self, path):
         try:
             shutil.copy2(self.path, str(path))
             return True
-        except:
+        except Exception:
             return False
 
 def find_file_in_lpath(file_name, lpath, additional_dir = ""):
@@ -507,7 +514,7 @@ def find_file_in_ftppath(file_name, ftppath, installation_dir, logger, additiona
                ftp.cwd(directory)
            if additional_dir:
                ftp.cwd(additional_dir)
-       except:
+       except Exception:
            logger.error("while connecting to ftp server %s\n" % ftp_server)
            continue
 
@@ -517,7 +524,7 @@ def find_file_in_ftppath(file_name, ftppath, installation_dir, logger, additiona
            if ftp.size(file_name_md5) > 0:
                with open(destination_md5,'wb') as dest_file_md5:
                    ftp.retrbinary("RETR "+file_name_md5, dest_file_md5.write)
-       except:
+       except Exception:
            pass
 
        try:
@@ -527,7 +534,7 @@ def find_file_in_ftppath(file_name, ftppath, installation_dir, logger, additiona
                    ftp.retrbinary("RETR "+file_name, dest_file.write)
                logger.write("   Archive %s was retrieved and stored in %s\n" % (file_name, destination), 3)
                return destination
-       except:
+       except Exception:
            logger.error("File not found in ftp_archive %s\n" % ftp_server)
 
     return False