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 11from typing import Optional
22from pydantic import BaseModel
33
4+
45class Data (BaseModel ):
56 input_data : str
67
8+
79class PasteCreate (BaseModel ):
810 content : str
911 extension : Optional [str ] = None
1012
13+
1114class PasteResponse (BaseModel ):
1215 uuid : str
1316 url : str
1417
18+
1519class PasteDetails (BaseModel ):
1620 uuid : str
1721 content : str
Original file line number Diff line number Diff line change @@ -23,12 +23,13 @@ def extract_extension(file_name: Path) -> str:
2323
2424def _find_without_extension (file_name : str ) -> str :
2525 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 + "$" )
3028 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+ ]
3233 if len (math_pattern ) == 0 :
3334 return str ()
3435 else :
You can’t perform that action at this time.
0 commit comments