From 9ae81e63dc647707d6e181cea6fbab2c957123c6 Mon Sep 17 00:00:00 2001 From: Gbkng Date: Wed, 14 Feb 2024 23:41:29 +0100 Subject: [PATCH] feat(src): export the various submodules of the module --- src/__init__.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/__init__.py b/src/__init__.py index 9f3e8d1..9a5f532 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -21,14 +21,20 @@ 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 -- 2.39.2