Commits

kiri  committed 6622ae2

parameters bugfix

  • Participants
  • Parent commits 5c8cbe3

Comments (0)

Files changed (1)

     if args.verbose:
         print("*** Resizing '{}' ('{}', baseline: {:d}px):".format(source, export_name, args.base_size))
 
-    args.include = list(filter(lambda s: s != "", args.include))
-    args.exclude = list(filter(lambda s: s != "", args.exclude))
+    args.include = list(filter(lambda s: s != "", args.include if args.include is not None else []))
+    args.exclude = list(filter(lambda s: s != "", args.exclude if args.exclude is not None else []))
     include = args.include if 0 < len(args.include) else list(defaults["groups"].keys())
     exclude = args.exclude
     if args.verbose:
         print("*** Spreading '{}' over the project tree:".format(args.export_name))
 
     export_name = args.export_name
-    args.include = list(filter(lambda s: s != "", args.include))
-    args.exclude = list(filter(lambda s: s != "", args.exclude))
+    args.include = list(filter(lambda s: s != "", args.include if args.include is not None else []))
+    args.exclude = list(filter(lambda s: s != "", args.exclude if args.exclude is not None else []))
     include = args.include if 0 < len(args.include) else list(defaults["groups"].keys())
     exclude = args.exclude
     if args.verbose:
             print("")
             inc = " ".join(include) if isinstance(include, list) else include
             exc = " ".join(exclude) if isinstance(exclude, list) else exclude
-            p = ["copy", "-i", inc, "-x", exc]
+            p = ["copy"]
+            if 0 < len(inc):
+                p += ["-i", inc]
+            if 0 < len(exc):
+                p += ["-x", exc]
             p += [attrs['export_name'], os.environ.get("PROJECT_PATH", defs["project_path"])]
             ns = parser.parse_args(p)
             ns.verbose = args.verbose