Moved User and UserController to a new module from web.

This commit is contained in:
Relintai 2022-07-07 23:25:08 +02:00
parent f47536b834
commit e6e8de0cc5
11 changed files with 104 additions and 8 deletions

24
modules/users/SCsub Normal file
View File

@ -0,0 +1,24 @@
import os
Import('env')
module_env = env.Clone()
sources = [
"register_types.cpp",
"users/user.cpp",
]
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':
# Shared lib compilation
module_env.Append(CCFLAGS=['-fPIC'])
module_env['LIBS'] = []
shared_lib = module_env.SharedLibrary(target='#bin/users', source=sources)
shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0]
env.Append(LIBS=[shared_lib_shim])
env.Append(LIBPATH=['#bin'])
else:
# Static compilation
module_env.add_source_files(env.modules_sources, sources)

18
modules/users/config.py Normal file
View File

@ -0,0 +1,18 @@
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"User",
]
def get_doc_path():
return "doc_classes"

View File

@ -0,0 +1,34 @@
/*
Copyright (c) 2022 Péter Magyar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "register_types.h"
//#include "core/engine.h"
#include "users/user.h"
void register_users_types() {
ClassDB::register_class<User>();
}
void unregister_users_types() {
}

View File

@ -0,0 +1,28 @@
#ifndef USERS_REGISTER_TYPES_H
#define USERS_REGISTER_TYPES_H
/*
Copyright (c) 2022 Péter Magyar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
void register_users_types();
void unregister_users_types();
#endif

View File

@ -48,8 +48,6 @@ sources = [
"nodes/paged_article/paged_article.cpp",
"nodes/paged_article/paged_articles.cpp",
#"nodes/paged_article/paged_articles_md_index.cpp",
"nodes/users/user.cpp",
]
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':

View File

@ -64,8 +64,6 @@ def get_doc_classes():
"PagedArticle",
"PagedArticles",
"PagedArticlesMDIndex",
"User",
]

View File

@ -57,8 +57,6 @@ SOFTWARE.
#include "nodes/paged_article/paged_articles.h"
//#include "nodes/paged_article/paged_articles_md_index.h"
#include "nodes/users/user.h"
void register_web_types() {
ClassDB::register_class<_HTMLBuilder>();
ClassDB::register_class<_HTMLTag>();
@ -111,8 +109,6 @@ void register_web_types() {
ClassDB::register_class<PagedArticle>();
ClassDB::register_class<PagedArticles>();
//ClassDB::register_class<PagedArticlesMDIndex>();
ClassDB::register_class<User>();
}
void unregister_web_types() {