Skip to content

Commit

Permalink
privatize RcdbEntry.add
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Baltzell committed May 7, 2019
1 parent 5d7621d commit 4abedaa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/RcdbManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def __init__(self,run):
self.run = run
self.data={}

def add(self,key,val):
def _add(self,key,val):
self.data[key] = val

def get(self,key):
Expand All @@ -32,6 +32,7 @@ def __init__(self):
self.rcdb=True
except:
print 'WARNING: Failure to load RCDB python module from PYTHONPATH.'
self.rcdb=False
def _loadRun(self,run):
entry = RcdbEntry(run)
import rcdb
Expand All @@ -41,9 +42,9 @@ def _loadRun(self,run):
print traceback.format_exc()
sys.exit('***\n*** ERROR: Could not connect to '+self._uri+'\n***')
try:
entry.add('solenoid_scale',db.get_condition(run,'solenoid_scale').value)
entry.add('torus_scale' ,db.get_condition(run,'torus_scale').value)
entry.add('run_start_time',db.get_condition(run,'run_start_time').value)
entry._add('solenoid_scale',db.get_condition(run,'solenoid_scale').value)
entry._add('torus_scale' ,db.get_condition(run,'torus_scale').value)
entry._add('run_start_time',db.get_condition(run,'run_start_time').value)
except:
print traceback.format_exc()
db.disconnect()
Expand All @@ -52,7 +53,7 @@ def _loadRun(self,run):
self.data[run] = entry

def getEntry(self,run):
assert(self.rcdb),'Trying to use nonexistent RCBD module.'
assert(self.rcdb),'***\n*** ERROR: Trying to use nonexistent RCBD module.\n***'
if run not in self.data:
self._loadRun(run)
return self.data[run]
Expand Down

0 comments on commit 4abedaa

Please sign in to comment.