Skip to content

Commit

Permalink
Format code with autopep8 and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsource-autofix[bot] authored Nov 9, 2021
1 parent b819173 commit 0acc4a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions torrentfileQt/checkTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ def __init__(self, text, parent=None):


class TreePieceItem(QTreeWidgetItem):

def __init__(self, type=0, tree=None):
super().__init__(type=type)
policy = self.ChildIndicatorPolicy.DontShowIndicatorWhenChildless
Expand Down Expand Up @@ -360,7 +359,7 @@ def add_path_child(self, path, size):
item_tree[partial] = {"widget": item}
if i == len(partials) - 1:
fileicon = QIcon("./assets/file.png")
progressBar = ProgressBar(parent=None,size=size)
progressBar = ProgressBar(parent=None, size=size)
self.setItemWidget(item, 2, progressBar)
item.progbar = progressBar
self.itemWidgets[str(path)] = item
Expand Down
24 changes: 12 additions & 12 deletions torrentfileQt/infoTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
QTreeWidget,
)

from torrentfileQt.qss import (pushButtonSheet, infoLineEditSheet,
labelSheet, treeSheet)
from torrentfileQt.qss import pushButtonSheet, infoLineEditSheet, labelSheet, treeSheet

from PyQt6.QtGui import QIcon

Expand Down Expand Up @@ -155,17 +154,17 @@ def __init__(self, parent=None):
self.layout.addWidget(self.metaVersionLabel, 6, 0, 1, 1)
self.layout.addWidget(self.metaVersionEdit, 6, 1, 1, 1)
self.layout.addWidget(self.privateLabel, 7, 0, 1, 1)
self.layout.addWidget(self.privateEdit, 7, 1, 1, 1)
self.layout.addWidget(self.sourceLabel, 8, 0, 1, 1)
self.layout.addWidget(self.sourceEdit, 8, 1, 1, 1)
self.layout.addWidget(self.privateEdit, 7, 1, 1, 1)
self.layout.addWidget(self.sourceLabel, 8, 0, 1, 1)
self.layout.addWidget(self.sourceEdit, 8, 1, 1, 1)
self.layout.addWidget(self.commentLabel, 9, 0, 1, 1)
self.layout.addWidget(self.commentEdit, 9, 1, 1, 1)
self.layout.addWidget(self.commentEdit, 9, 1, 1, 1)
self.layout.addWidget(self.createdByLabel, 10, 0, 1, 1)
self.layout.addWidget(self.createdByEdit, 10, 1, 1, 1)
self.layout.addWidget(self.createdByEdit, 10, 1, 1, 1)
self.layout.addWidget(self.dateCreatedLabel, 11, 0, 1, 1)
self.layout.addWidget(self.dateCreatedEdit, 11, 1, 1, 1)
self.layout.addWidget(self.dateCreatedEdit, 11, 1, 1, 1)
self.layout.addWidget(self.contentsLabel, 12, 0, 1, 1)
self.layout.addWidget(self.contentsTree, 12, 1, 5, 1)
self.layout.addWidget(self.contentsTree, 12, 1, 5, 1)
self.selectButton = SelectButton("Select Torrent", parent=self)
self.layout.addWidget(self.selectButton, 17, 0, -1, -1)

Expand Down Expand Up @@ -255,12 +254,12 @@ def selectTorrent(self, files=None):
if "files" in info:
contents = {}
for entry in info["files"]:
contents[os.path.join(info["name"],*entry["path"])] = entry["length"]
contents[os.path.join(info["name"], *entry["path"])] = entry["length"]
size += entry["length"]
keywords["contents"] = contents
elif "file tree" in info:
contents = {}
for k,v in parse_filetree(info["file tree"]).items():
for k, v in parse_filetree(info["file tree"]).items():
contents[os.path.join(info["name"], k)] = v
size += v
keywords["contents"] = contents
Expand Down Expand Up @@ -308,6 +307,7 @@ def __init__(self, parent=None):
font.setBold(True)
self.setFont(font)


def denom(num):
txt = str(num)
if int(num) < 1000:
Expand Down Expand Up @@ -341,5 +341,5 @@ def parse_filetree(filetree):
else:
out = parse_filetree(value)
for k, v in out.items():
paths[os.path.join(key,k)] = v
paths[os.path.join(key, k)] = v
return paths

0 comments on commit 0acc4a2

Please sign in to comment.