-
Notifications
You must be signed in to change notification settings - Fork 0
/
Colin.py
102 lines (76 loc) · 2.25 KB
/
Colin.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
"""
Suggested reading (or thinking).
Large Files
http://stackoverflow.com/questions/728118/python-downloading-a-large-file-to-a-local-path-and-setting-custom-http-headers?rq=1
Being able to restart read or write without starting over.
http://stackoverflow.com/questions/5064879/how-to-download-large-file-with-binary-mode-in-python
Suggested don't worry about.
Internal data organization,
What the written file looks like. Act like it is a long string of bytes.
"""
class Data:
"""
A base class for CoMPLICATD data objects
"""
Addama = 1
S3 = 2
Local = 3
def __init__(self, synid=None, data_uri):
"""
Create data object storing the synapse id. Id is none if
"""
self.synid = synid
self.data_uri = None
def write(self, data_pref)
def _writeToAddama(self, addama_dir):
"""
Take the current data obj,
"""
def _discoverLocation(self, uri):
"""
From the uri, returns where the data is stored as class variable
Data.Addama
Data.S3
Data.Local
"""
def getData(self, local_cache):
"""
Retrieves data from data_uri and stores it in the local cache.
"""
def _toFile(self):
"""
returns a file type object that can be stored.
i.e. don't worry about this. Will be overrridden
"""
pass
def _fromFile(self,filepath, filename):
"""
Given a local path and filename, returns useable data object
"""
pass
class CommHandler:
"""
Base class for handling communications with external data stores.
"""
def __init__(self):
pass
def writeFile(self, myfile, uri):
raise Exception("CommHandler is an abstract base class.")
def readFile(self, uri):
raise Exception("CommHandler is an abstract base class.")
class AddamaHandler(CommHandler):
def __init__(self, apicrap):
"""
Read auth settings from file
"""
pass
def _handleAuth(self):
pass
class S3Handler(CommHandler):
def __init__(self, apicrap):
"""
Read auth settings from file
"""
pass
def _handleAuth(self):
pass