/psychopy/app/psychopyApp.py

https://github.com/smathot/psychopy
Python | 49 lines | 37 code | 5 blank | 7 comment | 7 complexity | 6382abb4a2af48f78a9642294edecd4e MD5 | raw file
  1. #!/usr/bin/env python
  2. # Part of the PsychoPy library
  3. # Copyright (C) 2013 Jonathan Peirce
  4. # Distributed under the terms of the GNU General Public License (GPL).
  5. from psychopy.app._psychopyApp import *
  6. #NB the PsychoPyApp classes moved to _psychopyApp.py as of version 1.78.00
  7. #to allow for better upgrading possibilities from the mac app bundle. this file
  8. #now used solely as a launcher for the app, not as the app itself.
  9. if __name__=='__main__':
  10. if '-v' in sys.argv or '--version' in sys.argv:
  11. print 'PsychoPy2, version %s (c)Jonathan Peirce, 2013, GNU GPL license' %psychopy.__version__
  12. sys.exit()
  13. if '-h' in sys.argv or '--help' in sys.argv:
  14. print """Starts the PsychoPy2 application.
  15. Usage: python PsychoPy.py [options] [file]
  16. Without options or files provided starts the psychopy using prefs to
  17. decide on the view(s) to open. If optional [file] is provided action
  18. depends on the type of the [file]:
  19. Python script 'file.py' -- opens coder
  20. Experiment design 'file.psyexp' -- opens builder
  21. Options:
  22. -c, --coder, coder opens coder view only
  23. -b, --builder, builder opens builder view only
  24. -v, --version prints version and exits
  25. -h, --help prints this help and exit
  26. --firstrun launches configuration wizard
  27. --nosplash suppresses splash screen
  28. """
  29. sys.exit()
  30. else:
  31. showSplash = True
  32. if '--no-splash' in sys.argv:
  33. showSplash = False
  34. del sys.argv[sys.argv.index('--no-splash')]
  35. app = PsychoPyApp(0, showSplash=showSplash)
  36. app.MainLoop()