aboutsummaryrefslogtreecommitdiff
path: root/scilo
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunk@stsci.edu>2013-01-15 17:53:33 -0500
committerJoseph Hunkeler <jhunk@stsci.edu>2013-01-15 17:53:33 -0500
commit90049bc82d891f9a7b7da94931896eae03f8b241 (patch)
tree9a4c25e3084aa42d5d1f2e6509ef393f9950c900 /scilo
parent1345ce85e91dc182eb586eb1f316c6bd4a0466b0 (diff)
downloadscilo-90049bc82d891f9a7b7da94931896eae03f8b241.tar.gz
* Added 'self.name' to get name of dataset
* Added calls to cache
Diffstat (limited to 'scilo')
-rw-r--r--scilo/scilo.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/scilo/scilo.py b/scilo/scilo.py
index f984064..8e594bd 100644
--- a/scilo/scilo.py
+++ b/scilo/scilo.py
@@ -17,7 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with scilo. If not, see <http://www.gnu.org/licenses/>.
'''
-import numpy as np
+import numpy
import os
import glob
import npy
@@ -26,9 +26,9 @@ class scilo:
def __init__(self, path):
self.mtimedb = None
self.path = os.path.abspath(path)
+ self.name = os.path.basename(self.path)
self.settings = npy.settings(self.path)
- exit(0)
-
+ print("Loading dataset: %s" % (self.name))
if not os.path.exists(path):
os.mkdir(os.path.abspath(self.settings.path))
for key in self.settings.directories.iterkeys():
@@ -40,6 +40,7 @@ class scilo:
for key in self.settings.directories.iterkeys():
d = os.path.join(self.path, key)
self.settings.directories[key] = d
+ self.cache = npy.cache(**self.settings.directories)
def __getitem__(self, key):
return self.settings.directories[key]
@@ -59,5 +60,6 @@ class scilo:
import shutil
shutil.copy2(src, dest)
self.mtimedb = npy.mtimedb(**self.settings.directories)
+ self.cache.populate()
return True
\ No newline at end of file