IGNORED_DIRS = [".git", ".svn"]
IGNORED_EXTENSIONS = []
+PACKAGE_EXT=".tar.gz" # the extension we use for the packages
+
PROJECT_TEMPLATE = """#!/usr/bin/env python
#-*- coding:utf-8 -*-
for_package = binaries_dir_name)
# Little hack to put out_dir_Path as environment variable
- src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' )
+ if src.architecture.is_windows() :
+ src.replace_in_file(filepath, '"out_dir_Path', '"%out_dir_Path%' )
+ else:
+ src.replace_in_file(filepath, '"out_dir_Path', '"${out_dir_Path}' )
# change the rights in order to make the file executable for everybody
os.chmod(filepath,
:return: The path of the resulting archive
:rtype: str
'''
- path_targz_prod = os.path.join(where, prod_name + ".tgz")
+ path_targz = os.path.join(dir_name, archive_name + PACKAGE_EXT)
tar_prod = tarfile.open(path_targz_prod, mode='w:gz')
local_path = prod_info.source_dir
tar_prod.add(local_path,
if options.sources:
f.write(src.template.substitute(readme_template_path_src, d))
- if options.binaries and options.sources:
+ if options.binaries and options.sources and not src.architecture.is_windows():
f.write(readme_compilation_with_binaries)
if options.project:
logger.write("\n", 1)
return 1
- path_targz = os.path.join(dir_name, archive_name + ".tgz")
+ path_targz = os.path.join(dir_name, archive_name + PACKAGE_EXT)
src.printcolors.print_value(logger, "Package path", path_targz, 2)
self.add_line(1)
self.add_comment("reset these sensitive variables to avoid bad environment interactions")
self.add_comment("comment these to lines if you wish a different behaviour")
- self.set("LD_LIBRARY_PATH", "")
+ if not src.architecture.is_windows():
+ self.set("LD_LIBRARY_PATH", "")
self.set("PYTHONPATH", "")
self.add_line(1)
launcher_header=launcher_header2
else:
launcher_header=launcher_header3
+ # in case of Windows OS, Python scripts are not executable. PyExe ?
+ if src.architecture.is_windows():
+ launcher_header = launcher_header.replace("#! /usr/bin/env python3",'')
self.output.write(launcher_header\
.replace("BIN_KERNEL_INSTALL_DIR", self.bin_kernel_root_dir))
def add_comment(self, comment):
- # Special comment in case of the distène licence
+ # Special comment in case of the DISTENE licence
if comment=="DISTENE license":
self.output.write(self.indent+
"#"+
# Preliminary work to initialize path to SALOME Python modules
def __initialize():
- sys.path[:0] = [ 'BIN_KERNEL_INSTALL_DIR' ] # to get salomeContext
+ sys.path[:0] = [ r'BIN_KERNEL_INSTALL_DIR' ] # to get salomeContext
# define folder to store omniorb config (initially in virtual application folder)
try:
# Preliminary work to initialize path to SALOME Python modules
def __initialize():
- sys.path[:0] = [ 'BIN_KERNEL_INSTALL_DIR' ]
+ sys.path[:0] = [ r'BIN_KERNEL_INSTALL_DIR' ]
# define folder to store omniorb config (initially in virtual application folder)
try: