Selaa lähdekoodia

Coding style fix

Kentaro Wada 7 vuotta sitten
vanhempi
commit
2a8bfc2226
1 muutettua tiedostoa jossa 6 lisäystä ja 5 poistoa
  1. 6 5
      labelme/app.py

+ 6 - 5
labelme/app.py

@@ -1130,18 +1130,19 @@ def main():
     parser.add_argument('--output', '-O', '-o', help='output label name')
     parser.add_argument('--nodata', dest='store_data', action='store_false',
                         help='stop storing image data to JSON file')
-    parser.add_argument('--labels', help='comma separated list of labels OR file containing one label per line')
+    parser.add_argument('--labels',
+                        help='comma separated list of labels OR file '
+                        'containing one label per line')
     parser.add_argument('--nosortlabels', dest='sort_labels',
                         action='store_false', help='stop sorting labels')
     args = parser.parse_args()
 
     if args.labels is not None:
         if os.path.isfile(args.labels):
-            args.labels = [l.strip()
-                           for l in open(args.labels, 'r').readlines()
-                           if len(l.strip()) > 0]
+            args.labels = [l.strip() for l in open(args.labels, 'r')
+                           if l.strip()]
         else:
-            args.labels = [l for l in args.labels.split(',') if len(l) > 0]
+            args.labels = [l for l in args.labels.split(',') if l]
 
     app = QApplication(sys.argv)
     app.setApplicationName(__appname__)