@@ -873,22 +873,28 @@ def save(self):
873873 "PUT" , "/admin/code-envs/%s/%s" % (self .env_lang , self .env_name ), body = self .settings )
874874
875875class DSSCodeEnvPackageListBearer (object ):
876- def get_required_packages (self ):
876+ def get_required_packages (self , as_list = False ):
877877 """
878878 Return the list of required packages, as a single string
879+
880+ :param boolean as_list: if True, return the spec as a list of lines; if False, return as a single multiline string
879881 """
880- return self .settings .get ("specPackageList" , "" )
882+ x = self .settings .get ("specPackageList" , "" )
883+ return x .split ('\n ' ) if as_list else x
881884 def set_required_packages (self , * packages ):
882885 """
883886 Set the list of required packages
884887 """
885888 self .settings ["specPackageList" ] = '\n ' .join (packages )
886889
887- def get_required_conda_spec (self ):
890+ def get_required_conda_spec (self , as_list = False ):
888891 """
889892 Return the list of required conda packages, as a single string
893+
894+ :param boolean as_list: if True, return the spec as a list of lines; if False, return as a single multiline string
890895 """
891- return self .settings .get ("specCondaEnvironment" , "" )
896+ x = self .settings .get ("specCondaEnvironment" , "" )
897+ return x .split ('\n ' ) if as_list else x
892898 def set_required_conda_spec (self , * spec ):
893899 """
894900 Set the list of required conda packages
0 commit comments