Skip to content

Commit 1e36844

Browse files
committed
drop syntax as it's not used
1 parent 5ca8628 commit 1e36844

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

mystbin/client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ async def create_paste(
5454
*,
5555
filename: str,
5656
content: str,
57-
syntax: Optional[str] = None,
5857
password: Optional[str] = None,
5958
expires: Optional[datetime.datetime] = None,
6059
) -> Paste:
@@ -68,8 +67,6 @@ async def create_paste(
6867
The filename to create.
6968
content: :class:`str`
7069
The content of the file you are creating.
71-
syntax: Optional[:class:`str`]
72-
The syntax of the file to create, if any.
7370
password: Optional[:class:`str`]
7471
The password of the paste, if any.
7572
expires: Optional[:class:`datetime.datetime`]
@@ -80,7 +77,7 @@ async def create_paste(
8077
:class:`mystbin.Paste`
8178
The paste that was created.
8279
"""
83-
file = File(filename=filename, content=content, syntax=syntax)
80+
file = File(filename=filename, content=content)
8481
data = await self.http._create_paste(file=file, password=password, expires=expires)
8582
return Paste._from_data(data)
8683

mystbin/paste.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class File:
4646
The file's name.
4747
content: :class:`str`
4848
The file's contents.
49-
syntax: Optional[:class:`str`]
50-
The file's syntax, if given.
5149
lines_of_code: Optional[:class:`int`]
5250
The lines of code within the file.
5351
character_count: Optional[:class:`int`]
@@ -71,13 +69,11 @@ def __init__(
7169
*,
7270
filename: str,
7371
content: str,
74-
syntax: Optional[str],
7572
lines_of_code: Optional[int] = None,
7673
character_count: Optional[int] = None,
7774
) -> None:
7875
self.filename: str = filename
7976
self.content: str = content
80-
self.syntax: Optional[str] = syntax
8177
self.lines_of_code: int = lines_of_code or content.count("\n")
8278
self.character_count: int = character_count or len(content)
8379

@@ -86,7 +82,6 @@ def _from_data(cls, payload: FileResponse, /) -> Self:
8682
return cls(
8783
content=payload["content"],
8884
filename=payload["filename"],
89-
syntax=payload["filename"].rsplit(".")[-1],
9085
lines_of_code=payload["loc"],
9186
character_count=payload["charcount"],
9287
)

0 commit comments

Comments
 (0)