File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
from typing import Optional
2
2
from pydantic import BaseModel
3
3
4
+
4
5
class Data (BaseModel ):
5
6
input_data : str
6
7
8
+
7
9
class PasteCreate (BaseModel ):
8
10
content : str
9
11
extension : Optional [str ] = None
10
12
13
+
11
14
class PasteResponse (BaseModel ):
12
15
uuid : str
13
16
url : str
14
17
18
+
15
19
class PasteDetails (BaseModel ):
16
20
uuid : str
17
21
content : str
Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ def extract_extension(file_name: Path) -> str:
23
23
24
24
def _find_without_extension (file_name : str ) -> str :
25
25
file_list : list = os .listdir ("data" )
26
- pattern_with_dot : Pattern [str ] = re .compile (
27
- r"^(" + re .escape (file_name ) + r")\." )
28
- pattern_without_dot : Pattern [str ] = re .compile (
29
- r"^" + file_name + "$" )
26
+ pattern_with_dot : Pattern [str ] = re .compile (r"^(" + re .escape (file_name ) + r")\." )
27
+ pattern_without_dot : Pattern [str ] = re .compile (r"^" + file_name + "$" )
30
28
math_pattern : list = [
31
- x for x in file_list if pattern_with_dot .match (x ) or pattern_without_dot .match (x )]
29
+ x
30
+ for x in file_list
31
+ if pattern_with_dot .match (x ) or pattern_without_dot .match (x )
32
+ ]
32
33
if len (math_pattern ) == 0 :
33
34
return str ()
34
35
else :
You can’t perform that action at this time.
0 commit comments