vesta-web 1.1.8__py3-none-any.whl → 1.1.10__py3-none-any.whl
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.
- vesta/__init__.py +6 -4
- vesta/emptyProject/static/markdown/markdown.mjs +56 -10
- {vesta_web-1.1.8.dist-info → vesta_web-1.1.10.dist-info}/METADATA +1 -1
- {vesta_web-1.1.8.dist-info → vesta_web-1.1.10.dist-info}/RECORD +7 -7
- {vesta_web-1.1.8.dist-info → vesta_web-1.1.10.dist-info}/WHEEL +0 -0
- {vesta_web-1.1.8.dist-info → vesta_web-1.1.10.dist-info}/entry_points.txt +0 -0
- {vesta_web-1.1.8.dist-info → vesta_web-1.1.10.dist-info}/licenses/LICENSE.md +0 -0
vesta/__init__.py
CHANGED
|
@@ -97,7 +97,7 @@ class Server(server):
|
|
|
97
97
|
|
|
98
98
|
@server.expose
|
|
99
99
|
def resendVerif(self):
|
|
100
|
-
user = self.getUser()
|
|
100
|
+
user = self.getUser(verif = True)
|
|
101
101
|
self.sendVerification(user)
|
|
102
102
|
|
|
103
103
|
@server.expose
|
|
@@ -148,7 +148,9 @@ class Server(server):
|
|
|
148
148
|
|
|
149
149
|
@server.expose
|
|
150
150
|
def signup(self, code):
|
|
151
|
-
|
|
151
|
+
print("signup with code:", code)
|
|
152
|
+
user = self.getUser(verif=True)
|
|
153
|
+
print("user:", user)
|
|
152
154
|
actual = self.uniauth.getSomething("verif_code", user)
|
|
153
155
|
if str(actual["code"]) == code and actual["expiration"] > datetime.datetime.now():
|
|
154
156
|
self.uniauth.edit("account", user, "verified", True)
|
|
@@ -209,8 +211,8 @@ class Server(server):
|
|
|
209
211
|
token = self.response.cookies['JWT']
|
|
210
212
|
return token
|
|
211
213
|
|
|
212
|
-
def getUser(self):
|
|
213
|
-
info = self.checkJwt()
|
|
214
|
+
def getUser(self, verif = False):
|
|
215
|
+
info = self.checkJwt(verif)
|
|
214
216
|
return info['username']
|
|
215
217
|
|
|
216
218
|
def sendVerification(self, uid, mail=''):
|
|
@@ -16,8 +16,9 @@ export class Markdown {
|
|
|
16
16
|
"||":"<div class='spoiler' onclick='showSpoiler(event)'>${content}</div>",
|
|
17
17
|
"link":"<a href='${props.link}' target='_blank'>${content}</a>",
|
|
18
18
|
"color":"<div class='color' style='color: ${props.color}'>${content}</div>",
|
|
19
|
+
"-#":"<small>${content}</small>",
|
|
19
20
|
"endline":"\n",
|
|
20
|
-
"newline":"",
|
|
21
|
+
"newline":"${content}",
|
|
21
22
|
")":")",
|
|
22
23
|
"'":"'",
|
|
23
24
|
"(":"(",
|
|
@@ -43,7 +44,7 @@ export class Markdown {
|
|
|
43
44
|
currentToken.type="link"
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
let look_id = 5
|
|
47
|
+
let look_id = str.slice(char_id,char_id+6) === "https:" ? 6 : 5
|
|
47
48
|
let nextToken
|
|
48
49
|
while (char_id+look_id<str.length){
|
|
49
50
|
if(str[char_id+look_id]=== "\n"){
|
|
@@ -124,6 +125,16 @@ export class Markdown {
|
|
|
124
125
|
currentToken.content = currentToken.content.concat(char)
|
|
125
126
|
}
|
|
126
127
|
break
|
|
128
|
+
case "-#":
|
|
129
|
+
switch (char){
|
|
130
|
+
case '\n':
|
|
131
|
+
tokenList.push(currentToken)
|
|
132
|
+
currentToken = new Token("newline")
|
|
133
|
+
break
|
|
134
|
+
default:
|
|
135
|
+
currentToken.content = currentToken.content.concat(char)
|
|
136
|
+
}
|
|
137
|
+
break
|
|
127
138
|
case "newline":
|
|
128
139
|
switch (char){
|
|
129
140
|
case '#':
|
|
@@ -139,9 +150,15 @@ export class Markdown {
|
|
|
139
150
|
currentToken.type=currentToken.props.consuming
|
|
140
151
|
tokenList.push(currentToken)
|
|
141
152
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
153
|
+
// Check if next character is # for small text
|
|
154
|
+
if (char_id + 1 < str.length && str[char_id + 1] === '#') {
|
|
155
|
+
currentToken = new Token("-#")
|
|
156
|
+
char_id += 1 // Skip the # character
|
|
157
|
+
} else {
|
|
158
|
+
currentToken = new Token("text")
|
|
159
|
+
tokenList.push(new Token("start li"))
|
|
160
|
+
commitEndline = true
|
|
161
|
+
}
|
|
145
162
|
break
|
|
146
163
|
case '>':
|
|
147
164
|
if (currentToken.content.trim() !== ""){
|
|
@@ -153,6 +170,10 @@ export class Markdown {
|
|
|
153
170
|
commitEndline = true
|
|
154
171
|
break
|
|
155
172
|
case '*':
|
|
173
|
+
if (currentToken.content.trim() !== ""){
|
|
174
|
+
currentToken.type=currentToken.props.consuming
|
|
175
|
+
tokenList.push(currentToken)
|
|
176
|
+
}
|
|
156
177
|
currentToken = new Token("*")
|
|
157
178
|
currentToken.props.level = 1
|
|
158
179
|
break
|
|
@@ -162,12 +183,22 @@ export class Markdown {
|
|
|
162
183
|
case '/':
|
|
163
184
|
case '&':
|
|
164
185
|
case '<':
|
|
165
|
-
currentToken.
|
|
186
|
+
if (currentToken.content.trim() !== ""){
|
|
187
|
+
currentToken.type=currentToken.props.consuming
|
|
188
|
+
tokenList.push(currentToken)
|
|
189
|
+
currentToken = new Token(char)
|
|
190
|
+
}else{
|
|
191
|
+
currentToken.type = char
|
|
192
|
+
}
|
|
166
193
|
break
|
|
167
194
|
case '[':
|
|
168
195
|
case ']':
|
|
169
196
|
case '(':
|
|
170
197
|
case ')':
|
|
198
|
+
if (currentToken.content.trim() !== ""){
|
|
199
|
+
currentToken.type=currentToken.props.consuming
|
|
200
|
+
tokenList.push(currentToken)
|
|
201
|
+
}
|
|
171
202
|
tokenList.push(new Token(char))
|
|
172
203
|
currentToken = new Token("text")
|
|
173
204
|
break
|
|
@@ -175,8 +206,10 @@ export class Markdown {
|
|
|
175
206
|
currentToken.content = currentToken.content.concat(char)
|
|
176
207
|
break
|
|
177
208
|
case '\n':
|
|
178
|
-
currentToken.
|
|
179
|
-
|
|
209
|
+
if (currentToken.content.trim() !== "") {
|
|
210
|
+
currentToken.type = currentToken.props.consuming || "text"
|
|
211
|
+
tokenList.push(currentToken)
|
|
212
|
+
}
|
|
180
213
|
tokenList.push(new Token("endline"))
|
|
181
214
|
currentToken = new Token("newline")
|
|
182
215
|
break
|
|
@@ -365,7 +398,17 @@ export class Markdown {
|
|
|
365
398
|
content = content.concat(render[0])
|
|
366
399
|
}
|
|
367
400
|
token.content = content
|
|
368
|
-
return [fillTemplate(this.HTML_equiv[token.type], token), token_id
|
|
401
|
+
return [fillTemplate(this.HTML_equiv[token.type], token), token_id]
|
|
402
|
+
case "-#":
|
|
403
|
+
let smallContent = token.content
|
|
404
|
+
while (token_id + 1 < tokens.length && tokens[token_id + 1].type !== "endline") {
|
|
405
|
+
token_id += 1
|
|
406
|
+
const render = this.renderToken(tokens[token_id], token_id, tokens)
|
|
407
|
+
token_id = render[1]
|
|
408
|
+
smallContent = smallContent.concat(render[0])
|
|
409
|
+
}
|
|
410
|
+
token.content = smallContent
|
|
411
|
+
return [fillTemplate(this.HTML_equiv[token.type], token), token_id]
|
|
369
412
|
case "*":
|
|
370
413
|
// this is suboptimal because we're looking for same size closing
|
|
371
414
|
// smth like *** a ** b * will not work as intended
|
|
@@ -410,7 +453,10 @@ export class Markdown {
|
|
|
410
453
|
break
|
|
411
454
|
}
|
|
412
455
|
if(tokens[token_id].type === "]"){
|
|
413
|
-
if(
|
|
456
|
+
if(token_id + 3 < tokens.length &&
|
|
457
|
+
tokens[token_id+1].type === "(" &&
|
|
458
|
+
tokens[token_id+2].type === "link" &&
|
|
459
|
+
tokens[token_id+3].type === ")"){
|
|
414
460
|
token.content = content
|
|
415
461
|
token.props.link = tokens[token_id+2].content
|
|
416
462
|
return [fillTemplate(this.HTML_equiv["link"], token), token_id+3]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vesta-web
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.10
|
|
4
4
|
Summary: An extensive web framework adding every feature needed for Carbonlab
|
|
5
5
|
Project-URL: Homepage, https://gitlab.com/Louciole/vesta
|
|
6
6
|
Project-URL: Issues, https://gitlab.com/Louciole/vesta/-/issues
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
vesta/__init__.py,sha256=
|
|
1
|
+
vesta/__init__.py,sha256=B84n0xvfCLiCpXLpvPkjlEgGwBaxCzr0Xazm5e84mdo,17977
|
|
2
2
|
vesta/db/UNIAUTH.sql,sha256=3R8Si3rcXfRFC5idmaKTixDWXMazXQzdC9u1BCPCovY,2126
|
|
3
3
|
vesta/db/db_service.py,sha256=E2r6LxxycMOBtpUXWbVIge_363QUCOIJg-MK-Z5dzmw,10058
|
|
4
4
|
vesta/emptyProject/.gitignore,sha256=9ImxEbKZYcw6fZv2coknCwBdmfY7xWkrOgfBWR03VG0,206
|
|
@@ -38,7 +38,7 @@ vesta/emptyProject/static/home/auth.html,sha256=sz-CC-B4NUqth8aSQqwQCvq2V46AnhaI
|
|
|
38
38
|
vesta/emptyProject/static/home/auth.js,sha256=txMlUqr4A-15Czf4MYwaED35XXcaHI_zrc4SpnjItJU,4622
|
|
39
39
|
vesta/emptyProject/static/home/reset.html,sha256=EcXfX2Vil3NrYhDvEptrIhW9QV9X_kDy59-TK2S_P4w,2655
|
|
40
40
|
vesta/emptyProject/static/home/verif.html,sha256=tUw96l0FZ5-AXuE8s-7v1nM632onErq5swgCU53zP-s,2906
|
|
41
|
-
vesta/emptyProject/static/markdown/markdown.mjs,sha256=
|
|
41
|
+
vesta/emptyProject/static/markdown/markdown.mjs,sha256=eqSV-uzI1PcZS6eev8pqXv2UocDv2NHyFG6v91b-KAo,24105
|
|
42
42
|
vesta/emptyProject/static/markdown/utils.mjs,sha256=PGxhsJfub_lt-LEZVqYt8lKEp_RTRVGXuNhGmWxto-k,614
|
|
43
43
|
vesta/emptyProject/static/translations/en.mjs,sha256=ouMluPVTgB4Q5vmb7zGE6YGTH4URruog5_a52sBDYNE,22
|
|
44
44
|
vesta/emptyProject/static/translations/fr.mjs,sha256=ouMluPVTgB4Q5vmb7zGE6YGTH4URruog5_a52sBDYNE,22
|
|
@@ -55,8 +55,8 @@ vesta/scripts/initDB.py,sha256=TKaK4RZM6CycBEsHeGb9Q9PdphkQgaJDnEWhvRnGC9k,1659
|
|
|
55
55
|
vesta/scripts/install.py,sha256=GvH_HHx5aU5_54RQ1_2vz4DaLCh42AHfUKy-m0q21vY,2125
|
|
56
56
|
vesta/scripts/testsRun.py,sha256=bXJImdexKQUDW8CR8F9VIKTrgkd7QfnvHQPENEV4x38,2463
|
|
57
57
|
vesta/scripts/utils.py,sha256=PR2XPonaoZEbegzV3QX1EHfyq67sU-cbDEUexCuJp9Q,6013
|
|
58
|
-
vesta_web-1.1.
|
|
59
|
-
vesta_web-1.1.
|
|
60
|
-
vesta_web-1.1.
|
|
61
|
-
vesta_web-1.1.
|
|
62
|
-
vesta_web-1.1.
|
|
58
|
+
vesta_web-1.1.10.dist-info/METADATA,sha256=vFJSmvsrvfNqk0S14S5Gggw4xDVoZuUBZZueNNh9gTQ,1585
|
|
59
|
+
vesta_web-1.1.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
60
|
+
vesta_web-1.1.10.dist-info/entry_points.txt,sha256=MHMrWJwtkb4FmNz0CTpxZzwQ3LTqndXBh8YBPDfXlW4,49
|
|
61
|
+
vesta_web-1.1.10.dist-info/licenses/LICENSE.md,sha256=zoPFEFUUoSgosmDBK5fGTWGRHHBaSVuuJT2ZQIYXuIk,177
|
|
62
|
+
vesta_web-1.1.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|