Skip to content

Commit

Permalink
Restore compatibility with Python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentzo committed Mar 17, 2017
1 parent 00a229c commit 0d11702
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions git_archive_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED
import re

__version__ = "1.16"
__version__ = "1.16.4"


class GitArchiver(object):
Expand Down Expand Up @@ -87,7 +87,7 @@ def __init__(self, prefix='', exclude=True, force_sub=False, extra=None, main_re
try:
main_repo_abspath = path.abspath(self.run_git_shell('git rev-parse --show-toplevel', main_repo_abspath).rstrip())
except CalledProcessError:
raise ValueError("{} is not part of a git repository".format(main_repo_abspath))
raise ValueError("{0} is not part of a git repository".format(main_repo_abspath))

self.prefix = prefix
self.exclude = exclude
Expand Down Expand Up @@ -115,7 +115,7 @@ def create(self, output_path, dry_run=False, output_format=None):
if output_format is None:
file_name, file_ext = path.splitext(output_path)
output_format = file_ext[len(extsep):].lower()
self.LOG.debug("Output format is not explicitly set, determined format is {}.".format(output_format))
self.LOG.debug("Output format is not explicitly set, determined format is {0}.".format(output_format))

if not dry_run:
if output_format == 'zip':
Expand Down Expand Up @@ -144,16 +144,16 @@ def add_file(file_path, arcname):
def add_file(file_path, arcname):
archive.add(file_path, arcname)
else:
raise RuntimeError("unknown format: {}".format(output_format))
raise RuntimeError("unknown format: {0}".format(output_format))

def archiver(file_path, arcname):
self.LOG.debug("Compressing {} => {}...".format(file_path, arcname))
self.LOG.debug("Compressing {0} => {1}...".format(file_path, arcname))
add_file(file_path, arcname)
else:
archive = None

def archiver(file_path, arcname):
self.LOG.info("{} => {}".format(file_path, arcname))
self.LOG.info("{0} => {1}".format(file_path, arcname))

self.archive_all_files(archiver)

Expand Down

0 comments on commit 0d11702

Please sign in to comment.