Skip to content

Commit

Permalink
changed PathManager python template prop to static
Browse files Browse the repository at this point in the history
actually gets rid of un-necessary initialisation of new `PreferenceSettings` or `PathManager` classes, see DynamoDS/Dynamo#8034 (review)
forgot the PathManager in last commit.
  • Loading branch information
radumg authored and jiafeng5513 committed Oct 6, 2018
1 parent 704d61e commit 400289f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/DynamoCore/Configuration/PathManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PathManager : IPathManager
private readonly string backupDirectory;
private readonly string preferenceFilePath;
private readonly string galleryFilePath;
private readonly string pythonTemplateFilePath;
private static string pythonTemplateFilePath;

private readonly List<string> rootDirectories;
private readonly HashSet<string> nodeDirectories;
Expand Down Expand Up @@ -597,6 +597,11 @@ private IEnumerable<string> LibrarySearchPaths(string library)
yield return Path.GetFullPath(library);
}

internal static string GetPythonTemplatePath()
{
return pythonTemplateFilePath;
}

#endregion
}
}
2 changes: 1 addition & 1 deletion src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public PreferenceSettings()
ShowDetailedLayout = true;
NamespacesToExcludeFromLibrary = new List<string>();

PythonTemplateFilePath = new PathManager(new PathManagerParams()).PythonTemplateFilePath;
PythonTemplateFilePath = PathManager.GetPythonTemplatePath();

BackupInterval = 60000; // 1 minute
BackupFilesCount = 1;
Expand Down

0 comments on commit 400289f

Please sign in to comment.