Exemplo n.º 1
0
def boot_system():
    # Sets up the hardware manager
    global Manager
    addresses = get_addresses()
    Manager = Management(addresses)
    Manager.power_on()
    #time.sleep(7)
    return
Exemplo n.º 2
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec. 28 12:25:00 2019

@author: munaib al-helali

This is the main driver of the system. It is reponsible for controlling
and cooredinating  the tasks throughout the operation of the system """

from management import Management
from view import View
import os
current_user = None
if __name__ == "__main__":
    manager = Management()
    viewer = View(manager)
    while True:
        os.system('clear')
        #ask the user to login or create a new account
        success, user = manager.login()
        #check if the user successfully loged-in
        if success:
            current_user = user
            if user.is_system_admin():
                pass
            #first thing to be displayed is the user's timeline
            viewer.view_page(
                manager.database.pages[current_user.get_timeline()])
            while True:
                #give the user the option to brows availalble pages/groups
 def __init__(self):
     self.manage = Management()
     self.stud = Student()
class Main():
    def __init__(self):
        self.manage = Management()
        self.stud = Student()

    def mainpage(self):
        try:

            animation = "✒✔༼ つ ◕_◕ ༽つ|/-\\"
            for i in range(25):
                time.sleep(0.1)
                sys.stdout.write("\r" + animation[i % len(animation)])
                sys.stdout.flush()
            print("""
----------------------------------------------
----------------------------------------------
---------COLLEGE MANAGEMENT SYSTEM------------
----------------------------------------------
----------------------------------------------
            """)

            option = int(
                input("""            
Choose an Option :
1 -- >  Management
2 -- >  Student
3 -- >  Teacher
4 -- >  Exit
Enter : """))
            if option == 1:
                self.managementpage()
                #print("Management")
            if option == 2:
                pass
                #self.studentpage()
                #print("Student")
            if option == 3:
                #self.teacherpage()
                print("Teachet")
            if option == 4:
                print(" ")
            else:
                print("Choose within the options provided : ")
        except Exception:
            print("\nOption should be number only\n")
            self.mainpage()
        finally:
            pass

# management page

    def managementpage(self):
        auth = self.manage._authorize()
        if auth == True:
            try:
                print("""
----------------------------------
----------------------------------
-----------WELCOME TO-------------
-----------MANAGEMENT-------------
-------------PANEL----------------  
----------------------------------
----------------------------------
        """)
                self.option1 = int(
                    input("""            
Choose an Option :
1 -- >  FACULTY
2 -- >  STUDENT
3 -- >  CURRICULUM
4 -- >  ADMISSION
5 -- >  EXIT
Enter : """))
                if self.option1 == 1:
                    self.faculty()
                    self.managementpage()
                if self.option1 == 2:
                    self.student()
                    self.managementpage()
                if self.option1 == 3:
                    self.curriculam()
                    self.managementpage()
                if self.option1 == 4:
                    self.admission()
                    self.managementpage()
                if self.option1 == 5:
                    self.mainpage()
                if self.option1 > 5:
                    print("Select Otions Withon the range")
                    self.managementpage()

            except ValueError:
                print("Option should be entered in number only within range")
            finally:
                pass

# FACULTY Done With all check

    def faculty(self):
        try:
            if self.option1 == 1:
                option2 = int(
                    input("""            
Choose an Option :
    FACULTY
1 -- >  ADD FACULTY
2 -- >  VIEW FACULTY
3 -- >  DELETE FACULTY
4 -- >  EXIT
Enter : """))
                if option2 == 1:
                    self.manage.addteachers()
                    self.faculty()
                elif option2 == 2:
                    self.manage.view_faculty()
                    self.faculty()
                elif option2 == 3:
                    self.manage.deletefaculty()
                    self.faculty()
                elif option2 == 4:
                    self.managementpage()

                else:
                    print("Option Entered is out of range")
                    self.faculty()
        except ValueError:
            print("Option should be entered only in numbers")

# STUDENT

    def student(self):
        try:
            if self.option1 == 2:
                option2 = int(
                    input("""            
Choose an Option :
    STUDENT
1 -- >  VIEW STUDENT
2 -- >  EXIT
Enter : """))
                if option2 == 1:
                    self.manage.viewstudent()
                    self.student()
                if option2 == 2:
                    self.managementpage()
                else:
                    print("Option Entered is out of range")
                    self.student()
        except ValueError:
            print("Option should be entered only in numbers")

# Curriculam

    def curriculam(self):
        try:
            option = int(
                input("""
------------------------
SELECT AN OPTION
1 --> VIEW TIME TABLE
2 --> UPDATE TIME TABLE 
3 --> VIEW EVENTS
4 --> UPDATE EVENTS
5 --> EXIT
------------------------

:"""))
            if option == 1:
                self.manage.viewtimetable()
                self.curriculam()
            if option == 2:
                self.manage._timetable()
                self.curriculam()
            if option == 3:
                self.manage.showevent()
                self.curriculam()
            if option == 4:
                self.manage.updateevent()
                self.curriculam()
            if option == 5:
                self.mainpage()
            if option > 5:
                print("Choose Within the option")
                self.curriculam()
        except ValueError:
            print("Choose from the option only")
        finally:
            pass


# Admission module

    def admission(self):
        try:
            option = int(
                input("""
----------------------------------
----------------------------------
--------ADMISSION PORTAL----------
----------------------------------
----------------------------------
1 -- > NEW REGISTER
2 -- > VIEW REGISTERED STUDENT
3 -- > DO THE ADMIISON PROCESS 
4 -- > EXIT
 >>: """))
            if option == 1:
                self.manage.register()
                self.managementpage()
            if option == 2:
                self.manage.view_registeredstudent()
                self.managementpage()
            if option == 3:
                self.manage.admission()
                self.managementpage()
            if option == 4:
                self.managementpage()
            if option > 4:
                print("Select options within the range ")
                self.admission()
        except ValueError:
            print("Enter option in numbers")
Exemplo n.º 5
0
def print_top_menu():
    print("Please choose from the following menu options:")
    print("To manage customers, type 1")
    print("To manage videos, type 2")
    print("To manage rentals, type 3")
    print("To quit, type 4")


MANAGE_CUSTOMERS = 1
MANAGE_VIDEOS = 2
MANAGE_RENTALS = 3
QUIT = 4

rental = Rental()
management = Management()


def main():
    while (True):
        print_intro()
        print_top_menu()
        choice = get_valid_input(int, range(1, 5))
        if choice == QUIT:
            break
        elif choice == MANAGE_RENTALS:
            rental.menu()
        elif choice == MANAGE_CUSTOMERS or choice == MANAGE_VIDEOS:
            management.menu(choice)

    print("Goodbye!")
Exemplo n.º 6
0
for i in range(len(codecool_bp.students)):
    print('  ', codecool_bp.students[i].full_name)
input()
print(
    "\nMentors arrive at school. They welcome students with a cheery smile\n")
input()
codecool_bp.mentors[1].check_energy_level(codecool_bp.students)
input()
codecool_bp.mentors[0].check_mood(codecool_bp.students)
input()
codecool_bp.students[3].use_EKI(codecool_bp.EKI_list[7])
input()
code = Code(215, "Fakkin' Hard Shit")
code.get_worked_on(codecool_bp.students[1])
input()
codecool_bp.students[3].use_EKI(codecool_bp.EKI_list[10])
input()
creepy = Management("Creepy", "Guy", 0, "male", 0, True)
creepy.creeping(codecool_bp.mentors, codecool_bp.students)
input()
coffeemachine = CoffeeMachine(70, 0, True, True)
coffeemachine.make_coffee()
input()
coffeemachine.get_filled_water()
input()
coffeemachine.make_coffee()
boda = Management("Boda", "Józsi", 0, "male", 0, True)
boda.change_life(codecool_bp.mentors, codecool_bp.students)
input()
print("Happy End")
print('\nStudents:')
for i in range(len(codecool_bp.students)):
    print('  ', codecool_bp.students[i].full_name)
input()
print("\nMentors arrive at school. They welcome students with a cheery smile\n")
input()
codecool_bp.mentors[1].check_energy_level(codecool_bp.students)
input()
codecool_bp.mentors[0].check_mood(codecool_bp.students)
input()
codecool_bp.students[3].use_EKI(codecool_bp.EKI_list[7])
input()
code = Code(215, "Fakkin' Hard Shit")
code.get_worked_on(codecool_bp.students[1])
input()
codecool_bp.students[3].use_EKI(codecool_bp.EKI_list[10])
input()
creepy = Management("Creepy", "Guy", 0, "male", 0, True)
creepy.creeping(codecool_bp.mentors, codecool_bp.students)
input()
coffeemachine = CoffeeMachine(70, 0, True, True)
coffeemachine.make_coffee()
input()
coffeemachine.get_filled_water()
input()
coffeemachine.make_coffee()
boda = Management("Boda", "Józsi", 0, "male", 0, True)
boda.change_life(codecool_bp.mentors, codecool_bp.students)
input()
print ("Happy End")
Exemplo n.º 8
0
 def __init__(self):
     self.manage = Management()
Exemplo n.º 9
0
class Student(DataBase):
    def __init__(self):
        self.manage = Management()

    def viewFaculty(self):
        self.manage.view_faculty()