Esempio n. 1
0
 def application_openFile_(self, app, f):
     if f == "main.py":  # ignore
         return
     extension = os.path.splitext(f)[1].lower()
     if extension not in ('.nno', '.json', '.cadnano'):
         print("Could not open file %s (bad extension %s)" % (f, extension))
         return
     dc = list(sharedCadnanoObj().documentControllers)[0]
     decode(dc.document(), file(str(f)).read())
     return None
 def application_openFile_(self, app, f):
     if f == "main.py":  # ignore
         return
     extension = os.path.splitext(f)[1].lower()
     if extension not in ('.nno', '.json', '.cadnano'):
         print "Could not open file %s (bad extension %s)"%(f, extension)
         return
     dc = list(sharedCadnanoObj().documentControllers)[0]
     decode(dc.document(), file(str(f)).read())
     return None
Esempio n. 3
0
 def applicationShouldTerminate_(self, app):
     for dc in sharedCadnanoObj().documentControllers:
         if not dc.maybeSave():
             return NSTerminateCancel
     return NSTerminateNow
Esempio n. 4
0
 def applicationShouldTerminate_(self, app):
     for dc in sharedCadnanoObj().documentControllers:
         if not dc.maybeSave():
             return NSTerminateCancel
     return NSTerminateNow