-
Notifications
You must be signed in to change notification settings - Fork 0
/
selectProject.py
39 lines (36 loc) · 1.31 KB
/
selectProject.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ===========================================================================
# +++selectProject.py+++|
# ______________________|
#
# Sean Frischmann
# Time Tracker
# ===========================================================================
import sqlite3 as lite
import errors
# ***************************************************************************
# |Display Exisiting Projects|
#
# -The purose of this method is to dispay all existing projects in the
# database.
#
# Variables Passed in:
# -Cursor to Database
# ***************************************************************************
def display_existing_projects(cur):
cur.execute("SELECT Project FROM list_of_projects")
# ***************************************************************************
# |Check Exisiting Projects|
#
# -The purose of this method is to check all existing projects in the
# database.
#
# Variables Passed in:
# -Cursor to Database
# -Selected Project
# ***************************************************************************
def check_existing_projects(cur, project_select):
cur.execute(""" SELECT COUNT(*) FROM
list_of_projects WHERE Project = ? """, (project_select, ))
result = cur.fetchone()
if not result[0]:
raise errors.myError(project_select+' does not exist!')