-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (26 loc) · 1.04 KB
/
main.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
"""The root file of the program"""
from src.archive import Archive
if __name__ == '__main__':
archive = Archive()
archive.connect()
archive.reset()
try:
period = archive.new_category('Period')
beginning = period.new_property('Beginning')
end = period.new_property('End')
archive.add_order_rule(end, beginning)
episode4 = archive.new_document('Star Wars Episode IV: A New Hope')
civil_war = archive.new_element(period)
episode4.declare_description(civil_war, 'It is a period of civil war.')
rebel_victory = archive.new_element(period)
episode4.declare_description(
rebel_victory,
'Rebel spaceships, striking from a hidden base, have won their first'
' victory against the evil Galactic Empire.',
)
episode4.declare_order(archive.point(4), archive.point(1))
episode4.declare_order(archive.point(2), archive.point(5))
archive.analyze_rules()
finally:
archive.commit()
archive.close()