-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcommunication_file.py
45 lines (37 loc) · 1.15 KB
/
communication_file.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
# Represents a Markdown file containing communications like email or chat.
import sys
sys.path.insert(1, './')
import md_frontmatter
import md_body
import md_file
# communication tags
TAG_CHAT = "chat"
TAG_EMAIL = "email"
TAG_PHONE = "phone"
TAG_CALL = "call"
Tags = [TAG_CHAT, TAG_EMAIL, TAG_PHONE, TAG_CALL]
# fields in a communication Markdown files
FIELD_PEOPLE = "people"
FIELD_SERVICE = "service"
FIELD_TOPIC = "topic"
FIELD_DATE = "date"
FIELD_TIME = "time"
Fields = [FIELD_PEOPLE, FIELD_TOPIC, FIELD_DATE, FIELD_TIME, FIELD_SERVICE]
class CommunicationFrontmatter(md_frontmatter.Frontmatter):
def __init__(self, parent):
super().__init__(parent)
self.parent = parent
self.tags.extend(Tags)
self.fields.extend(Fields)
self.raw = ""
class CommunicationBody(md_body.Body):
def __init__(self, parent):
super().__init__(parent)
self.parent = parent
self.raw = ""
class CommunicationFile(md_file.File):
def __init__(self):
super().__init__()
self.frontmatter = CommunicationFrontmatter(self)
self.frontmatter.init_fields()
self.body = CommunicationBody(self)