(version)
| 848 | # Returns the default installation path for the given version. |
| 849 | # |
| 850 | def default_path(version): |
| 851 | # Use auto-detected path if possible. |
| 852 | options = __versions.get(version, 'options') |
| 853 | tmp_path = None |
| 854 | if options: |
| 855 | tmp_path = feature.get_values('<command>', options) |
| 856 | |
| 857 | if tmp_path: |
| 858 | tmp_path="".join(tmp_path) |
| 859 | tmp_path=os.path.dirname(tmp_path) |
| 860 | else: |
| 861 | env_var_var_name = '__version_{}_env'.format(version.replace('.','_')) |
| 862 | vc_path = None |
| 863 | if env_var_var_name in globals(): |
| 864 | env_var_name = globals()[env_var_var_name] |
| 865 | if env_var_name in os.environ: |
| 866 | vc_path = environ[env_var_name] |
| 867 | if vc_path: |
| 868 | vc_path = os.path.join(vc_path,globals()['__version_{}_envpath'.format(version.replace('.','_'))]) |
| 869 | tmp_path = os.path.normpath(vc_path) |
| 870 | |
| 871 | var_name = '__version_{}_path'.format(version.replace('.','_')) |
| 872 | if not tmp_path and var_name in globals(): |
| 873 | tmp_path = os.path.normpath(os.path.join(common.get_program_files_dir(), globals()[var_name])) |
| 874 | return tmp_path |
| 875 | |
| 876 | |
| 877 | # Returns either the default installation path (if 'version' is not empty) or |
no test coverage detected