Forum

Author Topic: Removed return values  (Read 1974 times)

eberkund

  • Newbie
  • *
  • Posts: 9
    • View Profile
Removed return values
« on: July 06, 2017, 06:31:44 PM »
I see in the changelog for version 1.30 that the return values have been removed from a number of methods. Including Document.open(). Why is this? I am currently using that method to check if the project was opened successfully, is there a new way to do this?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: Removed return values
« Reply #1 on: July 06, 2017, 07:08:30 PM »
Hello e.berkun-drevnig,

You can use try-except convention:
Code: [Select]
doc = PhotoScan.Document()
try:
      doc.open(path)
except RuntimeError:
      print("Document open failed")
Best regards,
Alexey Pasumansky,
Agisoft LLC

eberkund

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Removed return values
« Reply #2 on: July 06, 2017, 10:14:52 PM »
Perfect, just what I was looking for!  :)