Request for classic confinement

Hello, I would like to request for classic confinement for “simple-todo” snap.

I tried with the strict one but I need to create a folder with my app and it crash with the strict confinement.

To create the folder I use ‘os.mkdir("")’ in python.

Thank you by advance

Thank you for your response, I tried to upload my snap with the classic confinement but I cannot, the same error occurred. Do I have the access to do it or should I wait more ?

Thanks by advance

LAFORGUE Rémi

I’m not sure this app requires classic confinement. The current version of the app is trying to create a .todo directory under the current working directory. This would mean that you have to be in the same directory in order to have the same set of todo lists, which is probably not the intended behaviour. I would suspect that you intend to have the todo list saved globally.

If the application is meant to be snap-aware, the most sensible thing to do is to store the data under $SNAP_USER_COMMON/.todo. If it’s not, it could be stored under $HOME/.todo.

You can access these environment variables using the mapping in os.environ. So the directory string ".todo" would become os.environ["SNAP_USER_COMMON"] + "/.todo"

Thanks for your answer

It was the indented behavior to have local/project turned todo list but its much easier to do it the way you showed me because it may not require the classic confinement

Ahh, that makes sense. Given that, you may be able to use the home interface to provide that functionality. Or if you want it to be aware of the user’s current directory, you could detect the PWD and use that as a default name for the todo list while still storing all the lists together in the snap’s directory (which I believe wouldn’t require any plugs, since I think you’re able to detect the working directory - just not necessarily read/write anything in it).

Yeah, I should definitely do that !

Thank you a lot for your help

1 Like