Added rudimentary loading of annotation files.

This commit is contained in:
Einar Ryeng 2011-06-02 14:38:01 +00:00
parent bad06e0bb9
commit 1845fe2ba0

View File

@ -4,6 +4,7 @@ import configobj
import time
import dataset
import annotations
NAME = "laydi-cmd"
VERSION = "0.1.0"
@ -279,10 +280,29 @@ class DataDirectory(Directory):
filepath = os.path.join(self.path, fn)
def SelectionDirectory(object):
class SelectionDirectory(object):
def __init__(self, dirname):
pass
class AnnotationDirectory(Directory):
def __init__(self, dirname, project):
self.project = project
self.dirname = dirname
Directory.__init__(self, dirname)
def file_created(self, fn):
print "File created: %s" % fn
annotations.read_annotations_file(os.path.join(self.dirname, fn))
def file_changed(self, fn):
print "File changed: %s" % fn
annotations.read_annotations_file(os.path.join(self.dirname, fn))
def file_removed(self, fn):
print "File removed: %s" % fn
class Project(object):
def __init__(self, dirname):
"""Opens a project directory. The directory must exist and be a valid project."""
@ -298,6 +318,7 @@ class Project(object):
self.universe = Universe()
self.data = DataDirectory(self.datadir, self)
self.annotations = AnnotationDirectory(self.anndir, self)
def update(self):
print "updating project"