def __init__(self): BaseController.__init__(self) self.isloaded = False c.configuration = request.params["configuration"] c.scenario = request.params["scenario"] calypso.tlm.load(c.configuration) # self.user=session['user'] self.format = None self.model = None
def __before__(self, action): try: BaseController.__before__(self, action) c.display = calypso_session[self.user]['display'] c.tabs = c.display.tabs c.tab = c.selected c.window = c.display.get_window(c.selected) self.tile=c.window.tiles[c.y_pos][c.x_pos] self.tab=c.selected except: print "REQUEST PARAMS ARE:" print request.params raise
def __before__(self,action): BaseController.__before__(self, action) if request.params.has_key('theme'): c.theme=request.params['theme'] elif calypso_session.has_key('theme'): c.theme=calypso_session['theme'] else: c.theme='default' calypso_session['theme']=c.theme if not(calypso_session.has_key(self.user)): calypso_session[self.user]={} c.user=self.user forms.UniqueProject.projects=Project.query_projects() forms.UniqueWorkbook.projects=Workbook.query_workbooks() c.projects=forms.UniqueProject.projects
def __before__(self, action): BaseController.__before__(self, action) if not (calypso_session.has_key(self.user)): calypso_session[self.user] = {} if request.params.has_key("display"): displayname = request.params["display"] self.model = DisplayModel.get_model(self.user, displayname) # elif calypso_session[self.user].has_key('display'): # self.model=calypso_session[self.user]['display'].model else: self.model = DisplayModel.get_model(user=self.user, displayname="unnamed") self.format = Format.get_format("Default") if not (self.format): self.format = Format.get_format(self.model.get_format()) c.display = self self.tabs = TelemetryWindow.get_tabs(self, self.user) self.tabstable = {} if len(self.tabs) == 0: self.add_new_tab() for tab in self.tabs: self.tabstable[tab.get_name()] = tab if not (calypso_session[self.user].has_key("display")) or calypso_session[self.user]["display"] == None: self.isloaded = True calypso_session[self.user]["display"] = self # else: # self.tabs=calypso_session[self.user]['display'].tabs # self.tabstable=calypso_session[self.user]['display'].tabstable if request.params.has_key("tab"): c.selected = str(request.params["tab"]) else: c.selected = self.tabstable.keys()[0] c.window = self.tabstable[c.selected] try: c.window = self.tabstable[c.selected] except: if len(self.tabs) == 0: self.add_new_tab() keys = self.tabstable.keys() c.selected = keys[0] c.tabs = self.tabs c.name = self.model.get_name() Palette_Menu.create_menu() c.selected_tile = None calypso_session[self.user]["display"] = self if request.params.has_key("theme"): c.theme = request.params["theme"]
def __init__(self): BaseController.__init__(self) self.user = None
def __init__(self): self.ttsclient = festival.Festival() BaseController.__init__(self)