-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
44 lines (39 loc) · 1.75 KB
/
config.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
###############################################################################
## VisTrails wrapper for DataONE
## By David Koop, [email protected]
##
## Copyright (C) 2012-2013, NYU-Poly.
###############################################################################
#== MN/CN client globals ======================================================
try:
from core.configuration import ConfigurationObject
configuration = ConfigurationObject(cn_url=(None, str),
mn_url=(None, str),
cert_file="/tmp/x509up_u501",
key_file="/tmp/x509up_u501",
anonymous=True,
format=(None, str),
submitter=(None, str),
owner=(None, str),
orig_mn=(None, str),
auth_mn=(None, str),
checksum_alg="SHA-1",
)
except ImportError:
class D1ConfigurationObject(object):
def __init__(self):
self.cn_url = None
self.mn_url = None
self.cert_file = "/tmp/x509up_u501"
self.key_file = "/tmp/x509up_u501"
self.anonymous = True
self.format = None
self.submitter = None
self.owner = None
self.orig_mn = None
self.auth_mn = None
self.checksum_alg = "SHA-1"
def check(self, attr):
if hasattr(self, attr) and getattr(self, attr) is not None:
return True
configuration = D1ConfigurationObject()