Skip to content

Commit

Permalink
restructuring bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
privacyrespected committed Jan 19, 2022
1 parent c5694d8 commit 5510b39
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 109 deletions.
Binary file modified db.sqlite3
Binary file not shown.
Binary file not shown.
Binary file removed modules/__pycache__/boot_loader.cpython-36.pyc
Binary file not shown.
Binary file removed modules/__pycache__/boot_message.cpython-36.pyc
Binary file not shown.
Binary file removed modules/__pycache__/boot_noise.cpython-36.pyc
Binary file not shown.
Binary file removed modules/__pycache__/mainsystem.cpython-36.pyc
Binary file not shown.
Binary file removed modules/__pycache__/search.cpython-36.pyc
Binary file not shown.
Binary file removed modules/__pycache__/sense.cpython-36.pyc
Binary file not shown.
Binary file removed modules/__pycache__/weather.cpython-36.pyc
Binary file not shown.
38 changes: 0 additions & 38 deletions modules/boot_checkuserdata.py

This file was deleted.

88 changes: 77 additions & 11 deletions modules/boot_loader.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,84 @@
from sys import modules
from threading import Thread
from modules.boot_noise import *
from modules.boot_message import *
from modules.boot_checkuserdata import checkuserdata
from playsound import playsound
import time
from modules.sense import notify
import random
from modules.sense import speak
import json
from os import path
import datetime

def wishMe(user_gender):
hour = int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning!")

elif hour>=12 and hour<18:
speak("Good Afternoon!")

else:
speak("Good Evening!")

if user_gender=="Male":
speak("I am Alpha! Sir, Please tell me how may I help you")
print("I am Alpha")
else:
speak("I am Alpha! Madam, please tell me how may I help you.")
def wishme2(user_name):
hour=int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning")
speak( user_name)
speak("what are youh planning to do")

elif hour>=12 and hour<18:
speak("Good afternoon, ready to continue work?")
elif hour>18 and hour<22:
speak("Good evening! " )
speak(user_name)
speak("What are you planning to do?")
else:
speak("Good evening!" )
speak(user_name)
speak("How was your day?")


def checkuserdata():
#this file checks for user data
if path.isfile('data.json') == False:
notify("OPPs!","Cant start without data.json, try again",60)
time.sleep(30)
exit()
else:
print("Loading user data.")
try:
with open("data.json", "r") as read_file:
userdata = json.load(read_file)
main_data=userdata["main_user_data"]
user_name=main_data["username"]
usercity=main_data["usercity"]
user_gender=main_data["usergender"]
user_dob=main_data["userdob"]
user_email=main_data["useremail"]
user_email_password=main_data["useremailpass"]
user_species=main_data["userspecies"]
user_bloodtype=main_data["userbloodtype"]
user_skincolor=main_data["userskincolor"]
user_ethnicity=main_data["userethnicity"]
user_religion=main_data["userreligion"]
user_weight=main_data["userweight"]
user_height=main_data["userheight"]
user_sport=main_data["usersport"]
user_hobby=main_data["userhobby"]
user_interest=main_data["userinterest"]
user_discord=main_data["userpersonaldiscordbottoken"]
except Exception as e:
print(e)
notify("OHNO", e, 90)
return user_name, usercity, user_gender,user_dob, user_email,user_email_password, user_species, user_bloodtype,user_skincolor,user_ethnicity


def startup():
user_name=checkuserdata()[0]
user_gender=checkuserdata()[2]
Expand All @@ -13,11 +87,3 @@ def startup():
wishMe(user_gender)
elif int(random_functions) == 2:
wishme2(user_name)
def bootloader(): #only this is meant to be called
try:
Thread(target=startupnoise).start()
Thread(target=startupnoise2).start()
Thread(target=startup()).start()
except Exception as e:
print(e)
notify("OHNO", e, 90)
36 changes: 0 additions & 36 deletions modules/boot_message.py

This file was deleted.

24 changes: 0 additions & 24 deletions modules/boot_noise.py

This file was deleted.

0 comments on commit 5510b39

Please sign in to comment.