Forum

Author Topic: Cancel kills python  (Read 3799 times)

r0xx

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Cancel kills python
« on: December 24, 2014, 01:44:40 PM »
Hello

I have found a bug in the python implementation. Try to import a python script like you normally do.
Then execute a task like create point cloud. During the generation cancel it and try to execute any python script.
It will be stuck and don't anything until you restart photoscan and run your script again...

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14839
    • View Profile
Re: Cancel kills python
« Reply #1 on: December 24, 2014, 01:56:08 PM »
Hello r0xx,

You need to implement special checks for possible user intervention in the process, if you do not wish the script to crash after pressing Cancel button in any processing progress dialog.
Best regards,
Alexey Pasumansky,
Agisoft LLC

r0xx

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Cancel kills python
« Reply #2 on: December 24, 2014, 02:01:45 PM »
Ah ok how would one do that?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14839
    • View Profile
Re: Cancel kills python
« Reply #3 on: December 24, 2014, 02:08:03 PM »
Hello r0xx,

Something like the following:

Code: [Select]
try:
      chunk.alignCameras()
except KeyboardInterrupt:
      print("Aborted by user")
      return
Best regards,
Alexey Pasumansky,
Agisoft LLC

r0xx

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Cancel kills python
« Reply #4 on: December 24, 2014, 02:17:30 PM »
Ok thanks alot!