Skip to content

Commit 708d4a1

Browse files
committed
Unify Comments
1 parent bdd89e2 commit 708d4a1

File tree

15 files changed

+60
-21
lines changed

15 files changed

+60
-21
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# http://webui.me
1+
# https://webui.me
22
# https://github.com/webui-dev/webui
33
# Copyright (c) 2020-2024 Hassan Draga.
44
# Licensed under MIT License.
55
# All rights reserved.
6+
# Canada.
67
#
78
# Special Thanks to Turiiya (https://github.com/ttytm)
89

.github/workflows/linux.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# http://webui.me
1+
# https://webui.me
22
# https://github.com/webui-dev/webui
33
# Copyright (c) 2020-2024 Hassan Draga.
44
# Licensed under MIT License.
55
# All rights reserved.
6+
# Canada.
67
#
78
# Special Thanks to Turiiya (https://github.com/ttytm)
89

.github/workflows/linux_arm.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# http://webui.me
1+
# https://webui.me
22
# https://github.com/webui-dev/webui
33
# Copyright (c) 2020-2024 Hassan Draga.
44
# Licensed under MIT License.
55
# All rights reserved.
6+
# Canada.
67
#
78
# Special Thanks to Turiiya (https://github.com/ttytm)
89

.github/workflows/macos.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# http://webui.me
1+
# https://webui.me
22
# https://github.com/webui-dev/webui
33
# Copyright (c) 2020-2024 Hassan Draga.
44
# Licensed under MIT License.
55
# All rights reserved.
6+
# Canada.
67
#
78
# Special Thanks to Turiiya (https://github.com/ttytm)
89

.github/workflows/windows.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# http://webui.me
1+
# https://webui.me
22
# https://github.com/webui-dev/webui
33
# Copyright (c) 2020-2024 Hassan Draga.
44
# Licensed under MIT License.
55
# All rights reserved.
6+
# Canada.
67
#
78
# Special Thanks to Turiiya (https://github.com/ttytm)
89

bridge/build.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# http://webui.me
1+
# https://webui.me
22
# https://github.com/webui-dev/webui
33
# Copyright (c) 2020-2024 Hassan Draga.
44
# Licensed under MIT License.
55
# All rights reserved.
6+
# Canada.
67
#
78
# Special Thanks to Turiiya (https://github.com/ttytm)
89

bridge/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/bash
22

3-
# http://webui.me
3+
# https://webui.me
44
# https://github.com/webui-dev/webui
55
# Copyright (c) 2020-2024 Hassan Draga.
66
# Licensed under MIT License.
77
# All rights reserved.
8+
# Canada.
89
#
910
# Special Thanks to Turiiya (https://github.com/ttytm)
1011

bridge/js2c.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
1-
# http://webui.me
1+
# https://webui.me
22
# https://github.com/webui-dev/webui
33
# Copyright (c) 2020-2024 Hassan Draga.
44
# Licensed under MIT License.
55
# All rights reserved.
6+
# Canada.
67
#
78
# WebUI JavaScript to C Header
89

910
def js_to_c_header(input_filename, output_filename):
1011
try:
1112
# Read JS file content
12-
with open(input_filename, 'r', encoding='utf-8') as f:
13-
content = f.read()
13+
with open(input_filename, 'r', encoding='utf-8') as file_js:
14+
content = file_js.read()
15+
file_js.close()
1416

1517
print(f"Converting '{input_filename}' to '{output_filename}'...")
1618

19+
# comment
20+
comment = (
21+
"// WebUI v2.5.0-beta.2\n"
22+
"// https://webui.me\n"
23+
"// https://github.com/webui-dev/webui\n"
24+
"// Copyright (c) 2020-2024 Hassan Draga.\n"
25+
"// Licensed under MIT License.\n"
26+
"// All rights reserved.\n"
27+
"// Canada.\n\n"
28+
)
29+
1730
# Convert each character in JS content to its hexadecimal value
1831
hex_values = ["0x{:02x}".format(ord(char)) for char in content]
1932

2033
# Prepare the content for the C header file
2134
header_content = (
35+
comment +
2236
"// --- PLEASE DO NOT EDIT THIS FILE -------\n"
2337
"// --- THIS FILE IS GENERATED BY JS2C.PY --\n\n"
2438
"#ifndef WEBUI_BRIDGE_H\n"
@@ -29,12 +43,18 @@ def js_to_c_header(input_filename, output_filename):
2943
# Split the hexadecimal values to make the output more readable, adding a new line every 10 values
3044
for i in range(0, len(hex_values), 10):
3145
header_content += "\n " + ', '.join(hex_values[i:i+10]) + ','
32-
3346
header_content += "\n 0x00\n};\n\n#endif // WEBUI_BRIDGE_H"
3447

3548
# Write the header content to the output file
36-
with open(output_filename, 'w', encoding='utf-8') as f:
37-
f.write(header_content)
49+
with open(output_filename, 'w', encoding='utf-8') as file_h:
50+
file_h.write(header_content)
51+
file_h.close()
52+
53+
# Add comment to js
54+
new_content = comment + content
55+
with open(input_filename, 'w') as file_js:
56+
file_js.write(new_content)
57+
file_js.close()
3858

3959
except FileNotFoundError:
4060
print(f"Error: File '{input_filename}' not found.")

bridge/utils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
/*
2-
WebUI Bridge Utils
3-
4-
Copyright (c) 2024 Oculi Julien.
2+
https://webui.me
3+
https://github.com/webui-dev/webui
4+
Copyright (c) 2020-2024 Hassan Draga.
55
Licensed under MIT License.
66
All rights reserved.
7+
Canada.
8+
9+
File: WebUI Bridge Utils
10+
Copyright (c) 2024 Oculi Julien.
711
*/
812

913
/**

bridge/webui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
WebUI Bridge
55
6-
http://webui.me
6+
https://webui.me
77
https://github.com/webui-dev/webui
88
Copyright (c) 2020-2024 Hassan Draga.
99
Licensed under MIT License.

0 commit comments

Comments
 (0)