-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathconf.py
71 lines (66 loc) · 2.29 KB
/
conf.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
69
70
71
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
project = "python-arango"
copyright = "2016-2025, Joohwan Oh"
author = "Joohwan Oh"
extensions = [
"sphinx_rtd_theme",
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.viewcode",
]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
html_static_path = ["static"]
html_theme = "sphinx_rtd_theme"
master_doc = "index"
# Set canonical URL from the Read the Docs Domain
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "docs.python-arango.com")
autodoc_member_order = "bysource"
doctest_global_setup = """
from arango import ArangoClient
# Initialize the ArangoDB client.
client = ArangoClient()
# Connect to "_system" database as root user.
sys_db = client.db('_system', username='root', password='passwd')
# Create "test" database if it does not exist.
if not sys_db.has_database('test'):
sys_db.create_database('test')
# Ensure that user "johndoe@gmail.com" does not exist.
if sys_db.has_user('johndoe@gmail.com'):
sys_db.delete_user('johndoe@gmail.com')
# Connect to "test" database as root user.
db = client.db('test', username='root', password='passwd')
# Create "students" collection if it does not exist.
if db.has_collection('students'):
db.collection('students').truncate()
else:
db.create_collection('students')
# Ensure that "cities" collection does not exist.
if db.has_collection('cities'):
db.delete_collection('cities')
# Create "school" graph if it does not exist.
if db.has_graph("school"):
school = db.graph('school')
else:
school = db.create_graph('school')
# Create "teachers" vertex collection if it does not exist.
if school.has_vertex_collection('teachers'):
school.vertex_collection('teachers').truncate()
else:
school.create_vertex_collection('teachers')
# Create "lectures" vertex collection if it does not exist.
if school.has_vertex_collection('lectures'):
school.vertex_collection('lectures').truncate()
else:
school.create_vertex_collection('lectures')
# Create "teach" edge definition if it does not exist.
if school.has_edge_definition('teach'):
school.edge_collection('teach').truncate()
else:
school.create_edge_definition(
edge_collection='teach',
from_vertex_collections=['teachers'],
to_vertex_collections=['lectures']
)
"""