|
|
|
|
|
|
|
|
|
|
//This files stores entries as ProjectDataPath,PythonPID,Port,PyrceptionPID
|
|
|
|
//It keeps a record of the instances of pyrception opened so that we don't open a new one everytime
|
|
|
|
private static readonly string _filename_streamlit_instances = "streamlit_instances.csv"; |
|
|
|
private static readonly string _filename_streamlit_instances = "Unity/cache/streamlit_instances.csv"; |
|
|
|
private static string pathToStreamlitInstances |
|
|
|
{ |
|
|
|
get |
|
|
|
|
|
|
#elif UNITY_EDITOR_OSX
|
|
|
|
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), _filename_streamlit_instances); |
|
|
|
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), _filename_streamlit_instances); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
private static (int pythonPID, int port, int pyrceptionPID) ReadEntry(string project) |
|
|
|
{ |
|
|
|
string path = pathToStreamlitInstances; |
|
|
|
if (!Directory.Exists(pathToStreamlitInstances)) |
|
|
|
if (!File.Exists(path)) |
|
|
|
return (-1,-1,-1); |
|
|
|
using (StreamReader sr = File.OpenText(path)) |
|
|
|