Changeset 2a670e5 in tol


Ignore:
Timestamp:
Feb 1, 2012, 6:59:59 PM (15 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
23f300d
Parents:
2f5c82f1
Message:

Refs #992
Mixing older configuration files

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@4052 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/TolConfigManager/methods.tol

    r2f5c82f1 r2a670e5  
    144144{
    145145//WriteLn("TRACE [LoadConfig] 1");
    146   Real Case(!FileExist(_.path),
     146  Text lastPath = If(FileExist(_.path),_.path,
    147147  {
    148 //WriteLn("TRACE [LoadConfig] 2.1");
     148    Set tolAppFiles = GetDir(TolAppDataPath)[1];
     149    Set tolAppConfig = Select(tolAppFiles,Real(Text fName)
     150    {
     151      TextBeginWith(fName,".tolConfig.") &
     152      TextEndAt    (fName,".tol")
     153    });
     154    Set versions = EvalSet(tolAppConfig,Text(Text fName)
     155    {
     156      Replace(Replace(fName,".tolConfig.",""),".tol","")
     157    });
     158    Set versions.sort = Sort(versions, Real(Text a, Text b)
     159    {
     160      Compare.VersionString(b,a)
     161    });
     162    TolAppDataPath+".tolConfig."+versions.sort[1]+".tol"
     163  });
     164//WriteLn("TRACE [LoadConfig] 2 _.path='"+_.path+"'");
     165//WriteLn("TRACE [LoadConfig] 3 lastPath='"+lastPath+"'");
     166  Real Case(!FileExist(lastPath),
     167  {
     168  //WriteLn("TRACE [LoadConfig] 4.1");
    149169    Real SaveConfig(Default);
    150170    NameBlock Config := Include(_.path)[1];
    … …  
    153173  1==1,
    154174  {
    155   //WriteLn("TRACE [LoadConfig] 2.2");
     175  //WriteLn("TRACE [LoadConfig] 4.2");
    156176    NameBlock Config :=
    157       MergeOptions(TolConfigManager::Default, { Include(_.path)[1] },
     177      MergeOptions(TolConfigManager::Default, { Include(lastPath)[1] },
    158178     "TolConfigManager::Config::");
    159179    Real SaveConfig(Config)
Note: See TracChangeset for help on using the changeset viewer.