def avail_repositories(self): """Show list of known repository types.""" repopath_defaults = get_default_oldstyle_configfile_defaults( )['repositorypath'] all_repos = avail_repositories(check_useable=False) usable_repos = avail_repositories(check_useable=True).keys() indent = ' ' * 2 txt = ['All avaialble repository types'] repos = sorted(all_repos.keys()) for repo in repos: if repo in usable_repos: missing = '' else: missing = ' (*Not usable*, something is missing (eg a specific module))' if repo in repopath_defaults: default = ' (Default arguments: %s)' % ( repopath_defaults[repo]) else: default = ' (No default arguments)' txt.append("%s%s%s%s" % (indent, repo, default, missing)) txt.append("%s%s" % (indent * 2, all_repos[repo].DESCRIPTION)) return "\n".join(txt)
def _postprocess_config(self): """Postprocessing of configuration options""" if self.options.prefix is not None: changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix) for dest in ["installpath", "buildpath", "sourcepath", "repositorypath"]: if not self.options._action_taken.get(dest, False): new_def = changed_defaults[dest] if dest == "repositorypath": setattr(self.options, dest, new_def[changed_defaults["repository"]]) else: setattr(self.options, dest, new_def) # LEGACY this line is here for oldstyle reasons self.log.deprecated("Fake action taken to distinguish from default", "2.0") self.options._action_taken[dest] = True if self.options.pretend: self.options.installpath = get_pretend_installpath() # split supplied list of robot paths to obtain a list if self.options.robot: class RobotPath(ListOfStrings): SEPARATOR_LIST = os.pathsep # explicit definition of __str__ is required for unknown reason related to the way Wrapper is defined __str__ = ListOfStrings.__str__ self.options.robot = RobotPath(self.options.robot)
def _postprocess_config(self): """Postprocessing of configuration options""" if self.options.prefix is not None: changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix) # prefix applies to all paths, and repository has to be reinitialised to take new repositorypath into account # in the legacy-style configuration, repository is initialised in configuration file itself for dest in ['installpath', 'buildpath', 'sourcepath', 'repository', 'repositorypath']: if not self.options._action_taken.get(dest, False): new_def = changed_defaults[dest] if dest == 'repositorypath': setattr(self.options, dest, new_def[changed_defaults['repository']]) else: setattr(self.options, dest, new_def) # LEGACY this line is here for oldstyle reasons self.log.deprecated('Fake action taken to distinguish from default', '2.0') self.options._action_taken[dest] = True if self.options.pretend: self.options.installpath = get_pretend_installpath() # split supplied list of robot paths to obtain a list if self.options.robot: class RobotPath(ListOfStrings): SEPARATOR_LIST = os.pathsep # explicit definition of __str__ is required for unknown reason related to the way Wrapper is defined __str__ = ListOfStrings.__str__ self.options.robot = RobotPath(self.options.robot)
def _postprocess_config(self): """Postprocessing of configuration options""" if self.options.prefix is not None: changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix) for dest in ['installpath', 'buildpath', 'sourcepath', 'repositorypath']: if not self.options._action_taken.get(dest, False): new_def = changed_defaults[dest] if dest == 'repositorypath': setattr(self.options, dest, new_def[changed_defaults['repository']]) else: setattr(self.options, dest, new_def) # LEGACY this line is here for oldstyle reasons self.log.deprecated('Fake action taken to distinguish from default', '2.0') self.options._action_taken[dest] = True if self.options.pretend: self.options.installpath = get_pretend_installpath() # split supplied list of robot paths to obtain a list if self.options.robot: class RobotPath(ListOfStrings): SEPARATOR_LIST = os.pathsep # explicit definition of __str__ is required for unknown reason related to the way Wrapper is defined __str__ = ListOfStrings.__str__ self.options.robot = RobotPath(self.options.robot)
def config_options(self): # config options descr = ("Configuration options", "Configure EasyBuild behavior.") oldstyle_defaults = get_default_oldstyle_configfile_defaults() opts = { "config":("Path to EasyBuild config file", None, 'store', oldstyle_defaults['config'], "C",), 'prefix': (('Change prefix for buildpath, installpath, sourcepath and repositorypath ' '(repositorypath prefix is only relevant in case of FileRepository repository)' '(used prefix for defaults %s)' % oldstyle_defaults['prefix']), None, 'store', None), 'buildpath': ('Temporary build path', None, 'store', oldstyle_defaults['buildpath']), 'installpath': ('Final install path', None, 'store', oldstyle_defaults['installpath']), 'subdir-modules': ('Subdir in installpath for modules', None, 'store', oldstyle_defaults['subdir_modules']), 'subdir-software': ('Subdir in installpath for software', None, 'store', oldstyle_defaults['subdir_software']), 'repository': ('Repository type, using repositorypath', 'choice', 'store', oldstyle_defaults['repository'], sorted(avail_repositories().keys())), 'repositorypath': (('Repository path, used by repository ' '(is passed as list of arguments to create the repository instance). ' 'For more info, use --avail-repositories.'), 'strlist', 'store', oldstyle_defaults['repositorypath'][oldstyle_defaults['repository']]), "avail-repositories":("Show all repository types (incl. non-usable)", None, "store_true", False,), 'logfile-format': ('Directory name and format of the log file ', 'strtuple', 'store', oldstyle_defaults['logfile_format'], {'metavar': 'DIR,FORMAT'}), 'tmp-logdir': ('Log directory where temporary log files are stored', None, 'store', oldstyle_defaults['tmp_logdir']), 'sourcepath': ('Path(s) to where sources should be downloaded (string, colon-separated)', None, 'store', oldstyle_defaults['sourcepath']), 'moduleclasses': (('Extend supported module classes' ' (For more info on the default classes, use --show-default-moduleclasses)'), None, 'extend', oldstyle_defaults['moduleclasses']), 'show-default-moduleclasses': ('Show default module classes with description', None, 'store_true', False), 'modules-tool': ('Modules tool to use', 'choice', 'store', oldstyle_defaults['modules_tool'], sorted(avail_modules_tools().keys())), "avail-modules-tools":("Show all supported module tools", None, "store_true", False,), 'module-naming-scheme': ('Module naming scheme', 'choice', 'store', oldstyle_defaults['module_naming_scheme'], sorted(avail_module_naming_schemes().keys())), "avail-module-naming-schemes":("Show all supported module naming schemes", None, "store_true", False,), # this one is sort of an exception, it's something jobscripts can set, # has no real meaning for regular eb usage "testoutput": ("Path to where a job should place the output (to be set within jobscript)", None, "store", None), } self.log.debug("config_options: descr %s opts %s" % (descr, opts)) self.add_group_parser(opts, descr)
def _postprocess_config(self): """Postprocessing of configuration options""" if self.options.prefix is not None: changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix) for dest in ["installpath", "buildpath", "sourcepath", "repositorypath"]: if not self.options._action_taken.get(dest, False): new_def = changed_defaults[dest] if dest == "repositorypath": setattr(self.options, dest, new_def[changed_defaults["repository"]]) else: setattr(self.options, dest, new_def) # LEGACY this line is here for oldstyle reasons self.log.deprecated("Fake action taken to distinguish from default", "2.0") self.options._action_taken[dest] = True if self.options.pretend: self.options.installpath = get_pretend_installpath()
def _postprocess_config(self): """Postprocessing of configuration options""" if self.options.prefix is not None: changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix) for dest in ['installpath', 'buildpath', 'sourcepath', 'repositorypath']: if not self.options._action_taken.get(dest, False): new_def = changed_defaults[dest] if dest == 'repositorypath': setattr(self.options, dest, new_def[changed_defaults['repository']]) else: setattr(self.options, dest, new_def) # LEGACY this line is here for oldstyle reasons self.log.deprecated('Fake action taken to distinguish from default', '2.0') self.options._action_taken[dest] = True if self.options.pretend: self.options.installpath = get_pretend_installpath()
def _postprocess_config(self): """Postprocessing of configuration options""" if self.options.prefix is not None: changed_defaults = get_default_oldstyle_configfile_defaults(self.options.prefix) for dest in ['installpath', 'buildpath', 'sourcepath', 'repositorypath']: if not self.options._action_taken.get(dest, False): new_def = changed_defaults[dest] if dest == 'repositorypath': setattr(self.options, dest, new_def[changed_defaults['repository']]) else: setattr(self.options, dest, new_def) # LEGACY this line is here for oldstyle reasons self.log.deprecated('Fake action taken to distinguish from default', '2.0') self.options._action_taken[dest] = True if self.options.pretend: self.options.installpath = get_pretend_installpath() # split supplied list of robot paths to obtain a list if self.options.robot: self.options.robot = self.options.robot.split(os.pathsep)
def avail_repositories(self): """Show list of known repository types.""" repopath_defaults = get_default_oldstyle_configfile_defaults()["repositorypath"] all_repos = avail_repositories(check_useable=False) usable_repos = avail_repositories(check_useable=True).keys() indent = " " * 2 txt = ["All avaialble repository types"] repos = sorted(all_repos.keys()) for repo in repos: if repo in usable_repos: missing = "" else: missing = " (*Not usable*, something is missing (eg a specific module))" if repo in repopath_defaults: default = " (Default arguments: %s)" % (repopath_defaults[repo]) else: default = " (No default arguments)" txt.append("%s%s%s%s" % (indent, repo, default, missing)) txt.append("%s%s" % (indent * 2, all_repos[repo].DESCRIPTION)) return "\n".join(txt)
def avail_repositories(self): """Show list of known repository types.""" repopath_defaults = get_default_oldstyle_configfile_defaults()['repositorypath'] all_repos = avail_repositories(check_useable=False) usable_repos = avail_repositories(check_useable=True).keys() indent = ' ' * 2 txt = ['All avaliable repository types'] repos = sorted(all_repos.keys()) for repo in repos: if repo in usable_repos: missing = '' else: missing = ' (*not usable*, something is missing (e.g. a required Python module))' if repo in repopath_defaults: default = ' (default arguments: %s)' % ', '.join(repopath_defaults[repo]) else: default = ' (no default arguments)' txt.append("%s* %s%s%s" % (indent, repo, default, missing)) txt.append("%s%s" % (indent * 3, all_repos[repo].DESCRIPTION)) return "\n".join(txt)
def config_options(self): # config options descr = ("Configuration options", "Configure EasyBuild behavior.") oldstyle_defaults = get_default_oldstyle_configfile_defaults() opts = OrderedDict( { "avail-module-naming-schemes": ("Show all supported module naming schemes", None, "store_true", False), "avail-modules-tools": ("Show all supported module tools", None, "store_true", False), "avail-repositories": ("Show all repository types (incl. non-usable)", None, "store_true", False), "buildpath": ("Temporary build path", None, "store", oldstyle_defaults["buildpath"]), "ignore-dirs": ( "Directory names to ignore when searching for files/dirs", "strlist", "store", [".git", ".svn"], ), "installpath": ( "Install path for software and modules", None, "store", oldstyle_defaults["installpath"], ), "config": ("Path to EasyBuild config file", None, "store", oldstyle_defaults["config"], "C"), "logfile-format": ( "Directory name and format of the log file", "strtuple", "store", oldstyle_defaults["logfile_format"], {"metavar": "DIR,FORMAT"}, ), "module-naming-scheme": ( "Module naming scheme", "choice", "store", oldstyle_defaults["module_naming_scheme"], sorted(avail_module_naming_schemes().keys()), ), "moduleclasses": ( ( "Extend supported module classes " "(For more info on the default classes, use --show-default-moduleclasses)" ), None, "extend", oldstyle_defaults["moduleclasses"], ), "modules-footer": ( "Path to file containing footer to be added to all generated module files", None, "store_or_None", None, {"metavar": "PATH"}, ), "modules-tool": ( "Modules tool to use", "choice", "store", oldstyle_defaults["modules_tool"], sorted(avail_modules_tools().keys()), ), "prefix": ( ( "Change prefix for buildpath, installpath, sourcepath and repositorypath " "(repositorypath prefix is only relevant in case of FileRepository repository) " "(used prefix for defaults %s)" % oldstyle_defaults["prefix"] ), None, "store", None, ), "recursive-module-unload": ( "Enable generating of modules that unload recursively.", None, "store_true", False, ), "repository": ( "Repository type, using repositorypath", "choice", "store", oldstyle_defaults["repository"], sorted(avail_repositories().keys()), ), "repositorypath": ( ( "Repository path, used by repository " "(is passed as list of arguments to create the repository instance). " "For more info, use --avail-repositories." ), "strlist", "store", oldstyle_defaults["repositorypath"][oldstyle_defaults["repository"]], ), "show-default-moduleclasses": ( "Show default module classes with description", None, "store_true", False, ), "sourcepath": ( "Path(s) to where sources should be downloaded (string, colon-separated)", None, "store", oldstyle_defaults["sourcepath"], ), "subdir-modules": ( "Installpath subdir for modules", None, "store", oldstyle_defaults["subdir_modules"], ), "subdir-software": ( "Installpath subdir for software", None, "store", oldstyle_defaults["subdir_software"], ), # this one is sort of an exception, it's something jobscripts can set, # has no real meaning for regular eb usage "testoutput": ( "Path to where a job should place the output (to be set within jobscript)", None, "store", None, ), "tmp-logdir": ( "Log directory where temporary log files are stored", None, "store", oldstyle_defaults["tmp_logdir"], ), "tmpdir": ("Directory to use for temporary storage", None, "store", None), } ) self.log.debug("config_options: descr %s opts %s" % (descr, opts)) self.add_group_parser(opts, descr)
def config_options(self): # config options descr = ("Configuration options", "Configure EasyBuild behavior.") oldstyle_defaults = get_default_oldstyle_configfile_defaults() opts = OrderedDict({ 'avail-module-naming-schemes': ("Show all supported module naming schemes", None, 'store_true', False,), 'avail-modules-tools': ("Show all supported module tools", None, "store_true", False,), 'avail-repositories': ("Show all repository types (incl. non-usable)", None, "store_true", False,), 'buildpath': ("Temporary build path", None, 'store', oldstyle_defaults['buildpath']), 'ignore-dirs': ("Directory names to ignore when searching for files/dirs", 'strlist', 'store', ['.git', '.svn']), 'installpath': ("Install path for software and modules", None, 'store', oldstyle_defaults['installpath']), 'config': ("Path to EasyBuild config file", None, 'store', oldstyle_defaults['config'], 'C'), 'logfile-format': ("Directory name and format of the log file", 'strtuple', 'store', oldstyle_defaults['logfile_format'], {'metavar': 'DIR,FORMAT'}), 'module-naming-scheme': ("Module naming scheme", 'choice', 'store', oldstyle_defaults['module_naming_scheme'], sorted(avail_module_naming_schemes().keys())), 'moduleclasses': (("Extend supported module classes " "(For more info on the default classes, use --show-default-moduleclasses)"), None, 'extend', oldstyle_defaults['moduleclasses']), 'modules-footer': ("Path to file containing footer to be added to all generated module files", None, 'store_or_None', None, {'metavar': "PATH"}), 'modules-tool': ("Modules tool to use", 'choice', 'store', oldstyle_defaults['modules_tool'], sorted(avail_modules_tools().keys())), 'prefix': (("Change prefix for buildpath, installpath, sourcepath and repositorypath " "(repositorypath prefix is only relevant in case of FileRepository repository) " "(used prefix for defaults %s)" % oldstyle_defaults['prefix']), None, 'store', None), 'recursive-module-unload': ("Enable generating of modules that unload recursively.", None, 'store_true', False), 'repository': ("Repository type, using repositorypath", 'choice', 'store', oldstyle_defaults['repository'], sorted(avail_repositories().keys())), 'repositorypath': (("Repository path, used by repository " "(is passed as list of arguments to create the repository instance). " "For more info, use --avail-repositories."), 'strlist', 'store', oldstyle_defaults['repositorypath'][oldstyle_defaults['repository']]), 'show-default-moduleclasses': ("Show default module classes with description", None, 'store_true', False), 'sourcepath': ("Path(s) to where sources should be downloaded (string, colon-separated)", None, 'store', oldstyle_defaults['sourcepath']), 'subdir-modules': ("Installpath subdir for modules", None, 'store', oldstyle_defaults['subdir_modules']), 'subdir-software': ("Installpath subdir for software", None, 'store', oldstyle_defaults['subdir_software']), # this one is sort of an exception, it's something jobscripts can set, # has no real meaning for regular eb usage 'testoutput': ("Path to where a job should place the output (to be set within jobscript)", None, 'store', None), 'tmp-logdir': ("Log directory where temporary log files are stored", None, 'store', oldstyle_defaults['tmp_logdir']), 'tmpdir': ('Directory to use for temporary storage', None, 'store', None), }) self.log.debug("config_options: descr %s opts %s" % (descr, opts)) self.add_group_parser(opts, descr)
def config_options(self): # config options descr = ("Configuration options", "Configure EasyBuild behavior.") oldstyle_defaults = get_default_oldstyle_configfile_defaults() opts = { "config": ("Path to EasyBuild config file", None, "store", oldstyle_defaults["config"], "C"), "prefix": ( ( "Change prefix for buildpath, installpath, sourcepath and repositorypath " "(repositorypath prefix is only relevant in case of FileRepository repository)" "(used prefix for defaults %s)" % oldstyle_defaults["prefix"] ), None, "store", None, ), "buildpath": ("Temporary build path", None, "store", oldstyle_defaults["buildpath"]), "installpath": ("Final install path", None, "store", oldstyle_defaults["installpath"]), "subdir-modules": ("Subdir in installpath for modules", None, "store", oldstyle_defaults["subdir_modules"]), "subdir-software": ( "Subdir in installpath for software", None, "store", oldstyle_defaults["subdir_software"], ), "repository": ( "Repository type, using repositorypath", "choice", "store", oldstyle_defaults["repository"], sorted(get_repositories().keys()), ), "repositorypath": ( ( "Repository path, used by repository " "(is passed as list of arguments to create the repository instance). " "For more info, use --avail-repositories." ), "strlist", "store", oldstyle_defaults["repositorypath"][oldstyle_defaults["repository"]], ), "avail-repositories": (("Show all repository types (incl. non-usable)"), None, "store_true", False), "logfile-format": ( "Directory name and format of the log file ", "strtuple", "store", oldstyle_defaults["logfile_format"], {"metavar": "DIR,FORMAT"}, ), "tmp-logdir": ( "Log directory where temporary log files are stored", None, "store", oldstyle_defaults["tmp_logdir"], ), "sourcepath": ( "Path to where sources should be downloaded", None, "store", oldstyle_defaults["sourcepath"], ), "moduleclasses": ( ( "Extend supported module classes" " (For more info on the default classes, use --show-default-moduleclasses)" ), None, "extend", oldstyle_defaults["moduleclasses"], ), "show-default-moduleclasses": ("Show default module classes with description", None, "store_true", False), # this one is sort of an exception, it's something jobscripts can set, # has no real meaning for regular eb usage "testoutput": ( "Path to where a job should place the output (to be set within jobscript)", None, "store", None, ), } self.log.debug("config_options: descr %s opts %s" % (descr, opts)) self.add_group_parser(opts, descr)
def config_options(self): # config options descr = ("Configuration options", "Configure EasyBuild behavior.") oldstyle_defaults = get_default_oldstyle_configfile_defaults() opts = OrderedDict({ 'avail-module-naming-schemes': ("Show all supported module naming schemes", None, 'store_true', False,), 'avail-modules-tools': ("Show all supported module tools", None, "store_true", False,), 'avail-repositories': ("Show all repository types (incl. non-usable)", None, "store_true", False,), 'buildpath': ("Temporary build path", None, 'store', oldstyle_defaults['buildpath']), 'ignore-dirs': ("Directory names to ignore when searching for files/dirs", 'strlist', 'store', ['.git', '.svn']), 'installpath': ("Install path for software and modules", None, 'store', oldstyle_defaults['installpath']), 'config': ("Path to EasyBuild config file", None, 'store', oldstyle_defaults['config'], 'C'), 'logfile-format': ("Directory name and format of the log file", 'strtuple', 'store', oldstyle_defaults['logfile_format'], {'metavar': 'DIR,FORMAT'}), 'module-naming-scheme': ("Module naming scheme", 'choice', 'store', oldstyle_defaults['module_naming_scheme'], sorted(avail_module_naming_schemes().keys())), 'moduleclasses': (("Extend supported module classes " "(For more info on the default classes, use --show-default-moduleclasses)"), None, 'extend', oldstyle_defaults['moduleclasses']), 'modules-footer': ("Path to file containing footer to be added to all generated module files", None, 'store_or_None', None, {'metavar': "PATH"}), 'modules-tool': ("Modules tool to use", 'choice', 'store', oldstyle_defaults['modules_tool'], sorted(avail_modules_tools().keys())), 'prefix': (("Change prefix for buildpath, installpath, sourcepath and repositorypath " "(used prefix for defaults %s)" % oldstyle_defaults['prefix']), None, 'store', None), 'recursive-module-unload': ("Enable generating of modules that unload recursively.", None, 'store_true', False), 'repository': ("Repository type, using repositorypath", 'choice', 'store', oldstyle_defaults['repository'], sorted(avail_repositories().keys())), 'repositorypath': (("Repository path, used by repository " "(is passed as list of arguments to create the repository instance). " "For more info, use --avail-repositories."), 'strlist', 'store', oldstyle_defaults['repositorypath'][oldstyle_defaults['repository']]), 'show-default-moduleclasses': ("Show default module classes with description", None, 'store_true', False), 'sourcepath': ("Path(s) to where sources should be downloaded (string, colon-separated)", None, 'store', oldstyle_defaults['sourcepath']), 'subdir-modules': ("Installpath subdir for modules", None, 'store', oldstyle_defaults['subdir_modules']), 'subdir-software': ("Installpath subdir for software", None, 'store', oldstyle_defaults['subdir_software']), 'suffix-modules-path': ("Suffix for module files install path", None, 'store', GENERAL_CLASS), # this one is sort of an exception, it's something jobscripts can set, # has no real meaning for regular eb usage 'testoutput': ("Path to where a job should place the output (to be set within jobscript)", None, 'store', None), 'tmp-logdir': ("Log directory where temporary log files are stored", None, 'store', oldstyle_defaults['tmp_logdir']), 'tmpdir': ('Directory to use for temporary storage', None, 'store', None), }) self.log.debug("config_options: descr %s opts %s" % (descr, opts)) self.add_group_parser(opts, descr)