Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

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
1 changed files with 22 additions and 1 deletions

View File

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