efj-parser 0.9__tar.gz → 0.9.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: efj-parser
3
- Version: 0.9
3
+ Version: 0.9.2
4
4
  Summary: Parse an electronic Flight Journal file
5
5
  Home-page: https://github.com/JonHurst/efj_parser
6
6
  Author: Jon Hurst
7
7
  Author-email: jon.a@hursts.org.uk
8
+ Project-URL: docs, https://hursts.org.uk/efjdocs/
8
9
  Classifier: Development Status :: 4 - Beta
9
10
  Classifier: Programming Language :: Python :: 3
10
11
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -123,8 +123,11 @@ class Parser():
123
123
  ftl_correction = 0
124
124
  unused_flags = []
125
125
  for f in flags:
126
- if f and (mo_cor := re.match(r"r(\d+)", f)):
127
- ftl_correction = int(mo_cor.group(1))
126
+ if f and (mo_cor := re.match(r"r(:\d+)?", f)):
127
+ if mo_cor.group(1):
128
+ ftl_correction = int(mo_cor.group(1)[1:])
129
+ else:
130
+ ftl_correction = duration
128
131
  else:
129
132
  unused_flags.append(f)
130
133
  comment = mo.group(4)[1:].strip() if mo.group(4) else ""
@@ -245,7 +248,7 @@ class Parser():
245
248
  self.__parse_nextdate, "short_date"),
246
249
  (re.compile(r"\A(\d{4})/(\d{4})([^#]*)(#.+)?\Z"),
247
250
  self.__parse_duty, "duty"),
248
- (re.compile(r"(\w{1,2}-\w{3,5})\s*:\s*([-\w]+)"),
251
+ (re.compile(r"([-\w]{2,10})\s*:\s*([-\w]+)"),
249
252
  self.__parse_aircraft, "aircraft"),
250
253
  (re.compile(r"\{([^}]*)}\Z"),
251
254
  self.__parse_crewlist, "crewlist"),
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: efj-parser
3
- Version: 0.9
3
+ Version: 0.9.2
4
4
  Summary: Parse an electronic Flight Journal file
5
5
  Home-page: https://github.com/JonHurst/efj_parser
6
6
  Author: Jon Hurst
7
7
  Author-email: jon.a@hursts.org.uk
8
+ Project-URL: docs, https://hursts.org.uk/efjdocs/
8
9
  Classifier: Development Status :: 4 - Beta
9
10
  Classifier: Programming Language :: Python :: 3
10
11
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="efj-parser",
8
- version="0.9",
8
+ version="0.9.2",
9
9
  author="Jon Hurst",
10
10
  author_email="jon.a@hursts.org.uk",
11
11
  description="Parse an electronic Flight Journal file",
@@ -22,4 +22,7 @@ setuptools.setup(
22
22
  "Operating System :: OS Independent",
23
23
  ],
24
24
  python_requires='>=3.11',
25
+ project_urls = {
26
+ "docs" : "https://hursts.org.uk/efjdocs/",
27
+ },
25
28
  )
@@ -10,19 +10,21 @@ class TestParser(unittest.TestCase):
10
10
  data = """\
11
11
  2024-01-21
12
12
  1000/1430
13
- G-ABCD:320
13
+ N1:320
14
14
  {FO: Bloggs}
15
15
  BRS/BFS 1100/1200 ins #belfast
16
16
  / 1300/1400 ins:20 test spme
17
17
  {}
18
18
  +
19
19
  1000/1610 # Comment
20
- G-EFGH:321
20
+ OB-T-1274:A-321
21
21
  /NCE 1100/1300 ld:3
22
22
  / 1340/1540 v:30 n:10 ln
23
23
 
24
24
  ++
25
- 0600/1200 r60 test # ESBY
25
+ 0600/1200 r:60 test # ESBY
26
+ +
27
+ 0600/0630 r # HCT
26
28
  """
27
29
  expected_duties = (
28
30
  efj.Duty(
@@ -33,7 +35,11 @@ G-EFGH:321
33
35
  370, 0, (), "Comment"),
34
36
  efj.Duty(
35
37
  dt.datetime(2024, 1, 24, 6),
36
- 360, 60, ("test",), "ESBY"))
38
+ 360, 60, ("test",), "ESBY"),
39
+ efj.Duty(
40
+ dt.datetime(2024, 1, 25, 6),
41
+ 30, 30, (), "HCT")
42
+ )
37
43
 
38
44
  expected_sectors = (
39
45
  efj.Sector(
@@ -41,7 +47,7 @@ G-EFGH:321
41
47
  efj.Roles(p1=60, instructor=60),
42
48
  efj.Conditions(ifr=60),
43
49
  efj.Landings(day=1),
44
- efj.Aircraft("G-ABCD", "320"),
50
+ efj.Aircraft("N1", "320"),
45
51
  efj.Airports("BRS", "BFS"),
46
52
  "Self", (), "belfast",
47
53
  (efj.Crewmember("FO", "Bloggs"),)),
@@ -50,7 +56,7 @@ G-EFGH:321
50
56
  efj.Roles(p1=60, instructor=20),
51
57
  efj.Conditions(ifr=60),
52
58
  efj.Landings(day=1),
53
- efj.Aircraft("G-ABCD", "320", "spme"),
59
+ efj.Aircraft("N1", "320", "spme"),
54
60
  efj.Airports("BFS", "BRS"),
55
61
  "Self", ("test",), "",
56
62
  (efj.Crewmember("FO", "Bloggs"),)),
@@ -59,7 +65,7 @@ G-EFGH:321
59
65
  efj.Roles(p1=120),
60
66
  efj.Conditions(ifr=120),
61
67
  efj.Landings(day=3),
62
- efj.Aircraft("G-EFGH", "321"),
68
+ efj.Aircraft("OB-T-1274", "A-321"),
63
69
  efj.Airports("BRS", "NCE"),
64
70
  "Self", (), "", ()),
65
71
  efj.Sector(
@@ -67,7 +73,7 @@ G-EFGH:321
67
73
  efj.Roles(p1=120),
68
74
  efj.Conditions(night=10, ifr=90),
69
75
  efj.Landings(night=1),
70
- efj.Aircraft("G-EFGH", "321"),
76
+ efj.Aircraft("OB-T-1274", "A-321"),
71
77
  efj.Airports("NCE", "BRS"),
72
78
  "Self", (), "", ()))
73
79
  self.assertEqual(
File without changes
File without changes
File without changes
File without changes
File without changes