mirror of
https://github.com/Rushilwiz/SkoolOS.git
synced 2025-04-16 02:10:19 -04:00
formatting test
This commit is contained in:
parent
2ff0cc1a14
commit
00820e6d20
56
skoolos.py
56
skoolos.py
|
@ -97,8 +97,8 @@ def main():
|
||||||
def studentCLI(user, password):
|
def studentCLI(user, password):
|
||||||
"""
|
"""
|
||||||
The CLI for students to access
|
The CLI for students to access
|
||||||
:param user: student username
|
@param user: student username
|
||||||
:param password: student password
|
@param password: student password
|
||||||
"""
|
"""
|
||||||
from CLI import student
|
from CLI import student
|
||||||
data = getUser(user, password, 'student')
|
data = getUser(user, password, 'student')
|
||||||
|
@ -116,7 +116,7 @@ def studentCLI(user, password):
|
||||||
def chooseClassStudent(student):
|
def chooseClassStudent(student):
|
||||||
"""
|
"""
|
||||||
Chooses a class for a student to view and work on
|
Chooses a class for a student to view and work on
|
||||||
:param student: a student
|
@param student: a student
|
||||||
:return: a course prompt
|
:return: a course prompt
|
||||||
"""
|
"""
|
||||||
carray = student.sclass.split(",")
|
carray = student.sclass.split(",")
|
||||||
|
@ -142,8 +142,8 @@ def classOptionsStudent(student, course):
|
||||||
"""
|
"""
|
||||||
Allows students to choose what they want to do related to a class
|
Allows students to choose what they want to do related to a class
|
||||||
The student can save, exit, or go back
|
The student can save, exit, or go back
|
||||||
:param student: a student
|
@param student: a student
|
||||||
:param course: a course
|
@param course: a course
|
||||||
:return: True if exiting, False if going back
|
:return: True if exiting, False if going back
|
||||||
"""
|
"""
|
||||||
student.viewClass(course)
|
student.viewClass(course)
|
||||||
|
@ -203,8 +203,8 @@ def classOptionsStudent(student, course):
|
||||||
def teacherCLI(user, password):
|
def teacherCLI(user, password):
|
||||||
"""
|
"""
|
||||||
The CLI for teachers to access
|
The CLI for teachers to access
|
||||||
:param user: teachers username
|
@param user: teachers username
|
||||||
:param password: teachers password
|
@param password: teachers password
|
||||||
"""
|
"""
|
||||||
from CLI import teacher
|
from CLI import teacher
|
||||||
data = getUser(user, password, 'teacher')
|
data = getUser(user, password, 'teacher')
|
||||||
|
@ -460,9 +460,9 @@ def viewStudentsTeacher(teacher, course):
|
||||||
def getUser(ion_user, password, utype):
|
def getUser(ion_user, password, utype):
|
||||||
"""
|
"""
|
||||||
Returns user information
|
Returns user information
|
||||||
:param ion_user: user
|
@param ion_user: user
|
||||||
:param password: user's password
|
@param password: user's password
|
||||||
:param utype: type of user (student or teacher
|
@param utype: type of user (student or teacher
|
||||||
:return: api user information
|
:return: api user information
|
||||||
"""
|
"""
|
||||||
if 'student' in utype:
|
if 'student' in utype:
|
||||||
|
@ -490,10 +490,10 @@ def getUser(ion_user, password, utype):
|
||||||
def patchDB(USER, PWD, url, data):
|
def patchDB(USER, PWD, url, data):
|
||||||
"""
|
"""
|
||||||
Sends a PATCH request to url
|
Sends a PATCH request to url
|
||||||
:param USER: username
|
@param USER: username
|
||||||
:param PWD: password
|
@param PWD: password
|
||||||
:param url: URL for request
|
@param url: URL for request
|
||||||
:param data: data to request
|
@param data: data to request
|
||||||
:return: json request response
|
:return: json request response
|
||||||
"""
|
"""
|
||||||
r = requests.patch(url=url, data=data, auth=(USER, PWD))
|
r = requests.patch(url=url, data=data, auth=(USER, PWD))
|
||||||
|
@ -504,9 +504,9 @@ def patchDB(USER, PWD, url, data):
|
||||||
def getDB(USER, PWD, url):
|
def getDB(USER, PWD, url):
|
||||||
"""
|
"""
|
||||||
Sends a GET request to url
|
Sends a GET request to url
|
||||||
:param USER: username
|
@param USER: username
|
||||||
:param PWD: password
|
@param PWD: password
|
||||||
:param url: URL for request
|
@param url: URL for request
|
||||||
:return: json request response
|
:return: json request response
|
||||||
"""
|
"""
|
||||||
r = requests.get(url=url, auth=(USER, PWD))
|
r = requests.get(url=url, auth=(USER, PWD))
|
||||||
|
@ -517,10 +517,10 @@ def getDB(USER, PWD, url):
|
||||||
def postDB(USER, PWD, url, data):
|
def postDB(USER, PWD, url, data):
|
||||||
"""
|
"""
|
||||||
Sends a POST request to url
|
Sends a POST request to url
|
||||||
:param USER: username
|
@param USER: username
|
||||||
:param PWD: password
|
@param PWD: password
|
||||||
:param url: URL for request
|
@param url: URL for request
|
||||||
:param data: data to request
|
@param data: data to request
|
||||||
:return: json request response
|
:return: json request response
|
||||||
"""
|
"""
|
||||||
r = requests.post(url=url, data=data, auth=(USER, PWD))
|
r = requests.post(url=url, data=data, auth=(USER, PWD))
|
||||||
|
@ -531,10 +531,10 @@ def postDB(USER, PWD, url, data):
|
||||||
def putDB(USER, PWD, url, data):
|
def putDB(USER, PWD, url, data):
|
||||||
"""
|
"""
|
||||||
Sends a PUT request to url
|
Sends a PUT request to url
|
||||||
:param USER: username
|
@param USER: username
|
||||||
:param PWD: password
|
@param PWD: password
|
||||||
:param url: URL for request
|
@param url: URL for request
|
||||||
:param data: data to request
|
@param data: data to request
|
||||||
:return: json request response
|
:return: json request response
|
||||||
"""
|
"""
|
||||||
r = requests.put(url=url, data=data, auth=(USER, PWD))
|
r = requests.put(url=url, data=data, auth=(USER, PWD))
|
||||||
|
@ -545,9 +545,9 @@ def putDB(USER, PWD, url, data):
|
||||||
def delDB(USER, PWD, url):
|
def delDB(USER, PWD, url):
|
||||||
"""
|
"""
|
||||||
Sends a DELETE request to url
|
Sends a DELETE request to url
|
||||||
:param USER: username
|
@param USER: username
|
||||||
:param PWD: password
|
@param PWD: password
|
||||||
:param url: URL for request
|
@param url: URL for request
|
||||||
:return: json request response
|
:return: json request response
|
||||||
"""
|
"""
|
||||||
r = requests.delete(url=url, auth=(USER, PWD))
|
r = requests.delete(url=url, auth=(USER, PWD))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user