-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.py
69 lines (50 loc) · 1.23 KB
/
functions.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from datetime import datetime
from my_database import Database
class JournalEntry:
def create_entry(self, args):
"""
Add entry to the Journal Entry
Args:
entry - string containing the journal entry
title - string containing the title of your journal
"""
body = (" ".join(args['<entry>']))
title = raw_input('Title: ')
title = title.upper()
obj = Database()
obj.data_entry(title, body)
print 'Journal entry added successfully'
def search_text(self, args):
"""
Search for a specific journal entry
Args:
variable - String you want to search for
"""
obj = Database()
obj.search_text(args)
def search_date(self, search_criteria):
"""
Search for a specific journal entry
Args:
variable - String you want to search for
"""
obj = Database()
obj.search_date(search_criteria)
def search_both(self, search_criteria):
"""
Search for a journal using both date and text
"""
obj = Database()
obj.search_both(search_criteria)
def open(self, args):
obj = Database()
obj.open(args)
def open_all(self, args):
obj = Database()
obj.open_all(args)
def delete(self, args):
"""
Deletes a journal entry that contains certain text
"""
obj = Database()
obj.delete(args)