Open Deses opened 1 year ago
I suggest you use
from pathlib import Path
Path("/my/directory").mkdir(parents=True, exist_ok=True)
To create folders.
Also, it would make everything much simpler if the usersettings
file asked for the absolute path of the folder, no need for check if USB folder exists, define an external_drive_name
variable, and so on.
I'll add the ability to specific an absolute path. If that is not provided, I will revert to default paths: first on a user-specified external drive, then locally. I'll also fix the /Pictures and /Videos bug on headless setups. More to come.
I see where the need of an external drive can come in handy, but again a headless Pi without the desktop environment doesn't automatically mount external media, you have to SSH in and mount it manually to your desired folder. That's why I suggested not bothering with that and just let the user manually type the full path.
Here are the changes I made for myself, if you want to take a look: https://github.com/benstanfish/TimelapsePy/commit/39274e05ce84f34194d38fdcd5e397e9571ed6ac
In any way, I'll probably re-add the USB functionality once you do it the way you like it.
That's because in a default headless Pi installation, there are no default folders like
Pictures
andDownloads
. If I create thePictures
folder it works, tho.I would not hardcode the
Pictures
folder anyway, for instance I don't want to store the pics there.