Skip to content

Commit

Permalink
Increase output verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
gwax committed Sep 25, 2016
1 parent 2d913f6 commit 6a57fab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 7 additions & 2 deletions mtg_ssm/mtg/counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ def find_printing(cdb, set_code, name, set_number, multiverseid, strict=True):
for snnm_key in snnm_keys:
found_printings = cdb.set_name_num_mv_to_printings.get(snnm_key, [])
if len(found_printings) == 1:
return found_printings[0]
printing = found_printings[0]
print('found: ' + printing.id_)
return printing
elif found_printings and not strict:
return sorted(found_printings, key=lambda p: p.id_)[0]
found_printings = sorted(found_printings, key=lambda p: p.id_)
printing = found_printings[0]
print('fuzzy found: ' + printing.id_)
return printing

return None

Expand Down
7 changes: 3 additions & 4 deletions mtg_ssm/ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def get_args(args=None):
'May be repeated for multiple different extensions.')

# Commands
subparsers = parser.add_subparsers(
dest='action', title='actions')
subparsers = parser.add_subparsers(dest='action', title='actions')
subparsers.required = True

create = subparsers.add_parser(
Expand Down Expand Up @@ -137,7 +136,7 @@ def get_backup_name(filename):
def write_file(serializer, print_counts, filename):
"""Write print counts to a file, backing up existing target files."""
if not os.path.exists(filename):
print('Writing collection to file.')
print('Writing collection to file: ' + filename)
serializer.write(filename, print_counts)
else:
backup_name = get_backup_name(filename)
Expand All @@ -146,7 +145,7 @@ def write_file(serializer, print_counts, filename):
serializer.write(temp_coll.name, print_counts)
print('Backing up exiting file to: ' + backup_name)
shutil.copy(filename, backup_name)
print('Overwriting with new collection')
print('Overwriting with new collection: ' + filename)
shutil.copy(temp_coll.name, filename)


Expand Down

0 comments on commit 6a57fab

Please sign in to comment.