Skip to content

Commit

Permalink
fixing errors and removing lidoscript
Browse files Browse the repository at this point in the history
  • Loading branch information
mokko committed Mar 8, 2024
1 parent a46c553 commit c6959de
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 66 deletions.
4 changes: 2 additions & 2 deletions test/test_file.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pathlib import Path
from zml2lido.file import per_chunk, unzip
from zml2lido.file import per_chunk


def test_per_chunk():
p = Path(r"C:\m3\zml2lido\sdata\GG\20240307\query516069-chunk1.lido.xml")
if not p.exists():
raise FileNotFound("p not found!")
raise FileNotFoundError("p not found!")
assert 2 == len(list(per_chunk(p)))
1 change: 0 additions & 1 deletion zml2lido/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


import argparse
import sys
from zml2lido.lidoTool import LidoTool
from zml2lido.linkChecker import LinkChecker
from zml2lido.vocmap import Vocmap
Expand Down
9 changes: 4 additions & 5 deletions zml2lido/lidoTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
import os
import re
import subprocess
import sys
from typing import Iterable, Optional
from typing import Iterable
from zipfile import ZipFile
from zml2lido.linkChecker import LinkChecker

Expand Down Expand Up @@ -102,7 +101,7 @@ def execute(self, job: str) -> None:
raise SyntaxError("ERROR: Unknown job name!")

def lfilter(self, *, split: bool = False, Type: str) -> None:
if not Type in xsl:
if Type not in xsl:
raise TypeError(f"Error: Unknown type '{Type}'")

new_fn = self.src.stem + f"-no{Type}.xml"
Expand Down Expand Up @@ -315,7 +314,7 @@ def saxon(self, *, src: str | Path, output: str | Path, xsl: str | Path) -> None
raise SyntaxError(f"ERROR: src {src} does not exist!")

if not Path(xsl).exists():
raise SyntaxError(f"ERROR: xsl file does not exist!")
raise SyntaxError("ERROR: xsl file does not exist!")

cmd = f"java -Xmx1450m -jar {saxLib} -s:{src} -xsl:{xsl} -o:{output}"
print(cmd)
Expand Down Expand Up @@ -399,7 +398,7 @@ def _sanitize(self, *, src: str | Path) -> Path:

if not Path(saxLib).is_file():
raise SyntaxError(
f"ERROR: Saxon not found, check environment variable saxLib"
"ERROR: Saxon not found, check environment variable saxLib"
)

# check src
Expand Down
53 changes: 0 additions & 53 deletions zml2lido/lidoscript.py

This file was deleted.

3 changes: 0 additions & 3 deletions zml2lido/linkChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
from lxml import etree
from mpapi.constants import get_credentials
from mpapi.client import MpApi
from mpapi.module import Module
from mpapi.search import Search
from pathlib import Path
import re
from typing import Any
import urllib.request
from zml2lido.relWorksCache import RelWorksCache
Expand Down
1 change: 0 additions & 1 deletion zml2lido/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"""

import argparse
from pathlib import Path

parser = argparse.ArgumentParser(description="Quality control for LIDO files")
parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion zml2lido/vocmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
from lxml import etree
from openpyxl import Workbook, load_workbook
from openpyxl import Workbook
from openpyxl.styles import Font
from pathlib import Path

Expand Down

0 comments on commit c6959de

Please sign in to comment.