-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwith_wrapper.py
56 lines (46 loc) · 1.18 KB
/
with_wrapper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from squarecloud.utils import ConfigFile
# BOT EXAMPLE
ConfigFile(
display_name='an cool name',
description='an cool description',
main='main.py',
memory=256,
version='recommended', # default 'recommended'
auto_restart=False, # default True
)
# WEBSITE EXAMPLE
ConfigFile(
display_name='cool website',
description='this is really cool',
main='index.js',
subdomain='cool-subdomain',
start='start this cool website', # if not static it is configurable
memory=512,
version='recommended', # default 'recommended'
auto_restart=False, # default True
)
config = ConfigFile(*...)
# Saving file
config.save(
'directory/to/save/'
) # the path where the file should be saved, default='/'
# Serializing and Deserialization
config.to_dict() # dict[str, Any]
config.content() # str
ConfigFile.from_str(...)
ConfigFile.from_dict(...)
"""
[REQUIRED] parameters
---------------------
path: str
display_name: str
main: str
memory: int >= 100
version: Literal['recommended', 'latest']
[OPTIONAL] parameters
---------------------
description: str | None = None
subdomain: str | None = None
start: str | None = None
auto_restart: bool = False,
"""