OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python -tt |
| 2 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 """Quick-and-dirty viewer for bmpblock yaml files""" |
| 7 import os |
| 8 import sys |
| 9 import wx |
| 10 |
| 11 from lib import bmpblock |
| 12 from lib import pixcontrol |
| 13 from lib import pixdisplay |
| 14 |
| 15 class MyApp(wx.App): |
| 16 |
| 17 def OnInit(self): |
| 18 self._bmpblock = bmpblock.BmpBlock(sys.argv[1]) |
| 19 progname = os.path.basename(sys.argv[0]) |
| 20 self._mainframe = pixcontrol.Frame(self._bmpblock, progname) |
| 21 self._mainframe.Show() |
| 22 self.SetTopWindow(self._mainframe) |
| 23 self._imgframe = pixdisplay.Frame(self._bmpblock, sys.argv[1]) |
| 24 self._imgframe.Show() |
| 25 return True |
| 26 |
| 27 def main(): |
| 28 if len(sys.argv) != 2: |
| 29 print "You must specify a config.yaml file to view" |
| 30 sys.exit(1) |
| 31 MyApp(False).MainLoop() |
| 32 |
| 33 if __name__ == '__main__': |
| 34 main() |
OLD | NEW |