예제 #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()