Commit 0ea71b0e authored by alexjubs's avatar alexjubs
Browse files

parser progress

parent 9484100a
......@@ -8,13 +8,17 @@ insert_entry_parser.add_argument(
"--table",
dest="table",
choices=[
"courseInfo",
"assessments",
"studentAssessment",
"courseOfferings",
"studentInfo",
"region",
"educationLevel",
"vle",
"studentUnregistration",
"studentRegistration",
"studentAssessment",
"studentVle",
"assessments",
"courses",
"vle"
"studentVle"
],
help="specify the table to perform CRUD on",
required=True
......@@ -26,13 +30,17 @@ modify_table_parser.add_argument(
"--table",
dest="table",
choices=[
"courseInfo",
"assessments",
"studentAssessment",
"courseOfferings",
"studentInfo",
"region",
"educationLevel",
"vle",
"studentUnregistration",
"studentRegistration",
"studentAssessment",
"studentVle",
"assessments",
"courses",
"vle"
"studentVle"
],
help="specify the table to perform CRUD on",
required=True
......@@ -44,13 +52,17 @@ delete_row_parser.add_argument(
"--table",
dest="table",
choices=[
"courseInfo",
"assessments",
"studentAssessment",
"courseOfferings",
"studentInfo",
"region",
"educationLevel",
"vle",
"studentUnregistration",
"studentRegistration",
"studentAssessment",
"studentVle",
"assessments",
"courses",
"vle"
"studentVle"
],
help="specify the table to perform CRUD on",
required=True
......
......@@ -2,16 +2,6 @@ from client_jubs.getattributes import courseInfo_attributes
from parser import *
options = [
"insert-entry",
"modify-row",
"delete-row",
"get-courses",
"get-assessments",
"get-vle",
"get-students"
]
new_options = [
"insert",
"modify",
"delete",
......@@ -44,7 +34,7 @@ def handle_errors(command):
return False
def insert_entry(command):
def insert(command):
insert_entry_args = insert_entry_parser.parse_args(command[1:])
# branch based on the table
......@@ -84,21 +74,18 @@ def insert_entry(command):
pass
def modify_table(command):
def modify(command):
modify_table_args = modify_table_parser.parse_args(command[1:])
# branch based on the table
if modify_table_args.table == "courseInfo":
attr = courseInfo_attributes()
course_id = input("course_id (PK): ")
course_code = input("new course_code: ")
course_description = input("new course_description: ")
elif modify_table_args.table == "assessments":
pass
elif modify_table_args.table == "studentAssessment":
pass
......@@ -129,7 +116,7 @@ def modify_table(command):
elif modify_table_args.table == "studentUnregistration":
pass
def delete_row(command):
def delete(command):
delete_row_args = delete_row_parser.parse_args(command[1:])
# branch based on the table
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment