Skip to content

Commit 5e872e7

Browse files
committed
Fixed the case when we have a cross-check without rules
1 parent c55d1f7 commit 5e872e7

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

edi.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -779,14 +779,17 @@ def crosscheck_logs_filter(log_class, rules=None, logs_folder=None, checklogs_fo
779779

780780
ignored_logs = []
781781

782+
if not rules:
783+
print('No rules were provided')
784+
return {}
782785
# create instances for all logs
783786
logs_instances = []
784787
if not logs_folder:
785788
print('Logs folder was not provided')
786-
return 1
789+
return {}
787790
if logs_folder and not os.path.isdir(logs_folder):
788791
print('Cannot open logs folder : {}'.format(logs_folder))
789-
return 1
792+
return {}
790793
for filename in os.listdir(logs_folder):
791794
logs_instances.append(log_class(os.path.join(logs_folder, filename), rules=rules))
792795

@@ -796,7 +799,7 @@ def crosscheck_logs_filter(log_class, rules=None, logs_folder=None, checklogs_fo
796799
logs_instances.append(log_class(os.path.join(checklogs_folder, filename), rules=rules, checklog=True))
797800
else:
798801
print('Cannot open checklogs folder : {}'.format(checklogs_folder))
799-
return 1
802+
return {}
800803

801804
# create instances for all hams and add logs with valid header
802805
operator_instances = {}

logXchecker.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,17 @@ def print_log_human_friendly(output):
145145

146146

147147
def print_csv_output(output):
148-
# single log
149-
if output.get(edi.INFO_LOG, False):
150-
print('NOT IMPLEMENTED')
151-
# multi logs
152-
if output.get(edi.INFO_MLC, False):
153-
print('NOT IMPLEMENTED')
154148
# cross check
155-
elif output.get(edi.INFO_CC, False):
149+
if output.get(edi.INFO_CC, False):
156150
print('Callsign, ValidLog, Band, Category, ConfirmedQso, Points')
157151
for _call, _values in output[edi.INFO_OPERATORS].items():
158152
for _band, _details in _values['band'].items():
159153
if not _details.get('checklog', False) is True:
160154
print('{}, {}, {}, {}, {}, {}'.format(_call, _details['valid'], _band, _details['category'], _details['qsos_confirmed'], _details['points']))
155+
else:
156+
# if output.get(edi.INFO_LOG, False):
157+
# if output.get(edi.INFO_MLC, False):
158+
print('NOT IMPLEMENTED')
161159

162160

163161
def main():

0 commit comments

Comments
 (0)