Commits

Yusuke MURAOKA committed 33adfe0

beautify

Comments (0)

Files changed (1)

scripts/unzip-sjis

     with zf.ZipFile(args.zip_file) as z:
         if args.password:
             z.setpassword(args.password)
+
         for zinfo in z.infolist():
             file_name = zinfo.filename.decode('sjis').encode('utf-8')
+
             if args.list:
                 print("%d\t%d/%d/%d %d:%d:%d\t%s" %
                       ((zinfo.file_size,) + zinfo.date_time + (file_name,)))
                 continue
+
             if args.entries and file_name not in args.entries:
                 continue
+
+            # mkdir -p
             dir_name = os.path.dirname(file_name)
             try:
                 os.makedirs(dir_name)
             except os.error:
                 pass
+
             if not file_name.endswith('/'):
                 bin = z.read(zinfo)
                 with open(file_name, 'wb') as f: