]> git.phdru.name Git - dotfiles.git/commitdiff
unzip.py: minor refactoring
authorOleg Broytman <phd@phdru.name>
Fri, 10 Jun 2016 13:20:40 +0000 (16:20 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 10 Jun 2016 13:20:40 +0000 (16:20 +0300)
bin/unzip.py

index a5d3cf35e20ab4f41d670fd4965233388d388897..42bf4db32de6ab56f6e9a72ceabcc40704afc09f 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 """Unzip with encoded filenames
 
-   Written by Oleg Broytman. Copyright (C) 2009, 2010 PhiloSoft Design.
+   Written by Oleg Broytman. Copyright (C) 2009-2016 PhiloSoft Design.
 """
 
 import sys, os, time
@@ -32,9 +32,8 @@ for zinfo in zf.infolist():
     print recoded_path
 
     if path.startswith('./'):
-        tgt = os.path.join(out, recoded_path[2:])
-    else:
-        tgt = os.path.join(out, recoded_path)
+        recoded_path = recoded_path[2:]
+    tgt = os.path.join(out, recoded_path)
 
     tgtdir = os.path.dirname(tgt)
     if not os.path.exists(tgtdir):