Skip to content
Snippets Groups Projects
Select Git revision
  • 74228c9a0b94e77b55e447df90c1c67f212509df
  • master default protected
  • blender-v3.6-release
  • main
  • blender-v4.1-release
  • blender-v4.0-release
  • blender-v3.3-release
  • asset-shelf
  • blender-v3.5-release
  • brush-assets-project
  • blender-v2.93-release
  • blender-v3.4-release
  • xr-dev
  • bholodeck-v3.3
  • blender-v3.2-release
  • temp-xr-tracker
  • blender-v3.1-release
  • screenshots-manual
  • gltf_vtree
  • blender-v2.83-release
  • blender-v3.0-release
  • v3.6.18
  • v3.6.19
  • v3.6.20
  • v3.6.21
  • v3.6.22
  • v3.6.23
  • v4.1.1
  • v4.1.0
  • v3.6.10
  • v3.6.11
  • v3.6.12
  • v3.6.13
  • v3.6.14
  • v3.6.15
  • v3.6.16
  • v3.6.17
  • v3.6.9
  • v3.3.16
  • v3.6.8
  • v3.3.15
41 results

io_import_gimp_image_to_scene.py

Blame
  • it4i_module_naming_scheme.py 4.35 KiB
    #!/usr/bin/env python
    #
    #  Copyright (C) 2015 IT4Innovations
    #  Lumir Jasiok
    #  lumir.jasiok@vsb.cz
    #  http://www.it4i.cz
    #
    #
    
    import os
    
    from easybuild.tools.config import install_path
    from easybuild.tools.module_naming_scheme import ModuleNamingScheme
    
    
    class IT4IModuleNamingScheme(ModuleNamingScheme):
        """Class implementing an example module naming scheme."""
    
        REQUIRED_KEYS = []
    
        def det_install_subdir(self, ec):
            """
            Determine name of software installation subdirectory of install path.
            @param ec: dict-like object with easyconfig parameter values; for now
                        only the 'name', 'version', 'versionsuffix' and
                        'toolchain' parameters are guaranteed to be available
            @return: string with name of subdirectory, e.g.:
                        '<compiler>/<mpi_lib>/<name>/<version>'
            """
            # by default: use full module name as name for install subdir
    
            # fetch required values
            name = ec['name']
            version = ec['version']
            tc_name = ec['toolchain']['name']
            tc_version = ec['toolchain']['version']
            moduleclass = ec['moduleclass']
            version_suffix = ec['versionsuffix']
    
            if version_suffix != '':
                self.log.info("IT4I found version_suffix %s" % version_suffix)
            else:
                self.log.info("IT4I version_suffix not found")
    
            # Get the install path from configuration
            installpath = install_path()
            self.log.info("IT4I Install path for software is %s" % installpath)
            self.log.info("IT4I This application moduleclass is %s" % moduleclass)
            moduleclass_dir = os.path.join(installpath, moduleclass)
    
            if (tc_name == "dummy" and (tc_version == "dummy" or not tc_version)):
                self.software_full_version = version
                self.log.info("IT4I Software full name (dummy toolchain) is %s"
                              % self.software_full_version)
            else:
                self.software_full_version = version + "-" + tc_name + "-" \
                                             + tc_version
                self.log.info("IT4I Software full name is %s"
                              % self.software_full_version)
    
            if (version_suffix != ''):
                self.software_full_version += version_suffix
                self.log.info("IT4I Software full name (with version_suffix) is %s"
                              % self.software_full_version)
    
            if not os.path.isdir(moduleclass_dir):
                self.log.info("IT4I software moduleclass directory %s \
                               missing, creating" % moduleclass_dir)
                os.mkdir(moduleclass_dir)
    
            software_dir = os.path.join(moduleclass_dir, name)
            if not os.path.isdir(software_dir):
                self.log.info("IT4I software application directory %s \
                              missing, creating" % software_dir)
                os.mkdir(software_dir)
    
            symlink_path = os.path.join(software_dir, self.software_full_version)
            if not os.path.islink(symlink_path):
                self.log.info("IT4I Missing application symlink %s, creating"
                              % symlink_path)
                os.symlink(os.path.join(installpath, 'all', name, self.software_full_version), symlink_path)
            return os.path.join('all', name, self.software_full_version)
    
        def det_full_module_name(self, ec):
            """
            Determine full module name from given easyconfig, according to and
            example module naming scheme.
    
            @param ec: dict-like object with easyconfig parameter values
                        (e.g. 'name', 'version', etc.)
    
            @return: string representing full module name, e.g.:
                        'goolf/1.4.10/gzip/1.5'
            """
    
            # fetch required values
            name = ec['name']
            version = ec['version']
            tc_name = ec['toolchain']['name']
            tc_version = ec['toolchain']['version']
            version_suffix = ec['versionsuffix']
    
            if (tc_name == "dummy" and (tc_version == "dummy" or not tc_version)):
                self.module_full_version = version
            else:
                self.module_full_version = version + "-" + tc_name + "-" + tc_version
    
            if (version_suffix != ''):
                self.module_full_version += version_suffix
    
            self.log.debug("IT4I Full module name is %s"
                           % self.module_full_version)
    
            return os.path.join(name, self.module_full_version)