Spaces:
Running
Running
Delete fn.py
Browse files
fn.py
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
from datetime import datetime
|
2 |
-
import pytz
|
3 |
-
import os
|
4 |
-
import shutil
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
def hex_to_rgb(hex_color):
|
9 |
-
# Remove the '#' character if it exists
|
10 |
-
hex_color = hex_color.lstrip('#')
|
11 |
-
|
12 |
-
# Convert the hex string to integers
|
13 |
-
r, g, b = tuple(int(hex_color[i:i + 2], 16) for i in (0, 2, 4))
|
14 |
-
return r, g, b
|
15 |
-
|
16 |
-
|
17 |
-
def get_kr_time():
|
18 |
-
# νκ΅ μκ°λ μ€μ
|
19 |
-
korea_time_zone = pytz.timezone('Asia/Seoul')
|
20 |
-
|
21 |
-
# νμ¬ μκ°μ νκ΅ μκ°λλ‘ λ³ν
|
22 |
-
current_time_in_korea = datetime.now(korea_time_zone)
|
23 |
-
|
24 |
-
# μνλ νμμΌλ‘ μκ° ν¬λ§·ν
|
25 |
-
return current_time_in_korea.strftime("%Y%m%d-%H%M%S")
|
26 |
-
|
27 |
-
def url_mapping(url):
|
28 |
-
# κ° λ¬Έμμ΄μ λμνλ URL 맀ν
|
29 |
-
url_mapping = {
|
30 |
-
"tripleS website": "https://triplescosmos.com/",
|
31 |
-
"tripleS youtube": "https://youtube.com/@triplescosmos",
|
32 |
-
"tripleS π": "https://x.com/triplescosmos",
|
33 |
-
"tripleS discord": "https://discord.gg/triplescosmos"
|
34 |
-
}
|
35 |
-
|
36 |
-
# qr_urlμ΄ λ§€νλ λ¬Έμμ΄ μ€ νλλΌλ©΄ ν΄λΉ URLμ, μλλΌλ©΄ qr_url κ·Έλλ‘λ₯Ό λ°ν
|
37 |
-
return url_mapping.get(url, url)
|
38 |
-
|
39 |
-
|
40 |
-
def storage(name):
|
41 |
-
# '/data' ν΄λλ₯Ό 'data.zip'μΌλ‘ μμΆ
|
42 |
-
shutil.make_archive(f'/data/{name}', 'zip', f'/data/{name}')
|
43 |
-
shutil.rmtree(f'/data/{name}')
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|