Changeset 1:832ec3939518
- Timestamp:
- 02/04/07 22:37:06 (19 months ago)
- Branch:
- trunk
- Files:
-
- 1 modified
-
share/aldrin/main.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
share/aldrin/main.py
r0 r1 446 446 447 447 import sys 448 if len( sys.argv) > 1:449 self.open_file( sys.argv[1])448 if len(app_args) > 1: 449 self.open_file(app_args[1]) 450 450 if audiotrouble: 451 451 wx.MessageDialog(self, message="Aldrin tried to guess an audio driver but that didn't work. You need to select your own. Hit OK to show the preferences dialog.", caption = "Aldrin", style = wx.ICON_ERROR|wx.OK|wx.CENTER).ShowModal() … … 1706 1706 return 1 1707 1707 1708 def run(argv): 1709 """ 1710 Starts the application and runs the mainloop. 1711 1712 @param argv: command line arguments as passed by sys.argv. 1713 @type argv: str list 1714 """ 1715 global app 1708 from optparse import OptionParser 1709 parser = OptionParser() 1710 parser.add_option("--profile", metavar="profile", default='', help="Start Aldrin with profiling enabled, save results to <profile>.") 1711 app_options = None 1712 app_args = None 1713 1714 def main(): 1716 1715 app = AldrinApplication(0) 1717 1716 app.MainLoop() … … 1721 1720 player.mididriver_close_all() 1722 1721 driver.get_audiodriver().destroy() 1722 1723 def run(argv): 1724 """ 1725 Starts the application and runs the mainloop. 1726 1727 @param argv: command line arguments as passed by sys.argv. 1728 @type argv: str list 1729 """ 1730 global app 1731 global app_options 1732 global app_args 1733 app_options, app_args = parser.parse_args(argv) 1734 if app_options.profile: 1735 import profile 1736 profile.runctx('main()', globals(), locals(), app_options.profile) 1737 else: 1738 main() 1723 1739 1724 1740 __all__ = [ … … 1731 1747 'TimePanel', 1732 1748 'AldrinApplication', 1749 'main', 1733 1750 'run', 1734 1751 ]
