示例#1
0
 def _on_fs_modify(self, evt):
     fs_node = evt.fs_node
     
     if fs_util.is_object(fs_node):
         obj = self.get_object(fs_node.uuid, fs_util.get_object_clazz_name(fs_node))
         if obj:            
             self.project.ref_manager.update_references(obj, obj.get_refs())
         else:
             log.error('fs_node not in object manager: %s' % fs_node)
示例#2
0
    def _create_object(self, fs_node, verify=True):
        clazz_name = fs_util.get_object_clazz_name(fs_node)
        if not clazz_name:
            raise Exception('clazz name not found in fs_node: %s', fs_node.uuid)

        clazz = self.project.type_manager.get_clazz_by_name(clazz_name)
        if not clazz:
            raise Exception('%s Class "%s" not found: %s' % (self.project.name, clazz_name, fs_node.uuid))
            
        object_ = Object(self.project, clazz, fs_node.uuid, fs_node.data['data'])
        if verify:
            # todo: how to deal with verify result?
            object_.verify()
            
        return object_
示例#3
0
 def get_object_by_fsfile(self, fs_file):
     return self.get_object(fs_file.uuid, fs_util.get_object_clazz_name(fs_file))
示例#4
0
 def get_object_by_fsfile(self, fs_file):
     return self.get_object(fs_file.uuid,
                            fs_util.get_object_clazz_name(fs_file))