Преглед изворни кода

Reformat files with Black 20.8b1

Kentaro Wada пре 4 година
родитељ
комит
ab3d9b32d4
3 измењених фајлова са 21 додато и 7 уклоњено
  1. 13 5
      labelme/app.py
  2. 5 1
      labelme/cli/on_docker.py
  3. 3 1
      labelme/logger.py

+ 13 - 5
labelme/app.py

@@ -1032,7 +1032,9 @@ class MainWindow(QtWidgets.QMainWindow):
         if shape is None:
             return
         text, flags, group_id = self.labelDialog.popUp(
-            text=shape.label, flags=shape.flags, group_id=shape.group_id,
+            text=shape.label,
+            flags=shape.flags,
+            group_id=shape.group_id,
         )
         if text is None:
             return
@@ -1059,7 +1061,9 @@ class MainWindow(QtWidgets.QMainWindow):
 
     def fileSearchChanged(self):
         self.importDirImages(
-            self.lastOpenDir, pattern=self.fileSearch.text(), load=False,
+            self.lastOpenDir,
+            pattern=self.fileSearch.text(),
+            load=False,
         )
 
     def fileSelectionChanged(self):
@@ -1165,7 +1169,9 @@ class MainWindow(QtWidgets.QMainWindow):
             other_data = shape["other_data"]
 
             shape = Shape(
-                label=label, shape_type=shape_type, group_id=group_id,
+                label=label,
+                shape_type=shape_type,
+                group_id=group_id,
             )
             for x, y in points:
                 shape.addPoint(QtCore.QPointF(x, y))
@@ -1358,7 +1364,8 @@ class MainWindow(QtWidgets.QMainWindow):
                 self.scrollBars[Qt.Horizontal].value() + x_shift,
             )
             self.setScroll(
-                Qt.Vertical, self.scrollBars[Qt.Vertical].value() + y_shift,
+                Qt.Vertical,
+                self.scrollBars[Qt.Vertical].value() + y_shift,
             )
 
     def setFitWindow(self, value=True):
@@ -1446,7 +1453,8 @@ class MainWindow(QtWidgets.QMainWindow):
                 return False
             self.imageData = self.labelFile.imageData
             self.imagePath = osp.join(
-                osp.dirname(label_file), self.labelFile.imagePath,
+                osp.dirname(label_file),
+                self.labelFile.imagePath,
             )
             self.otherData = self.labelFile.otherData
         else:

+ 5 - 1
labelme/cli/on_docker.py

@@ -55,7 +55,11 @@ def labelme_on_docker(in_file, out_file):
     )
     in_file_a = osp.abspath(in_file)
     in_file_b = osp.join("/home/developer", osp.basename(in_file))
-    cmd = cmd.format(ip, in_file_a, in_file_b,)
+    cmd = cmd.format(
+        ip,
+        in_file_a,
+        in_file_b,
+    )
     if out_file:
         out_file_a = osp.abspath(out_file)
         out_file_b = osp.join("/home/developer", osp.basename(out_file))

+ 3 - 1
labelme/logger.py

@@ -32,7 +32,9 @@ class ColoredFormatter(logging.Formatter):
 
             def colored(text):
                 return termcolor.colored(
-                    text, color=COLORS[levelname], attrs={"bold": True},
+                    text,
+                    color=COLORS[levelname],
+                    attrs={"bold": True},
                 )
 
             record.levelname2 = colored("{:<7}".format(record.levelname))