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
from . import compilation
from . import test_module
from . import template
+from . import debug
+
-import platform
if platform.system() == "Windows" :
import colorama
colorama.init()
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):
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 = ""):
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
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:
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