Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/test_globalstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_Signal_emitted(self, qtbot):
def test_AttributeError(self, qtbot):
"""Make sure other fields trigger AttributeError."""
state = globalstate.SingleState("")
with pytest.raises(AttributeError, match="The only valid attributes are 'Value' and 'Signal'."):
with pytest.raises(AttributeError, match=r"The only valid attributes are 'Value' and 'Signal'."):
state.Test = "Test"


Expand Down
2 changes: 1 addition & 1 deletion typstwriter/compiler_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def main_path_edited(self):
def open_file_dialog(self):
"""Open a dialog to select the main file."""
filters = "Typst Files (*.typ);;Any File (*)"
path, cd = QtWidgets.QFileDialog.getOpenFileName(self, "Open File", state.working_directory.Value, filters)
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Open File", state.working_directory.Value, filters)

if os.path.isfile(path):
self.line_edit_main.setText(path)
Expand Down
6 changes: 3 additions & 3 deletions typstwriter/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def open_file(self, path):
def open_file_dialog(self):
"""Open a dialog to open an existing file."""
filters = "Typst Files (*.typ);;Bibliography Files (*.bib *.yml);;Any File (*)"
path, cd = QtWidgets.QFileDialog.getOpenFileName(self, "Open File", state.working_directory.Value, filters)
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Open File", state.working_directory.Value, filters)
if path:
self.open_file(path)

Expand Down Expand Up @@ -448,7 +448,7 @@ def save(self):

def save_as(self):
"""Save file under a new name."""
path, cd = QtWidgets.QFileDialog.getSaveFileName(self, "Save File", state.working_directory.Value)
path, _ = QtWidgets.QFileDialog.getSaveFileName(self, "Save File", state.working_directory.Value)

if os.path.exists(path) or os.access(os.path.dirname(path), os.W_OK):
self.path = path
Expand Down Expand Up @@ -893,7 +893,7 @@ def highlight_errors(self, errors):
"""Highlight compiler errors."""
highlights = []
for e in errors:
(error, line, col, length) = e
(_, line, col, length) = e
# the error code is not currently used but it may be displayed in the editor in the future

cursor = QtGui.QTextCursor(self.document())
Expand Down
2 changes: 1 addition & 1 deletion typstwriter/fs_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def paste_from_clipboard(self, path):
for uri in mime_data.data("text/uri-list").data().decode().split():
fs = QtCore.QUrl(uri).toLocalFile()
if os.path.exists(fs):
head, tail = os.path.split(fs)
_, tail = os.path.split(fs)
path_to = os.path.join(path, tail)

if os.path.exists(path_to):
Expand Down
2 changes: 1 addition & 1 deletion typstwriter/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def open_with_external_program(path):

def pdf_path(typst_path):
"""Convert a input path to a pdf output path."""
(trunk, ext) = os.path.splitext(typst_path)
(trunk, _) = os.path.splitext(typst_path)
pdf_path = trunk + ".pdf"
return pdf_path

Expand Down