11import shutil
2- import yaml
32import sys
43import os .path
4+ import yaml
55
66#TODO: change active project
77project = "somthing-else"
88
99def which_path ():
1010 #check if os is linux
11- if (sys .platform == "linux" or sys . platform == "linux2" ):
11+ if (sys .platform in ( "linux" , "linux2" ) ):
1212 path = "~/.config/gridscale"
1313 path = os .path .expanduser (path )
1414 if not os .path .exists (path ):
1515 os .makedirs (path )
1616 #check if os is windows
17- elif (sys .platform == "win32" or sys . platform == "cygwin" or sys . platform == "msys" ):
17+ elif (sys .platform in ( "win32" , "cygwin" , "msys" ) ):
1818 path = "%APPDATA%\gridscale"
1919 path = os .path .expanduser (path )
2020 if not os .path .exists (path ):
2121 os .makedirs (path )
2222 #check if os is mac os
23- elif (sys .platform == "darwin" or sys . platform == "os2" or sys . platform == "os2emx" ):
23+ elif (sys .platform in ( "darwin" , "os2" , "os2emx" ) ):
2424 path = "~/Library/Application Support/gridscale"
2525 path = os .path .expanduser (path )
2626 if not os .path .exists (path ):
@@ -34,7 +34,6 @@ def create_config(path):
3434 cwd = os .getcwd ()
3535 shutil .copyfile (f"{ cwd } /config.yaml" , path )
3636 print (f"New config file created, edit config file at: { path } " )
37- return
3837
3938def load_config (projectname , goal , path ):
4039 with open (f"{ path } " , 'r' ) as stream :
0 commit comments