Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions etc/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def create_virtualenv_py2(std_python, root_dir, tpp_dirs=(), quiet=False):
vendored Python distributions that pip will use to find required
components.
"""

if not quiet:
print("* Configuring Python ...")
# search virtualenv.py in the tpp_dirs. keep the first found
Expand Down
3 changes: 3 additions & 0 deletions src/deltacode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ def __init__(self, new_path, old_path, options):
self.new = Scan(new_path)
self.old = Scan(old_path)
self.options = options
self.scannedOptions = dict({'--new':str(),'--old':str()})
self.deltas = []
self.errors = []
self.stats = Stat(self.new.files_count, self.old.files_count)

if self.new.path != '' and self.old.path != '':
self.scannedOptions['--new'] = self.new.get_scanned_options()
self.scannedOptions['--old'] = self.old.get_scanned_options()
self.determine_delta()
self.determine_moved()
self.license_diff()
Expand Down
1 change: 1 addition & 0 deletions src/deltacode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def write_json(deltacode, outfile, all_delta_types=False):
('deltacode_notice', get_notice()),
('deltacode_options', deltacode.options),
('deltacode_version', __version__),
('scanned_options',deltacode.scannedOptions),
('deltacode_errors', collect_errors(deltacode)),
('deltas_count', len([d for d in deltas(deltacode, all_delta_types)])),
('delta_stats', deltacode.stats.to_dict()),
Expand Down
26 changes: 25 additions & 1 deletion src/deltacode/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, path=''):
path = ''

self.errors = []

if not self.is_valid_scan(path):
self.path = ''
self.files_count = 0
Expand All @@ -53,6 +53,30 @@ def __init__(self, path=''):
self.files_count = self.get_files_count(path)
self.files = self.load_files(path)
self.options = self.get_options(path)

def get_scanned_options(self):
try:
scan = json.loads(open(self.path).read())
except IOError:
return
scan = json.loads(open(self.path).read())
scanned_options = []
headers = scan.get('headers')
if headers:
headers = headers[0].get('options')
has_copyright = headers.get('--copyright')
has_license = headers.get('--license')
has_info = headers.get('--info')
has_package = headers.get('--package')
if has_copyright:
scanned_options.append('--copyright')
if has_info:
scanned_options.append('--info')
if has_license:
scanned_options.append('--license')
if has_package:
scanned_options.append('--package')
return ' '.join(scanned_options)

def get_options(self, path):
"""
Expand Down
Loading