web-framework-api 1.0.6__tar.gz → 3.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ cmake_minimum_required(VERSION 3.27.0)
2
+
3
+ project(python_api VERSION 3.1.0)
@@ -1,13 +1,37 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.2
2
2
  Name: web_framework_api
3
- Version: 1.0.6
3
+ Version: 3.1.0
4
4
  Summary: Python API for WebFramework
5
- Project-URL: Repository, http://github.com/LazyPanda07/WebFramework
6
- Project-URL: Wiki, http://github.com/LazyPanda07/WebFramework/wiki
7
- Author-email: LazyPanda07 <semengricenko@gmail.com>
8
- Maintainer-email: LazyPanda07 <semengricenko@gmail.com>
9
5
  Keywords: Web
6
+ Author-Email: LazyPanda07 <semengricenko@gmail.com>
7
+ Maintainer-Email: LazyPanda07 <semengricenko@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2020 Semyon Gritsenko
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Classifier: Programming Language :: Python :: 3
10
31
  Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Operating System :: OS Independent
33
+ Project-URL: Repository, http://github.com/LazyPanda07/WebFramework
34
+ Project-URL: Wiki, http://github.com/LazyPanda07/WebFramework/wiki
11
35
  Requires-Dist: multipledispatch
12
36
  Requires-Dist: requests
13
37
  Requires-Dist: tqdm
@@ -28,8 +52,8 @@ C++ HTTP/HTTPS server with Python API
28
52
  Server needs few files to run:
29
53
  * [web.json](#settings) with routes
30
54
  * [Executors](#executors)
31
- * [Windows](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/windows.zip)
32
- * [Linux](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/linux.zip)
55
+ * [Windows](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_windows.zip)
56
+ * [Linux](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_linux.zip)
33
57
  * [config.json](#config) with server settings
34
58
  All these files must be in the same directory as ```main.py```
35
59
 
@@ -161,5 +185,5 @@ More information you can find in [wiki](https://github.com/LazyPanda07/WebFramew
161
185
 
162
186
  ### Hello executor
163
187
  * Links
164
- * [Windows](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/windows.zip)
165
- * [Linux](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/linux.zip)
188
+ * [Windows](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_windows.zip)
189
+ * [Linux](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_linux.zip)
@@ -1,150 +1,150 @@
1
- C++ HTTP/HTTPS server with Python API
2
-
3
-
4
- * [Quick start](#quick-start)
5
- * [main.py](#mainpy)
6
- * [Settings](#settings)
7
- * [Config](#config)
8
- * [Run sample](#run-sample)
9
- * [Executors](#executors)
10
-
11
-
12
- ## Quick start
13
- Server needs few files to run:
14
- * [web.json](#settings) with routes
15
- * [Executors](#executors)
16
- * [Windows](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/windows.zip)
17
- * [Linux](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/linux.zip)
18
- * [config.json](#config) with server settings
19
- All these files must be in the same directory as ```main.py```
20
-
21
-
22
- ### main.py
23
- ```python
24
- from web_framework_api.WebFramework import WebFramework # Server
25
- from web_framework_api.utility.DLLHandler import initialize_web_framework # WebFramework initialization
26
- from web_framework_api.exceptions.WebFrameworkException import WebFrameworkException # Exception
27
-
28
- def on_start():
29
- print("Server is running")
30
-
31
- if __name__ == '__main__':
32
- try:
33
- initialize_web_framework() # Load WebFramework shared library
34
-
35
- server = WebFramework.from_path("config.json") # Create server
36
-
37
- server.start(True, on_start) # Start server and wait
38
- except WebFrameworkException as exception:
39
- print(exception)
40
-
41
- exit(-1)
42
- ```
43
-
44
-
45
- ### Settings
46
- ```web.json```
47
- ```json
48
- {
49
- "HelloExecutor": {
50
- "route": "",
51
- "loadType": "initialization"
52
- }
53
- }
54
- ```
55
-
56
-
57
- ### Config
58
- ```config.json```
59
- ```json
60
- {
61
- "WebServer": {
62
- "ip": "0.0.0.0",
63
- "port": 8080,
64
- "timeout": 0
65
- },
66
- "WebFramework": {
67
- "settingsPaths": [
68
- "web.json"
69
- ],
70
- "loadSources": [
71
- "hello_executor"
72
- ],
73
- "assetsPath": "assets",
74
- "templatesPath": "templates",
75
- "cachingSize": 536870912,
76
- "webServerType": "multiThreaded",
77
- "HTTPS": {
78
- "useHTTPS": false,
79
- "pathToCertificate": "certificates/cert.pem",
80
- "pathToKey": "certificates/key.pem"
81
- },
82
- "defaultAssetsPath": "WebFrameworkAssets"
83
- },
84
- "Logging": {
85
- "usingLogging": false,
86
- "dateFormat": "DMY",
87
- "logFileSize": 134217728
88
- },
89
- "ThreadPoolServer": {
90
- "threadCount": 0
91
- }
92
- }
93
- ```
94
-
95
-
96
- ### Run sample
97
- After running server open url [127.0.0.1:8080](http://127.0.0.1:8080).
98
- You will see response from server
99
- ```json
100
- {
101
- "message": "Hello, World!"
102
- }
103
- ```
104
-
105
-
106
- ## Executors
107
- Executors are C++ classes that responsible for giving responses for their route(url).
108
- Source code of HelloExecutor from example
109
- ```HelloExecutor.h```
110
- ```cpp
111
- #pragma once
112
-
113
- #include "Executors/BaseStatelessExecutor.h"
114
-
115
- namespace executors
116
- {
117
- class HelloExecutor : public framework::BaseStatelessExecutor
118
- {
119
- public:
120
- HelloExecutor() = default;
121
-
122
- void doGet(framework::HTTPRequest& request, framework::HTTPResponse& response) override;
123
-
124
- ~HelloExecutor() = default;
125
- };
126
- }
127
- ```
128
- ```HelloExecutor.cpp```
129
- ```cpp
130
- #include "HelloExecutor.h"
131
-
132
- #include "JSONBuilder.h"
133
-
134
- namespace executors
135
- {
136
- void HelloExecutor::doGet(framework::HTTPRequest& request, framework::HTTPResponse& response)
137
- {
138
- response.addBody(json::JSONBuilder(CP_UTF8).appendString("message", "Hello, World!"));
139
- }
140
-
141
- DECLARE_EXECUTOR(HelloExecutor);
142
- }
143
- ```
144
- More information you can find in [wiki](https://github.com/LazyPanda07/WebFramework/wiki/Executors).
145
-
146
-
147
- ### Hello executor
148
- * Links
149
- * [Windows](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/windows.zip)
150
- * [Linux](https://github.com/LazyPanda07/WebFramework/releases/download/Assets/linux.zip)
1
+ C++ HTTP/HTTPS server with Python API
2
+
3
+
4
+ * [Quick start](#quick-start)
5
+ * [main.py](#mainpy)
6
+ * [Settings](#settings)
7
+ * [Config](#config)
8
+ * [Run sample](#run-sample)
9
+ * [Executors](#executors)
10
+
11
+
12
+ ## Quick start
13
+ Server needs few files to run:
14
+ * [web.json](#settings) with routes
15
+ * [Executors](#executors)
16
+ * [Windows](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_windows.zip)
17
+ * [Linux](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_linux.zip)
18
+ * [config.json](#config) with server settings
19
+ All these files must be in the same directory as ```main.py```
20
+
21
+
22
+ ### main.py
23
+ ```python
24
+ from web_framework_api.WebFramework import WebFramework # Server
25
+ from web_framework_api.utility.DLLHandler import initialize_web_framework # WebFramework initialization
26
+ from web_framework_api.exceptions.WebFrameworkException import WebFrameworkException # Exception
27
+
28
+ def on_start():
29
+ print("Server is running")
30
+
31
+ if __name__ == '__main__':
32
+ try:
33
+ initialize_web_framework() # Load WebFramework shared library
34
+
35
+ server = WebFramework.from_path("config.json") # Create server
36
+
37
+ server.start(True, on_start) # Start server and wait
38
+ except WebFrameworkException as exception:
39
+ print(exception)
40
+
41
+ exit(-1)
42
+ ```
43
+
44
+
45
+ ### Settings
46
+ ```web.json```
47
+ ```json
48
+ {
49
+ "HelloExecutor": {
50
+ "route": "",
51
+ "loadType": "initialization"
52
+ }
53
+ }
54
+ ```
55
+
56
+
57
+ ### Config
58
+ ```config.json```
59
+ ```json
60
+ {
61
+ "WebServer": {
62
+ "ip": "0.0.0.0",
63
+ "port": 8080,
64
+ "timeout": 0
65
+ },
66
+ "WebFramework": {
67
+ "settingsPaths": [
68
+ "web.json"
69
+ ],
70
+ "loadSources": [
71
+ "hello_executor"
72
+ ],
73
+ "assetsPath": "assets",
74
+ "templatesPath": "templates",
75
+ "cachingSize": 536870912,
76
+ "webServerType": "multiThreaded",
77
+ "HTTPS": {
78
+ "useHTTPS": false,
79
+ "pathToCertificate": "certificates/cert.pem",
80
+ "pathToKey": "certificates/key.pem"
81
+ },
82
+ "defaultAssetsPath": "WebFrameworkAssets"
83
+ },
84
+ "Logging": {
85
+ "usingLogging": false,
86
+ "dateFormat": "DMY",
87
+ "logFileSize": 134217728
88
+ },
89
+ "ThreadPoolServer": {
90
+ "threadCount": 0
91
+ }
92
+ }
93
+ ```
94
+
95
+
96
+ ### Run sample
97
+ After running server open url [127.0.0.1:8080](http://127.0.0.1:8080).
98
+ You will see response from server
99
+ ```json
100
+ {
101
+ "message": "Hello, World!"
102
+ }
103
+ ```
104
+
105
+
106
+ ## Executors
107
+ Executors are C++ classes that responsible for giving responses for their route(url).
108
+ Source code of HelloExecutor from example
109
+ ```HelloExecutor.h```
110
+ ```cpp
111
+ #pragma once
112
+
113
+ #include "Executors/BaseStatelessExecutor.h"
114
+
115
+ namespace executors
116
+ {
117
+ class HelloExecutor : public framework::BaseStatelessExecutor
118
+ {
119
+ public:
120
+ HelloExecutor() = default;
121
+
122
+ void doGet(framework::HTTPRequest& request, framework::HTTPResponse& response) override;
123
+
124
+ ~HelloExecutor() = default;
125
+ };
126
+ }
127
+ ```
128
+ ```HelloExecutor.cpp```
129
+ ```cpp
130
+ #include "HelloExecutor.h"
131
+
132
+ #include "JSONBuilder.h"
133
+
134
+ namespace executors
135
+ {
136
+ void HelloExecutor::doGet(framework::HTTPRequest& request, framework::HTTPResponse& response)
137
+ {
138
+ response.addBody(json::JSONBuilder(CP_UTF8).appendString("message", "Hello, World!"));
139
+ }
140
+
141
+ DECLARE_EXECUTOR(HelloExecutor);
142
+ }
143
+ ```
144
+ More information you can find in [wiki](https://github.com/LazyPanda07/WebFramework/wiki/Executors).
145
+
146
+
147
+ ### Hello executor
148
+ * Links
149
+ * [Windows](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_windows.zip)
150
+ * [Linux](https://github.com/LazyPanda07/WebFramework/releases/latest/download/hello_executor_linux.zip)
@@ -0,0 +1,23 @@
1
+ Boost Software License - Version 1.0 - August 17th, 2003
2
+
3
+ Permission is hereby granted, free of charge, to any person or organization
4
+ obtaining a copy of the software and accompanying documentation covered by
5
+ this license (the "Software") to use, reproduce, display, distribute,
6
+ execute, and transmit the Software, and to prepare derivative works of the
7
+ Software, and to permit third-parties to whom the Software is furnished to
8
+ do so, subject to the following:
9
+
10
+ The copyright notices in the Software and this entire statement, including
11
+ the above license grant, this restriction and the following disclaimer,
12
+ must be included in all copies of the Software, in whole or in part, and
13
+ all derivative works of the Software, unless such copies or derivative
14
+ works are solely in the form of machine-executable object code generated by
15
+ a source language processor.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
20
+ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
21
+ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
22
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2014 John MacFarlane
4
+ Copyright (c) 2017-2024 GitHub, Inc.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the “Software”), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
+ IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Semyon Gritsenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,88 @@
1
+ Copyright (c) 1998-2024 The OpenSSL Project Authors. All rights reserved.
2
+ Licensed under the Apache License 2.0.
3
+
4
+ This product includes cryptographic software written by Eric Young (eay@cryptsoft.com).
5
+ This product includes software written by Tim Hudson (tjh@cryptsoft.com).
6
+
7
+ ====================================================================
8
+ OpenSSL License
9
+ ====================================================================
10
+
11
+ Copyright (c) 1998-2024 The OpenSSL Project Authors. All rights reserved.
12
+
13
+ Redistribution and use in source and binary forms, with or without
14
+ modification, are permitted provided that the following conditions are met:
15
+
16
+ 1. Redistributions of source code must retain the above copyright notice,
17
+ this list of conditions and the following disclaimer.
18
+ 2. Redistributions in binary form must reproduce the above copyright
19
+ notice, this list of conditions and the following disclaimer in the
20
+ documentation and/or other materials provided with the distribution.
21
+ 3. All advertising materials mentioning features or use of this software
22
+ must display the following acknowledgment:
23
+ "This product includes software developed by the OpenSSL Project
24
+ for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26
+ endorse or promote products derived from this software without prior
27
+ written permission. For written permission, please contact
28
+ openssl-core@openssl.org.
29
+ 5. Products derived from this software may not be called "OpenSSL" nor may
30
+ "OpenSSL" appear in their names without prior written permission of the
31
+ OpenSSL Project.
32
+ 6. Redistributions of any form whatsoever must retain the following
33
+ acknowledgment:
34
+ "This product includes software developed by the OpenSSL Project
35
+ for use in the OpenSSL Toolkit (http://www.openssl.org/)"
36
+
37
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
38
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
40
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
41
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
46
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
47
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
48
+ OF THE POSSIBILITY OF SUCH DAMAGE.
49
+
50
+ ====================================================================
51
+ Original SSLeay License
52
+ ====================================================================
53
+
54
+ Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com)
55
+ All rights reserved.
56
+
57
+ This package is an SSL implementation written
58
+ by Eric Young (eay@cryptsoft.com).
59
+ The implementation was written so as to conform with Netscape's SSL.
60
+
61
+ Redistribution and use in source and binary forms, with or without
62
+ modification, are permitted provided that the following conditions are met:
63
+
64
+ 1. Redistributions of source code must retain the copyright notice, this list
65
+ of conditions and the following disclaimer.
66
+ 2. Redistributions in binary form must reproduce the copyright notice, this
67
+ list of conditions and the following disclaimer in the documentation and/or
68
+ other materials provided with the distribution.
69
+ 3. All advertising materials mentioning features or use of this software must
70
+ display the following acknowledgement:
71
+ "This product includes cryptographic software written by
72
+ Eric Young (eay@cryptsoft.com)"
73
+ The word 'cryptographic' can be left out if the routines from the library
74
+ being used are not cryptographic related.
75
+ 4. If you include any Windows-specific code (or a derivative thereof) from
76
+ the apps directory (application code) you must include an acknowledgement:
77
+ "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
78
+
79
+ THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
80
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
81
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
82
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
83
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
84
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
85
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
86
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
87
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
88
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,6 @@
1
+ The author disclaims copyright to this source code. In place of
2
+ a legal notice, here is a blessing:
3
+
4
+ May you do good and not evil.
5
+ May you find forgiveness for yourself and forgive others.
6
+ May you share freely, never taking more than you give.
@@ -1,11 +1,15 @@
1
1
  [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
2
+ requires = ["scikit-build-core[pyproject]"]
3
+ build-backend = "scikit_build_core.build"
4
+
5
+ [tool.scikit-build]
6
+ wheel.py-api = "py3"
4
7
 
5
8
  [project]
6
9
  name = "web_framework_api"
7
10
  description = "Python API for WebFramework"
8
11
  readme = "README.md"
12
+ license = { file = "license/LICENSE" }
9
13
  authors = [
10
14
  { name = "LazyPanda07", email = "semengricenko@gmail.com" }
11
15
  ]
@@ -13,14 +17,16 @@ maintainers = [
13
17
  { name = "LazyPanda07", email = "semengricenko@gmail.com" }
14
18
  ]
15
19
  keywords = ["Web"]
16
- version = "1.0.6"
20
+ version = "3.1.0"
17
21
  dependencies = [
18
22
  "multipledispatch",
19
23
  "requests",
20
24
  "tqdm"
21
25
  ]
22
26
  classifiers = [
23
- "License :: OSI Approved :: MIT License"
27
+ "Programming Language :: Python :: 3",
28
+ "License :: OSI Approved :: MIT License",
29
+ "Operating System :: OS Independent",
24
30
  ]
25
31
 
26
32
  [project.urls]
@@ -12,6 +12,16 @@ class WebFramework:
12
12
  Web server
13
13
  """
14
14
 
15
+ @staticmethod
16
+ def get_web_framework_version() -> str:
17
+ """
18
+ Get WebFramework version
19
+ :return: String representation of version in format {major}.{minor}.{patch}
20
+ """
21
+ version = DLLHandler.get_instance().call_function("getWebFrameworkVersion", ctypes.c_char_p)
22
+
23
+ return str(version.decode())
24
+
15
25
  def __init__(self, implementation: ctypes.c_void_p):
16
26
  self.__implementation = implementation
17
27
  self.__function_signature = ctypes.CFUNCTYPE(None)
@@ -55,7 +55,7 @@ class DLLHandler:
55
55
  self.__handle = ctypes.CDLL(path_to_dll)
56
56
 
57
57
  @classmethod
58
- def get_instance(cls):
58
+ def get_instance(cls) -> "DLLHandler":
59
59
  if cls.instance is None:
60
60
  raise Exception("WebFramework must be initialized with initialize_web_framework function")
61
61
 
@@ -7,8 +7,9 @@ import requests
7
7
 
8
8
  from tqdm import tqdm
9
9
 
10
- WEB_FRAMEWORK_MAJOR_VERSION = "0"
11
- WEB_FRAMEWORK_MINOR_VERSION = "11"
10
+ WEB_FRAMEWORK_MAJOR_VERSION = "3"
11
+ WEB_FRAMEWORK_MINOR_VERSION = "1"
12
+ WEB_FRAMEWORK_PATCH_VERSION = "0"
12
13
  WEB_FRAMEWORK_LIBRARIES_FILE_NAME = "libraries.zip"
13
14
  WEB_FRAMEWORK_DOWNLOAD_BLOCK_SIZE = 1024
14
15
 
@@ -40,13 +41,13 @@ def unzip_libraries(path_to_zip: str, output_path: str):
40
41
 
41
42
  def copy_libraries(libraries_directory: str):
42
43
  if sys.platform == "win32":
43
- directory_path = os.path.join(libraries_directory, "ReleaseDLL_Windows", "dll")
44
+ directory_path = os.path.join(libraries_directory, "Release_Windows", "dll")
44
45
 
45
46
  for file in os.listdir(directory_path):
46
47
  shutil.copy(os.path.join(directory_path, file), libraries_directory)
47
48
 
48
49
  else:
49
- directory_path = os.path.join(libraries_directory, "ReleaseDLL_Linux", "lib")
50
+ directory_path = os.path.join(libraries_directory, "Release_Linux", "lib")
50
51
 
51
52
  for file in os.listdir(directory_path):
52
53
  if file.endswith(".so"):
@@ -67,11 +68,12 @@ def create_directories(libraries_directory: str):
67
68
  else:
68
69
  os.makedirs(os.path.join(libraries_directory, "lib"))
69
70
 
71
+
70
72
  def get_url():
71
73
  if sys.platform == "win32":
72
- return f"https://github.com/LazyPanda07/WebFramework/releases/download/v3.{WEB_FRAMEWORK_MAJOR_VERSION}.{WEB_FRAMEWORK_MINOR_VERSION}/windows.zip"
74
+ return f"https://github.com/LazyPanda07/WebFramework/releases/download/v{WEB_FRAMEWORK_MAJOR_VERSION}.{WEB_FRAMEWORK_MINOR_VERSION}.{WEB_FRAMEWORK_PATCH_VERSION}/windows.zip"
73
75
  else:
74
- return f"https://github.com/LazyPanda07/WebFramework/releases/download/v3.{WEB_FRAMEWORK_MAJOR_VERSION}.{WEB_FRAMEWORK_MINOR_VERSION}/linux.zip"
76
+ return f"https://github.com/LazyPanda07/WebFramework/releases/download/v{WEB_FRAMEWORK_MAJOR_VERSION}.{WEB_FRAMEWORK_MINOR_VERSION}.{WEB_FRAMEWORK_PATCH_VERSION}/linux.zip"
75
77
 
76
78
 
77
79
  def get_libraries(libraries_directory: str):