Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ParadigmFileHandler(FileHandler):
- path = cns.PAR_PATH
- wildcard = cns.PAR_WILDCARD
- name = 'paradigm'
- def init(self, info):
- #self.install_menu(info)
- pass
- def install_menu(self, info):
- print 'installing'
- actions = [Action(name='Load paradigm', action='load_file'),
- Action(name='Save paradigm', action='save_file'),
- Action(name='Save as paradigm', action='saveas_file'),
- #Action(name='New paradigm', action='create_paradigm'),
- ]
- info.ui.view.menubar = MenuBar(Menu(*actions, name='File'))
- #info.ui.modified = True
- info.ui.updated = True
- def load_object(self, file, info):
- with open(file, 'rb') as fh:
- info.object.paradigm = pickle.load(fh)
- def save_object(self, file, info):
- with open(file, 'wb') as fh:
- pickle.dump(info.object.paradigm, fh, -1)
- def object_modified(self, info):
- return info.object.paradigm._modified
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement