No able to use "--delete-all-files" from python from RPi

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

No able to use "--delete-all-files" from python from RPi

citterly
Hi there,
I'm hobbiest and just learning python as part of making a 3d scanner. My code to operate the stepper motor is sorted and working well and I almost have all my camera operations done too. I've had success with the functions --> --trigger-capture  --get-all-files  
Code as follows:
    call(["gphoto2", "--trigger-capture")
    call(["gphoto2", "--get-all-files")

The problem I'm having is using the --delete-all-files function from the python code.
When using the command line, the following executes successfully:
gphoto2 --delete-all-files --folder '/store_00010001/DCIM/101D3400'

Although, when executing the following:
    call(["gphoto2", "--delete-all-files", "--folder '/store_00010001/DCIM/101D3400'"])

It just skips that line of code and the files remain on the SD card.
My camera is a Nikon D3400.

Thanks in advance for the help
Chris




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No able to use "--delete-all-files" from python from RPi

Marcus Meissner-4
On Thu, Jul 13, 2017 at 03:19:43PM -0700, citterly wrote:

> Hi there,
> I'm hobbiest and just learning python as part of making a 3d scanner. My
> code to operate the stepper motor is sorted and working well and I almost
> have all my camera operations done too. I've had success with the functions
> --> --trigger-capture  --get-all-files  
> Code as follows:
>     call(["gphoto2", "--trigger-capture")
>     call(["gphoto2", "--get-all-files")
>
> The problem I'm having is using the --delete-all-files function from the
> python code.
> When using the command line, the following executes successfully:
> gphoto2 --delete-all-files --folder '/store_00010001/DCIM/101D3400'
>
> Although, when executing the following:
>     call(["gphoto2", "--delete-all-files", "--folder
> '/store_00010001/DCIM/101D3400'"])
>
> It just skips that line of code and the files remain on the SD card.
> My camera is a Nikon D3400.

You probably need to pass the folder parameter as two parameters, like e.g. this:

call(["gphoto2", "--delete-all-files", "--folder", "/store_00010001/DCIM/101D3400"])

or as one but with = sign:

call(["gphoto2", "--delete-all-files", "--folder=/store_00010001/DCIM/101D3400"])

Ciao, Marcus

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gphoto-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gphoto-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: No able to use "--delete-all-files" from python from RPi

citterly
Thanks Marcus, the function is working now with the folder being defined with 2 parameters.
Awesomeness has ensued.....
Loading...