async def update_project(project: Project) -> datetime:

    assert project.id
    ret = await ps.update_project(project)
    if _cache_enabled:
        assert _projects is not None
        assert _projects_list is not None
        _projects_list[project.id] = IdDesc(project.id, project.name, project.desc)
        _projects[project.id] = deepcopy(project)
        _projects[project.id].modified = ret
        _projects[project.id].int_modified = None
    return ret
async def update_scene(scene: Scene) -> datetime:

    assert scene.id
    ret = await ps.update_scene(scene)
    if _cache_enabled:
        assert _scenes is not None
        assert _scenes_list is not None
        _scenes_list[scene.id] = IdDesc(scene.id, scene.name, scene.desc)
        _scenes[scene.id] = deepcopy(scene)
        _scenes[scene.id].modified = ret
        _scenes[scene.id].int_modified = None

    return ret
Exemple #3
0
async def update_scene(scene: Scene) -> datetime:

    assert scene.id

    ret = await ps.update_scene(scene)
    scene.modified = ret

    if not scene.created:
        scene.created = scene.modified

    _scenes_list.listing[scene.id] = IdDesc(scene.id, scene.name,
                                            scene.created, scene.modified,
                                            scene.description)
    _scenes[scene.id] = deepcopy(scene)
    _scenes[scene.id].int_modified = None

    return ret
Exemple #4
0
async def update_object_type(object_type: ObjectType) -> datetime:

    assert object_type.id

    ret = await ps.update_object_type(object_type)
    object_type.modified = ret

    if not object_type.created:
        object_type.created = object_type.modified

    _object_type_list.listing[object_type.id] = IdDesc(object_type.id, "",
                                                       object_type.created,
                                                       object_type.modified,
                                                       object_type.description)
    _object_types[object_type.id] = deepcopy(object_type)

    return ret
Exemple #5
0
async def update_project(project: Project) -> datetime:

    assert project.id

    ret = await ps.update_project(project)
    project.modified = ret

    if not project.created:
        project.created = project.modified

    _projects_list.listing[project.id] = IdDesc(project.id, project.name,
                                                project.created,
                                                project.modified,
                                                project.description)
    _projects[project.id] = deepcopy(project)
    _projects[project.id].int_modified = None

    return ret