Created
July 21, 2016 19:04
-
-
Save akhilman/af9ba7bce2613d265eb9769020bed566 to your computer and use it in GitHub Desktop.
Controller that creates window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TKViewController(CementBaseController): | |
class Meta: | |
label = "tkview" | |
stacked_on = 'base' | |
stacked_type = 'nested' | |
arguments = [ | |
(['dataset'], | |
dict(help='dataset to show', | |
action='store', metavar='DATASET', nargs='?') | |
), | |
(['-v', '--version'], dict(action='version', version=BANNER)), | |
] | |
default_func = 'default' | |
def list(self): | |
print("list of available data") | |
@expose(help="Tk Chart Viewer for Ranger charts", hide=True) | |
def default(self): | |
app = self.app | |
if not app.pargs.dataset: | |
print('No dataset was specified.') | |
self.list() | |
return | |
data = app.database.get_dataset('superdata', app.pargs.dataset) | |
model = SuperDataModel() | |
model._setup(app, data) | |
window = ChartView() | |
window._setup(app, model) | |
window.title('Tk SuperData View: {} ({})'.format( | |
data.name)) | |
window.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment