def __init__(self): argv = None self.app = initAppWithGui(argv, do_exec=False) # kick off a Gui style app self.document = self.app.document() self.window = self.document.controller().win # Include this or the automatic build will hang self.app.dontAskAndJustDiscardUnsavedChanges = True # By setting the widget to the main window we can traverse and # interact with any part of it. Also, tearDown will close # the application so we don't need to worry about that. self.setWidget(self.window, False)
def __init__(self): argv = None self.app = initAppWithGui(argv, do_exec=False) # kick off a Gui style app self.document = self.app.document() self.app_window = self.app.cnmain_windows[0] # Include this or the automatic build will hang self.app.dontAskAndJustDiscardUnsavedChanges = True # By setting the widget to the main app_window we can traverse and # interact with any part of it. Also, tearDown will close # the application so we don't need to worry about that. self.setWidget(self.app_window, False)
def main(argv=None): # print(argv) from cadnano import initAppWithGui # Things are a lot easier if we can pass None instead of sys.argv and only fall back to sys.argv when we need to. app = initAppWithGui(argv, do_exec=False) if app.argns.profile: print("Collecting profile data into cadnano.profile") import cProfile cProfile.runctx('app.exec_()', None, locals(), filename='cadnano.profile') print("Done collecting profile data. Use -P to print it out.") if not app.argns.profile and not app.argns.print_stats: sys.exit(app.exec_()) if app.argns.print_stats: from pstats import Stats s = Stats('cadnano.profile') print("Internal Time Top 10:") s.sort_stats('cumulative').print_stats(10) print("\nTotal Time Top 10:") s.sort_stats('time').print_stats(10)
def setUp(self): """ The setUp method is called before running any test. It is used to set the general conditions for the tests to run correctly. For GUI Tests, you always have to call setWidget to tell the framework what you will be testing. """ import sys self.app = cadnano.initAppWithGui() # kick off a Gui style app self.documentController = list(self.app.documentControllers)[0] self.mainWindow = self.documentController.win # Include this or the automatic build will hang self.app.dontAskAndJustDiscardUnsavedChanges = True # By setting the widget to the main window we can traverse and # interact with any part of it. Also, tearDown will close # the application so we don't need to worry about that. self.setWidget(self.mainWindow, False, None)
def main(args): print(args) from cadnano import initAppWithGui app = initAppWithGui(args) if "-p" in args: print("Collecting profile data into cadnano.profile") import cProfile cProfile.runctx('app.exec_()', None, locals(), filename='cadnano.profile') print("Done collecting profile data. Use -P to print it out.") elif "-P" in args: from pstats import Stats s = Stats('cadnano.profile') print("Internal Time Top 10:") s.sort_stats('cumulative').print_stats(10) print("\nTotal Time Top 10:") s.sort_stats('time').print_stats(10) # elif "-t" in sys.argv: # print("running tests") # from tests.runall import main as runTests # runTests(useXMLRunner=False) sys.exit(app.exec_())
#!/usr/bin/env python """ main.py Created by Shawn Douglas on 2010-09-26. """ import sys import os sys.path.insert(0, '.') import cadnano if "-t" in sys.argv: os.environ['CADNANO_IGNORE_ENV_VARS_EXCEPT_FOR_ME'] = 'YES' cadnano.initAppWithGui() if __name__ == '__main__': app = cadnano.app() if "-p" in sys.argv: print("Collecting profile data into cadnano.profile") import cProfile cProfile.run('app.exec_()', 'cadnano.profile') print("Done collecting profile data. Use -P to print it out.") exit() elif "-P" in sys.argv: from pstats import Stats s = Stats('cadnano.profile') print("Internal Time Top 10:") s.sort_stats('cumulative').print_stats(10) print("")
""" main.py Created by Shawn Douglas on 2010-09-26. """ import sys import os sys.path.insert(0, '.') import cadnano if "-t" in sys.argv: os.environ['CADNANO_IGNORE_ENV_VARS_EXCEPT_FOR_ME'] = 'YES' cadnano.initAppWithGui() if "-p" not in sys.argv: # Having our own NSApplication doesn't play nice with # collecting profile data. try: # If we are in Mac OS X, initialize Mac OS X specific stuff supportsPythonObjCBridge = False import objc supportsPythonObjCBridge = True except Exception, e: print e if supportsPythonObjCBridge: pass from osx.CNApplicationDelegate import sharedDelegate as appDelegate # else: