+ def find_prefix():
+ """ Find comon prefix of all files in package. This prefix will be
+ used to collapse directory structure during extraction to eliminate
+ empty nested folders.
+ """
+ common_dir = set()
+ for f in self.files:
+ common_dir.add(os.path.dirname(f))
+ prefix = os.path.commonprefix(list(common_dir))
+ return prefix if prefix else None
+