#!/usr/bin/env python """emano schemes - _.py""" import os.path def read(doc, uri): """Handler for relative paths to files.""" if os.path.isfile(uri): f = open(uri) for line in f: doc.append(line) try: if line.endswith('\n'): doc.append('') except: pass f.close() elif os.path.isdir(uri): doc.error = 'Tried to open a directory' else: doc.error = 'No such file: %r' % uri def write(doc, uri): f = open(uri, 'w') f.write(doc.getContent()) f.close() doc.uri = uri doc.rehash() return 'Successfully wrote to %s' % uri if __name__=="__main__": print __doc__