Files
OpenCellular/scripts/newbitmaps/bitmap_viewer
Bill Richardson dfe4ca5e40 Add stuff to support new bitmap format.
Add bitmap_viewer program (to run OUTSIDE of chroot) and example bitmaps (to
be replaced by the REAL bitmaps for each platform).

BUG=chromium-os:10949
TEST=none

These are just nonessential tools and examples. No regression testing needed.

Change-Id: I7f9aab30809251e4c62d71bfa73293d0b4d97196

Review URL: http://codereview.chromium.org/6598046
2011-03-01 12:58:27 -08:00

35 lines
909 B
Python
Executable File

#!/usr/bin/python -tt
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Quick-and-dirty viewer for bmpblock yaml files"""
import os
import sys
import wx
from lib import bmpblock
from lib import pixcontrol
from lib import pixdisplay
class MyApp(wx.App):
def OnInit(self):
self._bmpblock = bmpblock.BmpBlock(sys.argv[1])
progname = os.path.basename(sys.argv[0])
self._mainframe = pixcontrol.Frame(self._bmpblock, progname)
self._mainframe.Show()
self.SetTopWindow(self._mainframe)
self._imgframe = pixdisplay.Frame(self._bmpblock, sys.argv[1])
self._imgframe.Show()
return True
def main():
if len(sys.argv) != 2:
print "You must specify a config.yaml file to view"
sys.exit(1)
MyApp(False).MainLoop()
if __name__ == '__main__':
main()