Skip to content

Commit 3a07b51

Browse files
committed
initial prep for adding çabrillo parser
1 parent 6cc8a9e commit 3a07b51

File tree

143 files changed

+144
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+144
-20
lines changed

README.md

Lines changed: 12 additions & 12 deletions

cabrillo.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
"""
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
"""
16+
17+
import cabrillo
18+
19+
class Operator(object):
20+
"""
21+
Keep operator callsign, info and logs path
22+
"""
23+
callsign = None
24+
logs = [] # list with Log() instances
25+
26+
def __init__(self, callsign):
27+
self.callsign = callsign
28+
self.logs = []
29+
30+
def add_log_by_path(self, path, rules=None, checklog=False):
31+
self.logs.append(Log(path, rules=rules, checklog=checklog))
32+
33+
def add_log_instance(self, log):
34+
self.logs.append(log)
35+
36+
37+
38+
class Log(object):
39+
use_as_checklog = False
40+
ignore_this_log = None # if flag is set this log will not be used in cross-check
41+
42+
qsos = list() # list with LogQso instances
43+
qsos_points = None
44+
qsos_confirmed = None
45+
46+
def __init__(self, path, rules=None, checklog=False):
47+
self.path = path
48+
self.rules = rules
49+
self.use_as_checklog = checklog
50+
self.ignore_this_log = False
51+
52+
# do header validation
53+
54+
# get qso's
55+
56+
class LogQso(object):
57+
def __init__(self, qso_line=None, qso_line_number=None, rules=None):
58+
self.qso_line = qso_line
59+
self.line_nr = qso_line_number
60+
self.rules = rules
61+
self.valid = True
62+
63+
# generic QSO validation
64+
65+
# contest specific QSO validation
66+
67+
def crosscheck_logs_filter(log_class, rules=None, logs_folder=None, checklogs_folder=None):
68+
pass
69+
70+
def crosscheck_logs(operator_instances, rules, band_nr):
71+
pass
72+
73+
def compare_qso(log1, qso1, log2, qso2):
74+
pass

edi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright 2016-2022 Ciorceri Petru Sorin (yo5pjb)
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

logXchecker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright 2016-2022 Ciorceri Petru Sorin (yo5pjb)
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
import sys
2121

2222
import edi
23+
import cabrillo
2324
import rules as _rules
2425
import version
2526
from edi import crosscheck_logs_filter

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dicttoxml==1.7.4
33
validate-email==1.3
44
pytest==7.2.0
55
pytest-cov==4.0.0
6+
cabrillo==0.1.2

rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright 2016-2022 Ciorceri Petru Sorin (yo5pjb)
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

test_edi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright 2016-2022 Ciorceri Petru Sorin (yo5pjb)
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

test_logXchecker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright 2016-2022 Ciorceri Petru Sorin (yo5pjb)
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

test_logs/rules_cabrillo.config

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[contest]
2+
name=Some generic rules
3+
begindate=20000101
4+
enddate=20240101
5+
beginhour=1200
6+
endhour=1159
7+
bands=4
8+
periods=1
9+
categories=1
10+
modes=1,2,6
11+
12+
[log]
13+
format=edi
14+
15+
[band1]
16+
band=80m
17+
regexp=3\d\d\d
18+
multiplier=1
19+
20+
[band2]
21+
band=40m
22+
regexp=7\d\d\d
23+
multiplier=1
24+
25+
[band3]
26+
band=20m
27+
regexp=14\d\d\d
28+
multiplier=1
29+
30+
[band4]
31+
band=15m
32+
regexp=21\d\d\d
33+
multiplier=1
34+
35+
[period1]
36+
begindate=20000101
37+
enddate=20240101
38+
beginhour=1200
39+
endhour=1159
40+
bands=band1,band2,band3,band4
41+
42+
[category1]
43+
name=Single Operator
44+
regexp=SINGLE-OP
45+
bands=band1,band2,band3,band4
46+
47+
[extra]
48+
callregexp=yo
File renamed without changes.

test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright 2016-2022 Ciorceri Petru Sorin (yo5pjb)
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

test_rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright 2016-2022 Ciorceri Petru Sorin (yo5pjb)
2+
Copyright 2016-2024 Ciorceri Petru Sorin (yo5pjb)
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__project__ = "logXchecker"
2-
__version__ = "1.4"
2+
__version__ = "1.5"

0 commit comments

Comments
 (0)