Example #1
0
def display_page(pathname):
    if pathname == '/about':
        return About()
    if pathname == '/blog':
        return Blog()
    if pathname == '/portfolio':
        return Portfolio()
    if pathname == '/auditor':
        return Auditor()
    if pathname == '/home':
        return Homepage()
    else:
        return Homepage()
Example #2
0
def display_page(pathname):
    if pathname == "/player-stats":
        return App()
    elif pathname == "/about":
        return About()
    else:
        return Homepage()
Example #3
0
def display_page(pathname):
    if pathname == '/US':
        return app_covid()
    elif pathname == '/Case':
        return case_covid()
    else:
        return Homepage()
Example #4
0
    def __init__(self, title):
        super().__init__()
        self.setWindowTitle(title)
        self.setGeometry(0, 0, 1920, 1080)
        self.showMaximized()

        wm_file = QMenu("File")
        wm_file.addAction("test a")
        wm_file.addSeparator()
        wm_file.addAction("test b")

        wm_edit = QMenu("Edit")
        wm_exec = QMenu("Run")

        wm_menubar = QMenuBar()
        wm_menubar.addMenu(wm_file)
        wm_menubar.addMenu(wm_edit)
        wm_menubar.addMenu(wm_exec)

        ws_statbar = QStatusBar()
        ws_statbar.addWidget(QLabel("v1.17.0"))

        lfhdnl = ReferencedFileHandler()
        wx_homepage = Homepage(lfhdnl)
        wx_homepage.sg_proj_submit.connect(self.change_page)

        self.setMenuBar(wm_menubar)
        self.setStatusBar(ws_statbar)
        self.setCentralWidget(wx_homepage)
Example #5
0
def display_page(pathname):
    if pathname == '/training':
        return Training()
    elif pathname == '/training_perm':
        return Training_perm()
    elif pathname == '/eda':
        return EDA()
    elif pathname == '/eda_perm':
        return EDA_perm()
    elif pathname == '/userguide':
        return userGuide()
    elif pathname == '/buildmodel':
        return buildModel()
    elif pathname == '/h1bmodel':
        return h1bModel()
    elif pathname == '/permmodel':
        return permModel()
    elif pathname == '/aboutEDA':
        return aboutEDA()
    elif pathname == '/contactus':
        return contactus()
    elif pathname == '/documents':
        return documents()
    else:
        return Homepage()
Example #6
0
def display_page(pathname):
    if pathname == '/app':
        return App()
    if pathname == '/peaks':
        return Peak()
    else:
        return Homepage()
Example #7
0
def display_page(pathname):
    if pathname == '/training':
        return Training()
    elif pathname == '/eda':
        return EDA()
    else:
        return Homepage()
Example #8
0
def display_page(pathname):
    if pathname == '/simple-stats':
        return App()
    if pathname == '/predictions':
        return App2()
    else:
        return Homepage()
Example #9
0
 def UserLogin():
     username = userentry.get()
     password = passentry.get()
     id_pass = (username, password)
     ####### CHECK INTO DATABASE #######
     sqlformula = 'select username, password from Users where username = %s and password = %s '
     mycursor.execute(sqlformula, (
         username,
         password,
     ))
     all_users = mycursor.fetchall()
     permission = id_pass in all_users
     wronguserpass = Label(root)
     if permission == True:
         root.destroy()
         importusername(username)
         Homepage()
     else:
         wronguserpass.place(relx=0.58, rely=0.595, height=20, width=210)
         wronguserpass.configure(background="#000000")  # 070707
         wronguserpass.configure(disabledforeground="#a3a3a3")
         wronguserpass.configure(font="-family {Comic Sans MS} -size 10")
         wronguserpass.configure(foreground="#edbe00")
         wronguserpass.configure(highlightcolor="#fc613a")
         if username == '' or password == '':
             wronguserpass.configure(
                 text='''Username and Password Required !''')
         elif permission == False:
             wronguserpass.configure(
                 text='''Invalid Username or Password !''')
Example #10
0
def display_page(pathname):
    if pathname == '/time-series':
        return App()
    elif pathname == '/candle-stick':
        return candle_stick_chart()
    else:
        return Homepage()
Example #11
0
def display_page(pathname):
    if pathname == '/dataset':
        return Dataset()
    if pathname == '/dataset_documentation':
        return Dataset_documentation()
    if pathname == '/interactive-graph':
        return InteractiveGraph()
    if pathname == '/projections':
        return ProjectState()
    if pathname == '/projections_documentation':
        return Projections_documentation()
    if pathname == '/policies':
        return Policies()
    if pathname == '/ventilator_allocation':
        return VentilatorAllocations()
    if pathname == '/mortality_calculator':
        return RiskCalc()
    if pathname == '/infection_calculator':
        return InfectionRiskCalc()
    if pathname == '/team':
        return Team()
    if pathname == '/contact':
        return Contact()
    if pathname == '/press':
        return Press()
    if pathname == '/collaborators':
        return Collaborators()
    else:
        return Homepage()
Example #12
0
def display_page(pathname):
    display_type = pathname
    if pathname == '/player-shot-chart':
        return player_app()
    if pathname == '/team-shot-chart':
        return team_app()
    else:
        return Homepage()
Example #13
0
    def __init__(self, *args, **kwargs):
        """
        This is initiation of Layout class which is main class of applicaction. It inheritates from tk.Frame class.
        All app managment happens here, as well as buttons and functionalities shown independently of type of page
        opened.
        """
        tk.Frame.__init__(self, *args, **kwargs)

        # Setting up two frames which are used all the time. The button frame is frame where all of the page buttons
        # are placed. Container is rest of screen. Also, app is made to work properly only on FHD display.
        self.button_frame = tk.Frame(self, height=40)
        self.container = tk.Frame(self, height=1860)
        self.button_frame.pack(anchor='nw', fill="both", expand=True)
        self.container.pack(anchor='nw', fill="both", expand=True)

        # x coord being the point from which page buttons start being placed.
        self.page_but_x = 130

        # Making instance of ttk.Style() is needed to manage some widgets form, such as text size or font type.
        self.style = ttk.Style()
        self.font = 'Segoe'

        # Maximum update time applied for updating all the stuff, such as logs, graphs, data, etc.
        self.update_time = 5000

        # Setting up the homepage, which is an instance of Homepage class. Place it in 'container' at x=0 and y=0, which
        # are actually x=0 and y=40 in whole screen.
        self.homepage = Homepage(update_time=self.update_time)
        self.homepage.place(in_=self.container, x=0, y=0, relwidth=1, relheight=1)

        # Buffor with all pages instances.
        self.pages = []

        # Amount of MQTT clients, which actually is equivalent to amount of pages.
        self.clients = 0

        # Initiation of buttons, adding one page and showing homepage again.
        self.buttons_init()
        self.add_page()
        self.homepage.show()

        # Setting new thread. Thread is a process working independently in the background. With daemon set to True it
        # the thread is killed when app is closed.
        self.loop = threading.Thread(target=self.homepage_update, daemon=True)
        self.loop.start()
Example #14
0
def display_page(pathname):
    #if pathname == '/control_chart':
    #    return app_cc()
    if pathname == '/homepage':
        return Homepage()
    if pathname == '/360-1':
        return sixty_one()
    else:
        return overview_page()
Example #15
0
def display_page(pathname):
    print("JJJJJJJJJJJJ")
    print(pathname)
    if pathname == '/time-series':
        return App()
    elif pathname == '/sensors':
        return SensorApp()
    else:
        return Homepage()
Example #16
0
def display_page(pathname):
    if pathname == '/dash-board':
        return App()
    elif pathname == '/prediction':
        return Prediction()
    elif pathname == '/report':
        return Report()
    else:
        return Homepage()
Example #17
0
def display_page(pathname):
    if pathname == '/Pipe-dreams':
        return AppA()
    if pathname == '/Scattergories':
        return AppB()
    if pathname == '/Interact':
        return AppC()
    else:
        return Homepage()
def display_page(pathname):
    if pathname == '/model':
        return App()
    if pathname == '/Logistic':
        return App1()
    if pathname == '/gbm':
        return App2()
    else:
        return Homepage()
Example #19
0
def display_page(pathname):
    if pathname == '/time-series1':
        return Predictions()
    elif pathname == '/time-series':
        return Trends()
    elif pathname == '/time-series2':
        return Resources()
    else:
        return Homepage()
Example #20
0
def display_page(pathname):
    if pathname == '/time-series':
        return testapp.App()
    elif pathname == '/lab1':
        return lab1app.App()
    elif pathname == '/lab2':
        return lab2app.App()
    elif pathname == '/lab3':
        return lab3app.App()
    else:
        return Homepage()
Example #21
0
def display_page(pathname):
    if pathname == '/credit-accumulation':
        print("initiate accumulation")
        return credit_bargraph_app.CreditBarGraph()
    elif pathname == '/credit-track':
        return CreditPieChart()
    elif pathname == '/attendance-map':
        return AttendanceHeatMap()
    elif pathname == '/regents-map':
        return RegentsScoreHeatMap()
    else:
        return Homepage()
Example #22
0
def display_page(pathname):
    if pathname == '' or pathname == '/' or pathname == config.login_url:
        # print('--> login')
        return Login()
    elif pathname == config.home_url:
        # print('--> home')
        return Homepage()
    elif pathname == config.training_url:
        # print('--> training')
        return Training()
    elif pathname == config.classification_url:
        # print('--> classification')
        return Classification()
Example #23
0
def display_page(pathname):
    if pathname == '/Column1':
        return App1()

    #elif pathname == '/Column2':
    #   print("je vais dans la columns 2")
    #  return App2()
    elif pathname == '/Column3':
        return App3()
    #elif pathname == '/Column4':
    #   return App4()

    else:
        return Homepage()
Example #24
0
def display_page(pathname):
    '''
    This is the main callback of the app.
    It takes the url path as input and returns the corresponding page layout,
    thanks to the instantiation functions built in the various .py files.
    '''

    if pathname == '/alerts':
        return AlertsApp()

    elif pathname == '/risks':
        return RisksApp()

    else:
        return Homepage()
Example #25
0
def display_page(pathname):
    if pathname == '/Plots/state_county_confirmed_line_chart':
        return state_county_confirmed_line_chart.get_layout()
    elif pathname == '/Plots/daily_changes_bar_chart':
        return daily_changes_bar_chart.get_layout()
    elif pathname == '/Plots/us_cases':
        return us_cases.get_layout()
    elif pathname == '/Plots/us_deaths':
        return us_deaths.get_layout()
    elif pathname == '/Plots/state_county_death_line_chart':
        return state_county_death_line_chart.get_layout()
    elif pathname == '/graphs':
        return Graphs()
    else:
        return Homepage()
Example #26
0
def display_page(pathname):
    if pathname == '/':
        return Homepage()
    elif pathname == '/sd':
        return Sd_app()
    elif pathname == '/ttest':
        return ttest_app()
    elif pathname == '/dataVis':
        return dataVis_app()
    elif pathname == '/sig':
        return sig_app()
    else:
        error = dbc.Jumbotron([
            html.H1("404: Not found", className="text-danger"),
            html.Hr(),
            html.P("The pathname was not recognised...")
        ])
        return error
Example #27
0
    def SignToHome():
        ufname = Fnameentry.get()
        ulname =  Lnameentry.get()
        uemail = emailentry.get()
        ugender = gender.get()
        uusername = usernameentry.get()
        upass = passwordentry.get()
        urepass = repasswordentry.get()
        udateofbirth = datebox.get()
        umonthofbirth = monthbox.get()
        uyearofbirth = yearbox.get()
        umobile1 =  mobile1entry.get()
        umobile2 =  mobile2entry.get()
        uhouseno = houseentry.get()
        ustreet = streetentry.get()
        ucity = cityentry.get()
        ucountry = countryentry.get()
        monthnum = monthalpha2num()
        try:
            databasedate = str(uyearofbirth+'-'+monthnum+'-'+udateofbirth)
        except TypeError:
            pass

        userpermission = CheckAvailable()
        passpermission = checkpassword()
        if userpermission == True  and passpermission == True:
            UserTableDetail = ( ufname, ulname, uusername,uemail,upass,ugender,databasedate,uhouseno,ustreet,ucity,ucountry)
            sqlformula = 'insert into Users (fname,lname,username,email,password,gender,dob,houseno,street,city,country) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)'
            mycursor.execute(sqlformula,UserTableDetail)
            mydb.commit()
            sqlformula = 'select uid from users where username = %s'
            mycursor.execute(sqlformula,(uusername,))
            uid = mycursor.fetchall()
            mobilenums = (umobile1,umobile2)
            for i in mobilenums:
                if i != '':
                    contacttabledetails=(uid[0][0],i,)
                    sqlformula = 'insert into ucontact(uid,mobile) values (%s,%s)'
                    mycursor.execute(sqlformula,contacttabledetails)
                    mydb.commit()
            messagebox.showinfo("Congratulations", "Your Account Is Successfully Created, Please setup your devices")
            signuproot.destroy()
            importusername(uusername)
            Homepage()
Example #28
0
def display_page(pathname):
    if pathname == '/interactive-graph':
        return InteractiveGraph()
    if pathname == '/projections':
        return ProjectState()
    if pathname == '/team':
        return Team()
    if pathname == '/contact':
        return Contact()
    if pathname == '/dataset':
        return Dataset()
    if pathname == '/projections_documentation':
        return Projections_documentation()
    if pathname == '/dataset_documentation':
        return Dataset_documentation()
    if pathname == '/ventilator_allocation':
        return VentilatorAllocations()
    if pathname == '/ventilator_allocation_documentation':
        return Ventilator_documentation()
    else:
        return Homepage()
Example #29
0
def display_page(pathname):
    if pathname == '/logreturns':
        return App()
    elif pathname == '/probplot':
        return App1()
    elif pathname == '/histplot':
        return App3()
    elif  pathname =='/effect':
        return App2()
    elif pathname == '/residual':
        return App4()
    elif pathname == '/bestreturn':
        return App5()
    elif pathname == '/compare':
        return App6()
    elif pathname == '/population':
        return App7()
    elif pathname == '/range':
        return App8()
    elif pathname == '/help':
        return Help()
    else:
        return Homepage()
Example #30
0
def display_page(pathname):
    if pathname == '/Plots/state_county_confirmed_line_chart':
        return state_county_confirmed_line_chart.get_layout()
    elif pathname == '/Plots/daily_changes_bar_chart':
        return daily_changes_bar_chart.get_layout()
    elif pathname == '/Plots/us_cases':
        return us_cases.get_layout()
    elif pathname == '/Plots/us_deaths':
        return us_deaths.get_layout()
    elif pathname == '/Plots/state_county_death_line_chart':
        return state_county_death_line_chart.get_layout()
    elif pathname == '/Plots/stocks':
        return stocks.get_layout()
    elif pathname == '/info/about':
        return about.get_layout()
    elif pathname == '/info/what_to_do':
        return what_to_do.get_layout()
    elif pathname == '/effects':
        return Effects()
    elif pathname == '/graphs':
        return Graphs()
    else:
        return Homepage()