示例#1
0
	def GET(self):		
		zones_interdites = model.getZoneInterdites()
		if authentication.is_logged(session) :
			print("the user is logged in")
			authentication.update_session(session)
			print session.__dict__
			return render.index(session, zones_interdites)
		else :
			print("the user is not logged in")
			authentication.logout(session) #clearing any remaining sessions
			return render.index(None, zones_interdites)
示例#2
0
 def GET(self):
     if len(web.input()) > 0:
         with open(currentFile, 'r') as f:
             data = f.read()
         return data
     else:
         return render.index(view.list())
示例#3
0
    def GET(self):
        data = web.input(action="no action")
        if (data.action == 'start'):
            pubToScheduler.publish("start")
            return "Start Command Published Successfully"

        if (data.action == 'cancel'):
            pubToScheduler.publish("cancel")
            return "Cancel Command Published Successfully"

        data = web.input(emergency_area_x="no_x")

        if (data.emergency_area_x != 'no_x'):
            data = web.input(emergency_area_y="no_y")
            if (data.emergency_area_y != 'no_y'):
                pubToScheduler.publish("emergency_area " +
                                       str(data.emergency_area_x) + " " +
                                       str(data.emergency_area_y))
                return "Emergency Area with X,Y=(" + str(
                    data.emergency_area_x) + "," + str(
                        data.emergency_area_y) + ") Published Successfully"
        else:
            if len(web.input()) > 0:
                with open(currentFile, 'r') as f:
                    data = f.read()
                return data
            else:
                return render.index(view.list())
示例#4
0
	def POST(self):
		zones_interdites = model.getZoneInterdites()
		print("POST Submitted")
		i = web.input()
		print(i) #printing the post vars
		# We received a POST from the login form
		if i.submitlogin != None :
			postVars = dict(login=i.login, password=i.password)
			auth_results = authentication.authenticate(postVars)
			# print(auth_results)
			if auth_results['login_validated'] == True :
				authentication.register_login(session,auth_results)
				view_msg ="successfully logged in"
				print session.__dict__
				return render.index(session, zones_interdites)
			else :
				view_msg ="Bad authentication"
				return render.index(None, zones_interdites)
		else :
			return render.index(None, zones_interdites)
示例#5
0
文件: main.py 项目: milogert/tspcal
    def GET(self, year, month):
        """Shows different month and year view."""
        date_obj = date
        cal = calendar
        year = int(year)
        month = int(month)

        # Reset the month and year based on going too high or too low.
        if month is 13:
            raise web.seeother("/" + str(year + 1) + "/1")
        elif month is 0:
            raise web.seeother("/" + str(year - 1) + "/12")

        events = model.get_month_events(year, month)
        return render.index(date_obj, cal, year, month, events)
示例#6
0
文件: webapp.py 项目: illbexyz/rash
 def GET(self, name):
     """GET index page."""
     return render.index()
示例#7
0
 def GET(self):
     return render.index('fenglvming')
示例#8
0
文件: index.py 项目: fikgol/vulcan
 def GET(self,):
     return render.index()
示例#9
0
 def GET (self):
     #print web.ctx.path
     #return render.base(render.index())
     #return render.base(menu(iweb.ctx.path), render.index())
     return render.base(menu, web.ctx.path, render.index())
示例#10
0
 def GET(self):
     #print web.ctx.path
     #return render.base(render.index())
     #return render.base(menu(iweb.ctx.path), render.index())
     return render.base(menu, web.ctx.path, render.index())
示例#11
0
 def GET(self, name):
     """GET index page."""
     return render.index()